Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

H, W = map(int, input().split())
S = []
for i in range(H):
    S.append(input())
    
ans_W = [[-1 for i in range(W)] for j in range(H)]
for i in range(H):
    count = 0
    now = 0
    for j in range(W):
        if S[i][j] == ".":
            count += 1
        else:
            for k in range(now, min(W, now+1+count)):
                if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(W, now+1+count)):
            ans_W[i][k] = count

ans_H = [[-1 for i in range(W)] for j in range(H)]
for i in range(W):
    count = 0
    now = 0
    for j in range(H):
        if S[j][i] == ".":
            count += 1
        else:
            for k in range(now, min(H, now+1+count)):
                if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(H, now+1+count)):
            ans_H[k][i] = count

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, ans_H[i][j] + ans_W[i][j])
            
print(ans-1)


### FIXED CODE ###

H, W = map(int, input().split())
S = []
for i in range(H):
    S.append(input())
    
ans_W = [[-1 for i in range(W)] for j in range(H)]
for i in range(H):
    count = 0
    now = 0
    for j in range(W):
        if S[i][j] == ".":
            count += 1
        else:
            for k in range(now, min(W, now+1+count)):
                if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(W, now+1+count)):
            ans_W[i][k] = count

ans_H = [[-1 for i in range(W)] for j in range(H)]
for i in range(W):
    count = 0
    now = 0
    for j in range(H):
        if S[j][i] == ".":
            count += 1
        else:
            for k in range(now, min(H, now+1+count)):
                if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(H, now+1+count)):
            ans_H[k][i] = count

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, ans_H[i][j] + ans_W[i][j])
            
print(ans-1)
### BUGGY CODE ###

def popcount(x):
    return bin(x).count("1")
def solve(n):
    if n == 0:
        return 0
    return 1+solve(n % popcount(n))

N = int(input())
X = input()
num_x = int(X, 2)
p_cnt = X.count('1')
if p_cnt == 1:
    for i in range(N):
        if X[i] == '1':
            print(0)
        elif i == N-1:
            print(2)
        else:
            print(1)
    exit()
r0_p = num_x % (p_cnt+1)
r0_m = num_x % (p_cnt-1)
for i in range(N):
    if X[i] == '0':
        c_p_cnt = p_cnt+1
        r = r0_p + (2**(N-1-i) % c_p_cnt)
    else:
        c_p_cnt = p_cnt-1
        if c_p_cnt == 0:
            print(0)
            continue
        r = r0_m - (2**(N-1-i) % c_p_cnt)
    print(1 + solve(r % c_p_cnt))



### FIXED CODE ###

def popcount(x):
    return bin(x).count("1")
def solve(n):
    if n == 0:
        return 0
    return 1+solve(n % popcount(n))

N = int(input())
X = input()
num_x = int(X, 2)
p_cnt = X.count('1')
if p_cnt == 1:
    for i in range(N):
        if X[i] == '1':
            print(0)
        elif i == N-1:
            print(2)
        else:
            print(1)
    exit()
r0_p = num_x % (p_cnt+1)
r0_m = num_x % (p_cnt-1)
for i in range(N):
    if X[i] == '0':
        c_p_cnt = p_cnt+1
        r = (r0_p + pow(2, (N - 1 - i), c_p_cnt)) % c_p_cnt
    else:
        c_p_cnt = p_cnt-1
        if c_p_cnt == 0:
            print(0)
            continue
        r = (r0_m- pow(2, (N - 1 - i), c_p_cnt)) % c_p_cnt
    print(1 + solve(r % c_p_cnt))
### BUGGY CODE ###

from operator import itemgetter
import sys


class BIT:
    def __init__(self, size: int):
        self.size = size + 1
        self.array = [0] * self.size

    def add(self, i):
        while i < self.size:
            self.array[i] += 1
            i += i & -i

    def sub(self, i):
        while i < self.size:
            self.array[i] -= 1
            i += i & -i

    def sum(self, a, b):
        s = 0
        i = b
        while i > 0:
            s += self.array[i]
            i -= i & -i
        i = a - 1
        while i > 0:
            s -= self.array[i]
            i -= i & -i
        return s


def read():
    return sys.stdin.readline().rstrip()


def main():
    n, q = map(int, read().split())
    c = [int(i) - 1 for i in read().split()]
    queries = [(0, 0, 0) for _ in range(q)]
    for i in range(q):
        l, r = map(int, read().split())
        queries[i] = (i, l, r)
    queries = iter(sorted(queries, key=itemgetter(2)))
    last = [0] * n
    bit = BIT(n)
    ans = [-1] * q
    k, l, r = next(queries)
    for i in range(n):
        ci = c[i]
        li = last[ci]
        if li > 0:
            bit.sub(li)
        last[ci] = i + 1
        bit.add(i + 1)
        while i + 1 == r:
            ans[k] = bit.sum(l, r)
            try:
                k, l, r = next(queries)
            except StopIteration:
                break
    print(*ans, sep="\n")


if __name__ == '__main__':
    main()


### FIXED CODE ###

from operator import itemgetter
import sys


class BIT:
    def __init__(self, size: int):
        self.size = size + 1
        self.array = [0] * self.size

    def add(self, i, x):
        if not i > 0:
            return
        while i < self.size:
            self.array[i] += x
            i += i & -i

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.array[i]
            i -= i & -i
        return s


def read():
    return sys.stdin.readline().rstrip()


def main():
    n, q = map(int, read().split())
    c = [int(i) for i in read().split()]
    queries = [() for _ in range(q)]
    for i in range(q):
        l, r = map(int, read().split())
        queries[i] = (i, l, r)
    queries.sort(key=itemgetter(2))
    last = [0] * n
    bit = BIT(n)
    ans = [-1] * q
    cr = 0
    for i, l, r in queries:
        for ri in range(cr, r):
            ci = c[ri] - 1
            bit.add(last[ci], -1)
            last[ci] = ri + 1
            bit.add(last[ci], 1)
            cr = ri
        ans[i] = bit.sum(r) - bit.sum(l - 1)
    print(*ans, sep="\n")


if __name__ == '__main__':
    main()
### BUGGY CODE ###

import itertools

line=input()
n,k=map(int,line.split())
s=set(list(range(n+1)))
sums=list()
while k!=(n+2):
     koko=list()
     sub=list(itertools.combinations(s,k))
     #print(sub)
     for val in sub:
          soso=0
          for i in val:
               soso+=(i+(10**100))
               soso=(soso%((10**9)+7))
          if soso not in sums:
               #soso=(soso%((10**9)+7))
               sums.append(soso)
          
               
          
     
     
     
     k+=1
#jojo=(%((10**9)+7))
print((len(sums)))


### FIXED CODE ###

line=input()
n,k=map(int,line.split())
sums=0
while k!=(n+2):
     if k==1:
          mini=0
     if k>=2:
          mini=(((k)*(k-1))/2)#%((10**9)+7)
     maxi=( (((n+1)*(n)) - ((n+1-k)*(n-k)) )/2  )#%((10**9)+7)
     sums+=(maxi-mini+1)
     sums=sums%((10**9)+7)
     k+=1
print(int(sums))
### BUGGY CODE ###

import numpy as np
n, q = (int(_) for _ in input().split())  
arr = np.array([[1 if i == j else 0 for i in range(n)] for j in range(n)])
output = np.array([0 for i in range(n)])

for i in range(n-1):
  a, b = (int(_) for _ in input().split()) 
  arr[a-1][b-1] = 1
  for x in range(a-1):
    if arr[x][a-1] == 1:
      arr[x][b-1] = 1

for i in range(q):
  p, q = (int(_) for _ in input().split()) 
  output += arr[p-1] * q
    
print(' '.join([str(x) for x in output]))

### FIXED CODE ###

n,q=map(int,input().split())
a=[0]*(n-1)
c=[0 for i in range(n)]
for i in range(n-1):
  a[i]=list(map(int,input().split()))

a.sort()

for i in range(q):
  x,y=map(int,input().split())
  c[x-1]+=y

for i in range(n-1):
  c[a[i][1]-1]+=c[a[i][0]-1]

print(*c)
### BUGGY CODE ###

A, B, Q = map(int, input().split())
s = [int(input()) for _ in range(A)]
t = [int(input()) for _ in range(B)]
x = [int(input()) for _ in range(Q)]
inf = 10 ** 18

s = [-inf] + s + [inf]
t = [-inf] + t + [inf]

ans_Q = [None] * Q
i_last = j_last = 0
for idx, x_tmp in sorted(enumerate(x), key=lambda x: x[1]):
    i_l, i_r = i_last, A + 2
    while i_r - i_l > 1:
        m = i_l + (i_r - i_l) // 2
        # print("##", i_l, i_r, (m, s[m]), x_tmp)
        if s[m] <= x_tmp:
            i_l = m
        else:
            i_r = m
    #
    j_l, j_r = j_last, B + 2
    while j_r - j_l > 1:
        m = j_l + (j_r - j_l) // 2
        # print("##", j_l, j_r, (m, t[m]), x_tmp)
        if t[m] <= x_tmp:
            j_l = m
        else:
            j_r = m
    #
    ans = inf
    for i, j in ((i_l, j_l), (i_l + 1, j_l), (i_l, j_l + 1), (i_l + 1, j_l + 1)):
        if i < 1 or A < i: continue
        if j < 1 or B < j: continue
        ans_tmp_s = abs(x_tmp - s[i]) + abs(s[i] - t[j])
        ans_tmp_t = abs(x_tmp - t[j]) + abs(s[i] - t[j])
        ans_tmp = min(ans_tmp_s, ans_tmp_t)
        # print("#", x_tmp, s[i], t[j], ans_tmp)
        if ans > ans_tmp:
            ans = ans_tmp
    #
    i_last, j_last = i_l, j_l
    ans_Q[idx] = ans

for ansi in ans_Q: print(ansi)

### FIXED CODE ###

import sys, bisect
input = sys.stdin.readline
A, B, Q = map(int, input().split())
s = [int(input()) for _ in range(A)]
t = [int(input()) for _ in range(B)]
x = [int(input()) for _ in range(Q)]
inf = 10 ** 18

s = [-inf] + s + [inf]
t = [-inf] + t + [inf]

ans_Q = [None] * Q
i_last = j_last = 0
for idx, x_tmp in sorted(enumerate(x), key=lambda x: x[1]):
    i_l = max(0, bisect.bisect_left(s, x_tmp, lo=i_last) - 1)
    j_l = max(0, bisect.bisect_left(t, x_tmp, lo=j_last) - 1)
    # print("#", x_tmp, (i_l, s[i_l]), (j_l, t[j_l]))
    #
    ans = inf
    for i, j in ((i_l, j_l), (i_l + 1, j_l), (i_l, j_l + 1), (i_l + 1, j_l + 1)):
        if i < 1 or A < i: continue
        if j < 1 or B < j: continue
        ans_tmp_s = abs(x_tmp - s[i]) + abs(s[i] - t[j])
        ans_tmp_t = abs(x_tmp - t[j]) + abs(s[i] - t[j])
        ans_tmp = min(ans_tmp_s, ans_tmp_t)
        # print("#", x_tmp, s[i], t[j], ans_tmp)
        if ans > ans_tmp:
            ans = ans_tmp
    #
    i_last, j_last = i_l, j_l
    ans_Q[idx] = ans

for ansi in ans_Q: print(ansi)
### BUGGY CODE ###

from collections import deque
def main():
    n, m, k = map(int, input().split())
    friends = {k: set() for k in range(1, n + 1)}
    foe = {k: set() for k in range(1, n + 1)}
    for _ in range(m):
        a, b = map(int, input().split())
        friends[a].add(b)
        friends[b].add(a)
    for _ in range(k):
        a, b = map(int, input().split())
        foe[a].add(b)
        foe[b].add(a)

    belong_group = [-1] * (n + 1)
    groups = {}
    stack = deque()
    group_num = 1
    for i1 in range(1, n + 1):
        if belong_group[i1] != -1 or friends[i1] == []:
            continue
        else:
            belong_group[i1] = group_num
            groups[group_num] = set()
            groups[group_num].add(i1)
            stack += friends[i1]
            while stack:
                next_node = stack.popleft()
                if belong_group[next_node] != -1:
                    continue
                else:
                    belong_group[next_node] = group_num
                    groups[group_num].add(next_node)
                    stack += friends[next_node]
            group_num += 1
    for i2 in range(1, n + 1):
        r = max(len(groups[belong_group[i2]] - friends[i2] - foe[i2]) - 1, 0)
        print(r, end=' ')

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline
from collections import defaultdict
def main():
    def find(x):
        if par[x] < 0:
            return x
        else:
            par[x] = find(par[x])
            return par[x]
    def unite(x, y):
        x = find(x)
        y = find(y)
        if x == y:
            return False
        else:
            if par[x] > par[y]:
                x, y = y, x
            par[x] += par[y]
            par[y] = x
            return True
    def members(x):
        root = find(x)
        return [i for i in range(n) if find(i) == root]

    n, m, k = map(int, input().split())
    num_of_friends = [-1] * n
    par = [-1] * n
    for _ in range(m):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        unite(a, b)
        num_of_friends[a] += -1
        num_of_friends[b] += -1
    roots = defaultdict(int)
    #roots = {e: set() for e in range(n)}
    for i2 in range(n):
        roots[find(i2)] += 1
    for i3 in range(n):
        #num_of_friends[i3] += len(roots[find(i3)])
        num_of_friends[i3] += roots[find(i3)]
    for _ in range(k):
        c, d = map(int, input().split())
        c -= 1
        d -= 1
        if find(c) == find(d):
            num_of_friends[c] -= 1
            num_of_friends[d] -= 1

    for i in range(n):
        print(num_of_friends[i], end=' ')

if __name__ == '__main__':
    main()
### BUGGY CODE ###

import math
num = 100000
s = set([i for i in range(2,num+1)])
p = set()
mi = 0
while mi<=math.sqrt(num):
    mi = min(s)
    t = set([i*mi for i in range(1,num//mi+1)])
    p.add(mi)
    s-=t
p = p|s
p2 = set([i for i in p if (i+1)//2 in p])

q = int(input())
for i in range(q):
    l , r = map(int, input().split())
    s2 = set([i for i in range(l,r+1)])
    s2 = s2 & p2
    print(len(s2))

### FIXED CODE ###

import math
num = 100000
s = set([i for i in range(2,num+1)])
p = set()
mi = 0
while mi<=math.sqrt(num):
    mi = min(s)
    t = set([i*mi for i in range(1,num//mi+1)])
    p.add(mi)
    s-=t
p = p|s
p2 = set([i for i in p if (i+1)//2 in p])
c = 0
x = [0]*100001
for i in range(1,num+1):
    if i in p2:
        c+=1
    x[i]=c

q = int(input())
for i in range(q):
    l , r = map(int, input().split())
    ans = x[r]-x[l-1]
    print(ans)
### BUGGY CODE ###

Q = int(input())

P = [list(map(int,input().split())) for i in range(Q)]

List = [3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253, 3313, 3517, 3733, 4021, 4057, 4177, 4261, 4273, 4357, 4441, 4561, 4621, 4933, 5077, 5101, 5113, 5233, 5413, 5437, 5581, 5701, 6037, 6073, 6121, 6133, 6217, 6337, 6361, 6373, 6637, 6661, 6781, 6997, 7057, 7213, 7393, 7417, 7477, 7537, 7753, 7933, 8053, 8101, 8221, 8317, 8353, 8461, 8521, 8677, 8713, 8893, 9013, 9133, 9181, 9241, 9277, 9601, 9661, 9721, 9817, 9901, 9973]

for i in range (0, Q):
  count = 0
  for j in range (P[i][0],P[i][1]+1):
    if List.count(j) >0:
      count+=1
    else:
      continue
  print(count)

### FIXED CODE ###

import math

Q = int(input())

def prime(n):
	if n > 1:
		for i in range(2,math.floor(math.sqrt(n))+1):
			if (n % i) == 0:
				return(False)
				break
		else:
			return(True)
	else:
		return(False)

Numero = [0]*100001
for i in range (1, 50001):
	if prime(2*i+1) == 1 and prime(i+1) == 1:
		for j in range (2*i+1, 100001):
			Numero[j]+=1
	else:
		continue

for i in range (0, Q):
	A, B = map(int, input().split())
	print(Numero[B]-Numero[A-1])
### BUGGY CODE ###

debug = True

def main():
    N = int(input())
    S = list(input())

    minCnt=N

    for i in range(N):
        if i==0:
            minCnt=min(minCnt,S[1:].count('E'))
        elif i == N-1:
            minCnt=min(minCnt,S[:N-2].count('W'))
        else:
            minCnt=min(minCnt,S[:i-1].count('W')+S[i+1:].count('E'))

    print(minCnt)
    return

if __name__ == "__main__":
    main()



### FIXED CODE ###

debug = False

def main():
    N = int(input())
    S = list(input())

    tmpCnt=S.count('E')
    if S[0]=='E':
        tmpCnt-=1

    minCnt=tmpCnt

    for i in range(1,N):
        if S[i]=='E':
            tmpCnt-=1
        if S[i-1]=='W':
            tmpCnt+=1
        minCnt=min(minCnt,tmpCnt)
        if debug:
            print(i,S[i],tmpCnt,minCnt)
        
    print(minCnt)
    return

if __name__ == "__main__":
    main()
### BUGGY CODE ###


A, B, N = map(int, input().split(' '))
ans = 0
for x in range(min(B, N + 1)):
    # if not x % B: continue
    res = ((A * (x % B)) - ((A * x) % B)) / B
    ans = max(ans, res)
print(int(ans))


### FIXED CODE ###

import math

A, B, N = map(int, input().split(' '))
ans = 0
x = min(B, N + 1) - 1
ans = math.floor((A * x) / B) - A * (math.floor(x / B))
print(int(ans))
### BUGGY CODE ###

#coding:utf-8
def dbg(*something):
    if DEBUG:
        print(*something)






#正の宝石を戻すことはない
#負の宝石を戻すのは後半

from math import ceil,floor
DEBUG = False
N,K = list(map(int,input().split()))
V = list(map(int,input().split()))


#残りk回のとき深さk以下の場所に正の宝石がない→終了
#i回の操作で取れる石>それまでにとるi-1個の石の和
#深さiにある石vの価値：v - (それまでにとるi-1個の石の和　except (k-i)個の負の石)
'''
'''




def tansaku(V,rK,N,score):
    dbg(V,rK,N,score)
    # if rK == 0:
    #     db[]
    #     return score + sum(N)


    max_v = score + sum(sorted(N)[rK:])
    #LV = V[:ceil(len(V)/2)]
    #RV = V[floor(len(V)/2):][::-1]



    n = []
    for i in range(min(rK,ceil(len(V)/2))):
        
        if V[i] <= 0:
            n.append(V[i])
            continue

        next_V = V[i+1:]
        next_rK = rK - 1 - i
        next_tmp_v = tansaku(next_V, next_rK, N+n, score+V[i])
        max_v = max(next_tmp_v , max_v)


        break

    n = []
    for i in range(    len(V)-1    ,   max(floor(len(V)/2),len(V)-1-rK),-1 ):
        
        if V[i] <= 0:
            n.append(V[i])
            continue

        next_V = V[:i]
        next_rK = rK - 1 - (len(V)-1-i)
        next_tmp_v = tansaku(next_V,next_rK,N+n,score+V[i])
        max_v = max(next_tmp_v , max_v)
        break


    return max_v

print(tansaku(V,K,[],0))






### FIXED CODE ###

#coding:utf-8



def main():
    
    def dbg(*something):
        if DEBUG:
            print(*something)


    #正の宝石を戻すことはない
    #負の宝石を戻すのは後半
    from sys import stdin
    from math import ceil,floor
    DEBUG = False
    N,K = list(map(int,stdin.readline().split()))
    V = list(map(int,stdin.readline().split()))
    
    max_value = 0
    dbg([i for i in range(3,-1,-1)])
    for getnum in range(1,min(N+1,K+1)):  #取る宝石の総数
        for a in range(getnum + 1):  #左から石を取る回数
            J = [0] * getnum #石
            b = getnum - a #右から石を取る回数
            for i in range(a):
                J[i] = V[i]
            for i in range(b):
                J[a+i] = V[-i-1]
            J.sort()
            #dbg(J,a,b)
            t = min(K-getnum,getnum) #捨てる石
           
            for i in range(t): 
                if J[i] >= 0:
                    t = i
                    break
            #dbg(J,i,t,a,b,J[t:])
            tmp_max = sum(J[t:])

            max_value = max(max_value,tmp_max)
    print(max_value)



if __name__ == '__main__':
    main()
### BUGGY CODE ###

#!/usr/bin/env python3

from copy import deepcopy

ABMAX = 400
HUGE = 10 ** 12

def main():
    n, ma, mb = map(int, input().split())
    sold = []
    for i in range(n):
        a, b, c = map(int, input().split())
        sold.append((a, b, c))
    mincost = dp(sold, n)
    print(find_mincost(mincost, ma, mb))

def find_mincost(mincost, ma, mb):
    res = HUGE
    for mult in range(1, ABMAX):
        if ma * mult > ABMAX:
            break
        if mb * mult > ABMAX:
            break
        res = min(res, mincost[ma * mult][mb * mult])
    return -1 if res == HUGE else res

def dp(sold, n):
    # mincost[a][b]: Minimum cost of achieving a, b
    mincost = [[HUGE for b in range(ABMAX + 1)] for a in range(ABMAX + 1)]
    mincost[0][0] = 0
    for a, b, c in sold:
        mincost = update(mincost, a, b, c)
    return mincost

def update(mincost, a, b, c):
    for ia in reversed(range(ABMAX + 1)):  # 配る
        for ib in reversed(range(ABMAX + 1)):
            na = ia + a
            nb = ib + b
            if na <= ABMAX and nb <= ABMAX:
                mincost[na][nb] = min(mincost[na][nb], mincost[ia][ib] + c)
    return mincost

main()


### FIXED CODE ###

#!/usr/bin/env python3

from copy import deepcopy

ABMAX = 400
HUGE = 10 ** 12

def main():
    n, ma, mb = map(int, input().split())
    sold = []
    for i in range(n):
        a, b, c = map(int, input().split())
        sold.append((a, b, c))
    mincost = dp(sold, n)
    print(find_mincost(mincost, ma, mb))

def find_mincost(mincost, ma, mb):
    res = HUGE
    for mult in range(1, ABMAX):
        if ma * mult > ABMAX:
            break
        if mb * mult > ABMAX:
            break
        res = min(res, mincost[ma * mult][mb * mult])
    return -1 if res == HUGE else res

def dp(sold, n):
    # mincost[a][b]: Minimum cost of achieving a, b
    mincost = [[HUGE for b in range(ABMAX + 1)] for a in range(ABMAX + 1)]
    mincost[0][0] = 0
    for a, b, c in sold:
        mincost = update(mincost, a, b, c)
    return mincost

def update(prevcost, a, b, c):
    mincost = deepcopy(prevcost)
    for ia in range(ABMAX + 1):  # 配る
        for ib in range(ABMAX + 1):
            na = ia + a
            nb = ib + b
            if na <= ABMAX and nb <= ABMAX:
                mincost[na][nb] = min(mincost[na][nb], prevcost[ia][ib] + c)
    return mincost

main()
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    print(a.count(i+1))

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
j=0
c=0
import sys
a.sort()

for i in range(1,n+1):
    while 1:
        if j==n-1:
            
            break
        if i!=a[j]:
            break
        else:
            c+=1
            j+=1
    print(c)
    c=0
### BUGGY CODE ###

Input1 = [int(_) for _ in input().split(" ")]
Input2 = [(int(i)+1)/2 for i in input().split(" ")]

cemsum = [0]*(Input1[0]-Input1[1]+1)

for j in range(0,Input1[0]-Input1[1]+1):
    cemsum[j] = sum(Input2[j:j+Input1[1]])

print(max(cemsum))

### FIXED CODE ###

Input1 = [int(_) for _ in input().split(" ")]
Input2 = [(int(i)+1)/2 for i in input().split(" ")]

sum_ = sum(Input2[:Input1[1]])
Max = sum_
for j in range(Input1[0]-Input1[1]):
    sum_ = sum_-Input2[j]+Input2[j+Input1[1]]
    if Max  < sum_:
        Max = sum_
        
print(Max)
### BUGGY CODE ###

S = input()
N = len(S)
stays = [0] * N

for i in range(N):
    curr = i
    past = curr
    n_steps = 0

    while True:
        if S[curr] != S[past]:
            if n_steps % 2 == 0:
                stays[curr] += 1
            else:
                stays[past] += 1
            break
        
        else:
            if S[curr] == 'L':
                past = curr
                curr -= 1
            else:
                past = curr
                curr += 1
            n_steps += 1

print(' '.join([str(i) for i in stays]))

### FIXED CODE ###

import math


S = input()
N = len(S)
stays = [0] * N

def parse_head(s, start=0):
    assert s[start] == 'R'
    for i in range(start, N):
        if s[i] == 'L':
            split = i
            for j in range(split, N):
                if s[j] == 'R':
                    end = j
                    return start, split, end
            end = N
            return start, split, end

def gather(s, start, split, end):
    split_R = split - 1
    split_L = split
    end = end - 1

    count_split_R = 0
    count_split_L = 0

    count = (split_R - start + 1) / 2
    # print(count)
    count_split_R += math.ceil(count)
    count_split_L += math.floor(count)

    count = (end - split_L + 1) / 2
    # print(count)
    count_split_L += math.ceil(count)
    count_split_R += math.floor(count)

    return count_split_R, count_split_L


idx = 0
while idx < N:
    start, split, end = parse_head(S, start=idx)
    count_split_R, count_split_L = gather(S, start, split, end)
    stays[split-1] += count_split_R
    stays[split] += count_split_L
    # print(S[start:end], stays)
    idx = end

print(' '.join([str(stay) for stay in stays]))