#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
map<pair<int,int>,int> mp;
int gcd(int x,int y){
return y==0?x:gcd(y,x%y);
}
void solve(){
int n;
mp.clear();
scanf("%d",&n);
int d=0,k=0;
string t;
cin>>t;
for(int i=0;i<n;i++)
{
if(t[i]=='D')d++;
else k++;
int x,y;
x=d/gcd(d,k),y=k/gcd(d,k);
pair<int,int> p={x,y};
mp[p]++;
if(d==0)printf("%d ",k);
else if(k==0)printf("%d ",d);
else printf("%d ",mp[p]);
}
printf("\n");
}
int main()
{
int T;
scanf("%d",&T);
while(T--)solve();
return 0;
}
06-07
244
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-01
851
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-02
1344
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)