#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<int> p(int maxVal) {
vector<int> divCount(maxVal+1, 0);
for (int d = 1; d <= maxVal; d++){
for (int m = 2*d; m <= maxVal; m += d){
divCount[m]++;
}
}
return divCount;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tc;
cin >> tc;
const int MAX_N = 1000000;
vector<int> divCount = p(MAX_N);
while(tc--){
int n;
cin >> n;
string s;
cin >> s;
int r = 0;
char last = '\0';
for (int i = 0; i < n; i++){
if(i == 0 || s[i] != last){
r++;
}
last = s[i];
int L = i + 1;
int t = r - 1;
int countValid = 0;
countValid += (L - t);
if(r >= 2) {
countValid += divCount[r];
}
cout << countValid << (i+1 == n ? "\n" : " ");
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCnZlY3RvcjxpbnQ+IHAoaW50IG1heFZhbCkgewogICAgdmVjdG9yPGludD4gZGl2Q291bnQobWF4VmFsKzEsIDApOwogICAgZm9yIChpbnQgZCA9IDE7IGQgPD0gbWF4VmFsOyBkKyspewogICAgICAgIGZvciAoaW50IG0gPSAyKmQ7IG0gPD0gbWF4VmFsOyBtICs9IGQpewogICAgICAgICAgICBkaXZDb3VudFttXSsrOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiBkaXZDb3VudDsKfQogCmludCBtYWluKCl7CiAgICBpb3M6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBjaW4udGllKG51bGxwdHIpOwogCiAgICBpbnQgdGM7CiAgICBjaW4gPj4gdGM7CiAgICBjb25zdCBpbnQgTUFYX04gPSAxMDAwMDAwOwogICAgdmVjdG9yPGludD4gZGl2Q291bnQgPSBwKE1BWF9OKTsKICAgIAogICAgd2hpbGUodGMtLSl7CiAgICAgICAgaW50IG47CiAgICAgICAgY2luID4+IG47CiAgICAgICAgc3RyaW5nIHM7CiAgICAgICAgY2luID4+IHM7CiAgICAgICAgaW50IHIgPSAwOwogICAgICAgIGNoYXIgbGFzdCA9ICdcMCc7CiAKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKyl7CiAgICAgICAgICAgIGlmKGkgPT0gMCB8fCBzW2ldICE9IGxhc3QpewogICAgICAgICAgICAgICAgcisrOyAgCiAgICAgICAgICAgIH0KICAgICAgICAgICAgbGFzdCA9IHNbaV07CiAKICAgICAgICAgICAgaW50IEwgPSBpICsgMTsKICAgICAgICAgICAgaW50IHQgPSByIC0gMTsgCiAgICAgICAgICAgIGludCBjb3VudFZhbGlkID0gMDsKIAogICAgICAgICAgICBjb3VudFZhbGlkICs9IChMIC0gdCk7CiAKICAgICAgICAgICAgaWYociA+PSAyKSB7CiAgICAgICAgICAgICAgICBjb3VudFZhbGlkICs9IGRpdkNvdW50W3JdOwogICAgICAgICAgICB9CiAKICAgICAgICAgICAgY291dCA8PCBjb3VudFZhbGlkIDw8IChpKzEgPT0gbiA/ICJcbiIgOiAiICIpOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiAwOwp9