human
Solve in Python:
Alice and Bob play a game. The game consists of several sets, and each set consists of several rounds. Each round is won either by Alice or by Bob, and the set ends when one of the players has won $x$ rounds in a row. For example, if Bob won five rounds in a row and $x = 2$, then two sets ends.

You know that Alice and Bob have already played $n$ rounds, and you know the results of some rounds. For each $x$ from $1$ to $n$, calculate the maximum possible number of sets that could have already finished if each set lasts until one of the players wins $x$ rounds in a row. It is possible that the last set is still not finished — in that case, you should not count it in the answer.

-----Input-----

The first line contains one integer $n$ ($1 \le n \le 10^6$) — the number of rounds.

The second line contains one string $s$ of length $n$ — the descriptions of rounds. If the $i$-th element of the string is 0, then Alice won the $i$-th round.
if it is 1, then Bob won the $i$-th round, and if it is ?, then you don't know who won the $i$-th round.

-----Output-----

In the only line print $n$ integers. The $i$-th integer should be equal to the maximum possible number of sets that could have already finished if each set lasts until one of the players wins $i$ rounds in a row.

-----Examples-----
Input
6
11?000

Output
6 3 2 1 0 0 

Input
5
01?01

Output
5 1 0 0 0 

Input
12
???1??????1?

Output
12 6 4 3 2 2 1 1 1 1 1 1 


-----Note-----

Let's consider the first test case:

  if $x = 1$ and $s = 110000$ or $s = 111000$ then there are six finished sets.
 if $x = 2$ and $s = 110000$ then there are three finished sets.
 if $x = 3$ and $s = 111000$ then there are two finished sets.
 if $x = 4$ and $s = 110000$ then there is one finished set.
 if $x = 5$ then there are no finished sets.
 if $x = 6$ then there are no finished sets.
assistant
#Here is Python program to print $n$ integers.

class bitset():
    def __init__(self,n):
        self.size=1<<((n+2).bit_length())
        self.bit=[0]*(self.size+1)

    def append(self,val):
        val+=1
        id=val
        while id<=self.size:
            self.bit[id]+=1
            id+=(id)&(-id)

    def erase(self,val):
        val+=1
        id=val
        while id<=self.size:
            self.bit[id]-=1
            id+=(id)&(-id)

    def cnt(self,val):
        res_sum = 0
        val+=1
        while val > 0:
            res_sum += self.bit[val]
            val -= val&(-val)
        return res_sum

    def next(self,val):
        val+=1
        base=self.cnt(val-1)
        start=0
        end=self.size
        while end-start>1:
            test=(end+start)//2
            if self.bit[test]>base:
                end=test
            else:
                start=test
                base-=self.bit[test]
        return end-1

n=int(input())
s=input()

alice=[int(s[i]=="0") for i in range(n)]
bob=[int(s[i]=="1") for i in range(n)]
for i in range(1,n):
    alice[i]+=alice[i-1]
    bob[i]+=bob[i-1]
alice.append(0)
bob.append(0)

update_que=[[] for i in range(n)]

alice_win=[]
id=0
while id<n:
    if s[id]!="0":
        pos=id
        while pos<n and s[pos]!="0":
            pos+=1
        update_que[pos-id-1].append(id)
        id=pos
    else:
        id+=1
bob_win=[]
id=0
while id<n:
    if s[id]!="1":
        pos=id
        while pos<n and s[pos]!="1":
            pos+=1
        update_que[pos-id-1].append(id)
        id=pos
    else:
        id+=1

bst=bitset(n)
bst.append(n)

ans=[0]*n
for i in range(n-1,-1,-1):
    for id in update_que[i]:
        bst.append(id)
    pos=0
    res=0
    while pos<n-i:
        check1=alice[pos+i]-alice[pos-1]
        check2=bob[pos+i]-bob[pos-1]
        if not check1 or not check2:
            res+=1
            pos+=i+1
        else:
            npos=bst.next(pos)
            if npos==n:
                break
            else:
                pos=npos+i+1
                res+=1
    ans[i]=res

print(*ans)