Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())    
color_list =  [int(input())]
for i in range(N-1):
    new_value = int(input())
    if(new_value > color_list[0]):
        color_list[0] = new_value
    elif(new_value <= color_list[-1]):
        color_list.append(new_value)
    else:
        for i in range(len(color_list)):
            break
print(len(color_list))

Fixed submission:
def set_ball(i):
    index = i
    ball_count = 0
    while(True):
        ball_count += ball_status[index]
        index += i + 1
        if(index  >= N):
            break
    return (ball_count % 2) != a_list[i]

N = int(input())
a_list = list(map(int, input().strip().split()))

ball_status = [0 for i in range(N)]
for i in range(N):
    flag = set_ball(N-1-i)
    if(flag):
        ball_status[N-1-i] = 1
throw_balls = sum(ball_status)
print(throw_balls)
if(throw_balls > 0):
    ans = ""
    for i in range(N):
        if(ball_status[i] == 1):
            ans += str(i+1)
            ans += " "
    print(ans[:-1])
Buggy python submission (verdict: Runtime Error):
a, b = input().strip().Split()
print(int(a)/int(b))

Fixed submission:
a, b = input().strip().split()
print(int(a)/int(b))
Buggy python submission (verdict: Runtime Error):
a, b = list(input().strip().split(" ")

print(b-a+1)

Fixed submission:
a, b = list(map(int, input().strip().split(" ")))
print(a-b+1)
Buggy python submission (verdict: Time Limit Exceeded):
def f(m):
    ans = 0
    for a in aList:
        ans += m % a
    return ans

def check_finish(can):
    for a in aList:
        if(can % a != 0):
            return False
    return True
  
  
N = int(input().strip())
aList = list(map(int, input().strip().split(" ")))

count = 1
ans = 0
while(True):
    tmp_ans = f(count)
    ans = max(tmp_ans, ans)
    if(check_finish(count)):
        break
    count += 1
print(ans)

Fixed submission:
N = int(input().strip())
aList = list(map(int, input().strip().split(" ")))

print(sum(aList) - N)
Buggy python submission (verdict: Runtime Error):
def findNextAnimal(oxList, swList, index):
    nextAns = oxList[index]
    before = swList[index-1]
    animal = swList[index]
    nextAnimal = ""
    if(nextAns == "o" and before == "S" and animal == "S"):
        nextAnimal = "S"
    elif(nextAns == "o" and before == "S" and animal == "W"):
        nextAnimal = "W"
    elif(nextAns == "o" and before == "W" and animal == "S"):
        nextAnimal = "W"
    elif(nextAns == "o" and before == "W" and animal == "W"):
        nextAnimal = "S"
    elif(nextAns == "x" and before == "S" and animal == "S"):
        nextAnimal = "W"
    elif(nextAns == "x" and before == "S" and animal == "W"):
        nextAnimal = "S"
    elif(nextAns == "x" and before == "W" and animal == "S"):
        nextAnimal = "S"
    elif(nextAns == "x" and before == "W" and animal == "W"):
        nextAnimal = "W"
    return nextAnimal

def checkList(oxList, swList):
    ans = 0
    if(swList[-1] == "S"):
        if(oxList[-1] == "x" and swList[-2] != swList[0]):
            ans = 1
        elif(oxList[-1] == "o" and swList[-2] == swList[0]):
            ans = 1
    elif(swList[-1] == "W"):
        if(oxList[-1] == "x" and swList[-2] == swList[0]):
            ans = 1
        elif(oxList[-1] == "o" and swList[-2] != swList[0]):
            ans = 1
            
    ans2 = 0    
    if(swList[0] == "S"):
        if(oxList[0] == "x" and swList[1] != swList[-1]):
            ans2 = 1
        elif(oxList[0] == "o" and swList[1] == swList[-1]):
            ans2 = 1
    elif(swList[0] == "W"):
        if(oxList[0] == "x" and swList[1] == swList[-1]):
            ans2 = 1
        elif(oxList[0] == "o" and swList[1] != swList[-1]):
            ans2 = 1
    
    return ans*ans2

n = raw_input().strip().upper()
oxList = raw_input().strip().lower()

ans = -1
for s0 in ["S", "W"]:
    for s1 in ["S","W"]:
        swList = [0]*int(n)
        swList[0] = s0
        swList[1] = s1
        for i in range(2, int(n)):
            nextAnimal = findNextAnimal(oxList, swList, i-1)
            swList[i] = nextAnimal
        flag = checkList(oxList, swList)
        if(flag == 1):
            ans = ""
            for s in swList:
                ans += s
print ans

Fixed submission:
def countScc(s, c):
    res = 0
    if(2*s <= c):
        res = s
        c = c - 2*s
        res = res + c / 4
    else:
        res = c / 2
    return res

try:
    while True:  
        s, c = raw_input().strip().upper().split()
        print countScc(int(s), int(c))
except EOFError:
    pass
Buggy python submission (verdict: Runtime Error):
try:
    while True:  
        n = raw_input().strip().upper()
        oxList = raw_input().strip().lower()
        ans = -1
        for s0 in ["S", "W"]:
            for s1 in ["S","W"]:
                swList = [0]*int(n)
                swList[0] = s0
                swList[1] = s1
                for i in range(2, int(n)):
                    nextAnimal = findNextAnimal(oxList, swList, i-1)
                    swList[i] = nextAnimal
                    flag = checkList(oxList, swList)
                    if(flag == 1):
                        ans = ""
                        for s in swList:
                            ans += s
        print ans
                        
except EOFError:
    pass

Fixed submission:
def findNextAnimal(oxList, swList, index):
    nextAns = oxList[index]
    before = swList[index-1]
    animal = swList[index]
    nextAnimal = ""
    if(nextAns == "o" and before == "S" and animal == "S"):
        nextAnimal = "S"
    elif(nextAns == "o" and before == "S" and animal == "W"):
        nextAnimal = "W"
    elif(nextAns == "o" and before == "W" and animal == "S"):
        nextAnimal = "W"
    elif(nextAns == "o" and before == "W" and animal == "W"):
        nextAnimal = "S"
    elif(nextAns == "x" and before == "S" and animal == "S"):
        nextAnimal = "W"
    elif(nextAns == "x" and before == "S" and animal == "W"):
        nextAnimal = "S"
    elif(nextAns == "x" and before == "W" and animal == "S"):
        nextAnimal = "S"
    elif(nextAns == "x" and before == "W" and animal == "W"):
        nextAnimal = "W"
    return nextAnimal

def checkList(oxList, swList):
    ans = 0
    if(swList[-1] == "S"):
        if(oxList[-1] == "x" and swList[-2] != swList[0]):
            ans = 1
        elif(oxList[-1] == "o" and swList[-2] == swList[0]):
            ans = 1
    elif(swList[-1] == "W"):
        if(oxList[-1] == "x" and swList[-2] == swList[0]):
            ans = 1
        elif(oxList[-1] == "o" and swList[-2] != swList[0]):
            ans = 1
            
    ans2 = 0    
    if(swList[0] == "S"):
        if(oxList[0] == "x" and swList[1] != swList[-1]):
            ans2 = 1
        elif(oxList[0] == "o" and swList[1] == swList[-1]):
            ans2 = 1
    elif(swList[0] == "W"):
        if(oxList[0] == "x" and swList[1] == swList[-1]):
            ans2 = 1
        elif(oxList[0] == "o" and swList[1] != swList[-1]):
            ans2 = 1
    
    return ans*ans2

try:
    while True:  
        n = raw_input().strip().upper()
        oxList = raw_input().strip().lower()
        ans = -1
        for s0 in ["S", "W"]:
            for s1 in ["S","W"]:
                swList = [0]*int(n)
                swList[0] = s0
                swList[1] = s1
                for i in range(2, int(n)):
                    nextAnimal = findNextAnimal(oxList, swList, i-1)
                    swList[i] = nextAnimal
                    flag = checkList(oxList, swList)
                    if(flag == 1):
                        ans = ""
                        for s in swList:
                            ans += s
        print ans
                        
except EOFError:
    pass
Buggy python submission (verdict: Runtime Error):
s = raw_input()
aId = s.index("A")
s = s[::-1]
zId = s.index("Z")
print len(s) - aId - zId

Fixed submission:
N = int(raw_input())
ans = "ARC"
if(N < 1200):
 ans = "ABC"
print ans
Buggy python submission (verdict: Runtime Error):
s = raw_input()
aId = s.index("a")
s = s[::-1]
zId = s.index("z")
print len(s) - aId - zId

Fixed submission:
s = raw_input()
aId = s.index("A")
s = s[::-1]
zId = s.index("Z")
print len(s) - aId - zId
Buggy python submission (verdict: Runtime Error):
def compute_current_score(previous_t_score, previous_a_score, current_t_ratio, current_a_ratio):
    initial_divisor = max(previous_t_score // current_t_ratio, previous_a_score // current_a_ratio)
    current_t_score = 0
    current_a_score = 0
    while(True):
        current_t_score = initial_divisor * current_t_ratio
        current_a_score = initial_divisor * current_a_ratio
        if((current_t_score >= previous_t_score) and (current_a_score >= previous_a_score)):
            break
        initial_divisor += 1
    return current_t_score, current_a_score

t_list = []
a_list = []

N = int(input())
t_score, a_score = list(map(int, input().strip().split()))

for  n in range(N-1):
    t_ratio, a_ratio = list(map(int, input().strip().split()))
    t_score, a_score = compute_current_score(t_score, a_score, t_ratio, a_ratio)
    
print(t_score + a_score)

Fixed submission:
inks = set(input().strip().split())
print(len(inks))
Buggy python submission (verdict: Runtime Error):
print((input() / 3.0)**3)

Fixed submission:
print((float(input()) / 3.0)**3)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a_list=[int(x) for x in input().split()]

import numpy as np
A=np.array(a_list)
counts=[0]*N
for i in range(M):
    max_id=np.argmax(A)
    A[max_id] /=2
    counts[max_id]+=1

    money=0
for x,y in zip(a_list,counts):
    money+=int(x/2**y)
print(money)

Fixed submission:
import numpy as np
import heapq
N,M=map(int,input().split())
a_list=[int(x) for x in input().split()]

A=list([-1*x for x in a_list])
heapq.heapify(A)

for m in range(M):
    max_a=heapq.heappop(A)
    half=max_a/2
    heapq.heappush(A,half)

result=sum([-1*int(x) for x in A])
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
n1=[x+1 for x in range(N)]
n2=n1[1:]+[n1[0]]
s=0
for x,y in zip(n1,n2):
    s+=x%y
print(s)

Fixed submission:
N=int(input())
ans=int((N-1)*N//2)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
s_list=[]
for i in range(N):
    s_list.append(input())

s_list2=["".join(sorted(x)) for x in s_list]
c=0
for i in range(len(s_list2)):
    for j in range(i+1,N):
        if s_list2[i]==s_list2[j]:
            c+=1
print(c)

Fixed submission:
N=int(input())
s_list=[]
for i in range(N):
    s_list.append(input())
s_list2=["".join(sorted(x)) for x in s_list]

dic={}
for s in s_list2:
    if s not in dic.keys():
        dic[s]=1
    else:
        dic[s]+=1
    
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

c=0
for x in dic.items():
    if x[1]>=2:
        c+=cmb(x[1],2)
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a_list=[]
for i in range(N):
    a_list.append(int(input()))
 
for i in range(len(a_list)):
    tmp=[x for j,x in enumerate(a_list) if i!=j]
    print(max(tmp))

Fixed submission:
N=int(input())
a_list=[]
for i in range(N):
    a_list.append(int(input()))

tmp=sorted(a_list)[::-1]
one=tmp[0]
two=tmp[1]
for i in range(len(a_list)):
    if a_list[i]==one:
        print(two)
    else:
        print(one)
Buggy python submission (verdict: Runtime Error):
input()
xs=list(map(int, input().split()))

f,t,z=0,0,0
for x in xs:
  if x % 4 == 0:
    f+=1
  elif x % 2 == 0:
    t += 1
  else:
    z += 1
z += t
print('Yes' if z + 1 < f then 'No')


Fixed submission:
input()
xs=list(map(int, input().split()))
 
f,t,z=0,0,0
for x in xs:
  if x % 4 == 0:
    f+=1
  elif x % 2 == 0:
    t += 1
  else:
    z += 1
z += 0<t
print('Yes' if z - 2 < f else'No')
Buggy python submission (verdict: Time Limit Exceeded):
"""
N = int(input())
A = list(map(int, input().split()))

from collections import defaultdict
dict = defaultdict(int)
for a in A:
    dict[a] += 1

ans = 0
for key, value in list(dict.items()):
    ans += value*(value-1) // 2

for a in A:
    tmp = ans - dict[a]*(dict[a]-1)//2 + (dict[a]-1)*(dict[a]-2)//2
    print(tmp)
"""


class HashMap:
    # 997は1000より小さい素数というだけで特にそれ以上の理由はない
    def __init__(self, mod=997):
        self.mod = mod
        self._hashmap = [None for _ in range(self.mod)]  # 同じキーが来たらvalueを上書きする

    def __del__(self):
        del self._hashmap
        #print('HashMap object deleted')

    def _calculateHash(self, key):
        key = str(key)
        if key.isalnum():
            if key.isdecimal():
                hash = int(key) % self.mod
            else:
                newKey = ''
                for k in key:
                    if k.isdecimal():
                        newKey += k
                    else:
                        newKey += str(ord(k))
                hash = int(newKey) % self.mod
        else:
            # keyに英数字以外が含まれていた時
            raise Exception(
                'KeyError: Key must be str of alphabets or integer')
        return hash

    def add(self, key, value):
        # hashmapにkey, valueを追加する
        hash = self._calculateHash(key)
        if self._hashmap[hash] is None:
            self._hashmap[hash] = [[key, value]]
        else:
            for i, l in enumerate(self._hashmap[hash]):
                if l[0] == key:
                    self._hashmap[hash][i] = [key, value]
                    #print('same key indicated, value overwritten')
                    break
            self._hashmap[hash].append([key, value])

    def getValue(self, key):
        hash = self._calculateHash(key)
        if self._hashmap[hash] is None:
            raise Exception('KeyError: indicated Key is not be added')
        else:
            for l in self._hashmap[hash]:
                if l[0] == key:
                    return l[1]


N = int(input())
A = list(map(int, input().split()))

dict = HashMap()
for a in A:
    try:
        tmp = dict.getValue(a)
        dict.add(a, tmp+1)
    except:
        dict.add(a, 1)

ans = 0
for a in list(set(A)):
    ans += dict.getValue(a)*(dict.getValue(a)-1) // 2

for a in A:
    dict_a = dict.getValue(a)
    tmp = ans - dict_a*(dict_a-1)//2 + (dict_a-1)*(dict_a-2)//2
    print(tmp)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

from collections import defaultdict
dict = defaultdict(int)
for a in A:
    dict[a] += 1

ans = 0
for key, value in list(dict.items()):
    ans += value*(value-1) // 2

for a in A:
    tmp = ans - dict[a]*(dict[a]-1)//2 + (dict[a]-1)*(dict[a]-2)//2
    print(tmp)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
T = input()


def solve(S, T):
    for t in set(T):
        if t not in set(S):
            return -1

    S_double = S+S
    len_s = len(S)
    ans = -1
    for t in T:
        ans += S_double[(ans+1) % len_s:].index(t) + 1
    return ans + 1


print(solve(S, T))


Fixed submission:
S = input()
T = input()


def solve(S, T):
    for t in set(T):
        if t not in set(S):
            return -1

    S_double = S+S
    len_s = len(S)
    ans = -1
    for t in T:
        ans += S_double[(ans+1) % len_s:].index(t) + 1
    return ans + 1


print(solve(S, T))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
N = int(input())
S = [''.join(sorted(list(str(input())))) for i in range(N)]

countDict = defaultdict(int)
for s in S:
    countDict[s] += 1


def makeTable(N):
    fac = [1 for i in range(N)]
    for i in range(2, N):
        fac[i] = fac[i - 1] * i
    return fac


fac = makeTable(N+1)


def binomialCoefficient(N, r):
    if N < r:
        return 0
    else:
        return fac[N] // (fac[r] * fac[N - r])


ans = 0
for v in countDict.values():
    if v >= 2:
        ans += binomialCoefficient(v, 2)

print(ans)

Fixed submission:
from collections import defaultdict
N = int(input())
S = [''.join(sorted(list(str(input())))) for i in range(N)]

countDict = defaultdict(int)
ans = 0
for s in S:
    ans += countDict[s]
    countDict[s] += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
N = int(input())
S = [''.join(sorted(list(str(input())))) for i in range(N)]

countDict = defaultdict(int)
for s in S:
    countDict[s] += 1


def makeTable(N):
    fac = [1 for i in range(N)]
    for i in range(2, N):
        fac[i] = fac[i - 1] * i
    return fac


fac = makeTable(N+1)


def binomialCoefficient(N, r):
    if N < r:
        return 0
    else:
        return fac[N] // (fac[r] * fac[N - r])


ans = 0
for v in countDict.values():
    if v >= 2:
        ans += binomialCoefficient(v, 2)

print(ans)

Fixed submission:
from collections import defaultdict
N = int(input())
S = [''.join(sorted(list(str(input())))) for i in range(N)]

countDict = defaultdict(int)
ans = 0
for s in S:
    ans += countDict[s]
    countDict[s] += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
S = str(input())
N = len(S)
mod = 10 ** 9 + 7

dp = [[0 for _ in range(13)] for _ in range(N)]
if S[0] == '?':
    for j in range(10):
        dp[0][j] = 1
else:
    dp[0][int(S[0])] = 1
for i in range(1, N):
    if S[i] == '?':
        for s in range(0, 10):
            for j in range(0, 13):
                for k in range(0, 13):
                    if (10 * k + s) % 13 == j:
                        dp[i][j] += dp[i - 1][k]
    else:
        s = int(S[i])
        for j in range(0, 13):
            for k in range(0, 13):
                if (10 * k + s) % 13 == j:
                    dp[i][j] += dp[i-1][k]

    for j in range(13):
        dp[i][j] %= mod

print(dp[N-1][5])

Fixed submission:
from collections import defaultdict
S = str(input())
N = len(S)
mod = 10 ** 9 + 7

dp = [[0 for _ in range(13)] for _ in range(N)]
if S[0] == '?':
    for j in range(10):
        dp[0][j] = 1
else:
    dp[0][int(S[0])] = 1

residualDict = defaultdict(list)
for s in range(0, 10):
    for j in range(0, 13):
        for k in range(0, 13):
            if (10 * k + s) % 13 == j:
                residualDict[s].append([j, k])

for i in range(1, N):
    if S[i] == '?':
        for s in range(0, 10):
            tmpList = residualDict[s]
            for j, k in tmpList:
                dp[i][j] += dp[i - 1][k]
    else:
        s = int(S[i])
        tmpList = residualDict[s]
        for j, k in tmpList:
            dp[i][j] += dp[i-1][k]

    for j in range(13):
        dp[i][j] %= mod

print(dp[N-1][5])

Buggy python submission (verdict: Time Limit Exceeded):
S = str(input())
N = len(S)
mod = 10 ** 9 + 7

dp = [[0 for _ in range(13)] for _ in range(N)]
if S[0] == '?':
    for j in range(10):
        dp[0][j] = 1
else:
    dp[0][int(S[0])] = 1
for i in range(1, N):
    if S[i] == '?':
        for s in range(0, 10):
            for j in range(0, 13):
                for k in range(0, 13):
                    if (10 * k + s) % 13 == j:
                        dp[i][j] += dp[i - 1][k]
    else:
        s = int(S[i])
        for j in range(0, 13):
            for k in range(0, 13):
                if (10 * k + s) % 13 == j:
                    dp[i][j] += dp[i-1][k]

    for j in range(13):
        dp[i][j] %= mod

print(dp[N-1][5])

Fixed submission:
from collections import defaultdict
S = str(input())
N = len(S)
mod = 10 ** 9 + 7

dp = [[0 for _ in range(13)] for _ in range(N)]
if S[0] == '?':
    for j in range(10):
        dp[0][j] = 1
else:
    dp[0][int(S[0])] = 1

residualDict = defaultdict(list)
for s in range(0, 10):
    for j in range(0, 13):
        for k in range(0, 13):
            if (10 * k + s) % 13 == j:
                residualDict[s].append([j, k])

for i in range(1, N):
    if S[i] == '?':
        for s in range(0, 10):
            tmpList = residualDict[s]
            for j, k in tmpList:
                dp[i][j] += dp[i - 1][k]
    else:
        s = int(S[i])
        tmpList = residualDict[s]
        for j, k in tmpList:
            dp[i][j] += dp[i-1][k]

    for j in range(13):
        dp[i][j] %= mod

print(dp[N-1][5])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))


def returnResMod2(i):
    # i+1の倍数の箱のaiの和の剰余を求める
    res = sum([ansList[k] for k in range(N) if (k+1) % (i+1) == 0]) % 2
    return res


ansList = [0 for i in range(N)]
for i in range(N-1, -1, -1):
    tmp = (returnResMod2(i)+A[i]) % 2
    ansList[i] = tmp


M = sum(ansList)
print(M)
if M == 0:
    quit()
print(' '.join([str(i+1) for i, a in enumerate(ansList) if a == 1]))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))


def returnResMod2(i):
    # i+1の倍数の箱のaiの和の剰余を求める
    res = sum([ansList[(i+1)*(k+1)-1] for k in range(N//(i+1))]) % 2
    return res


ansList = [0 for i in range(N)]
for i in range(N-1, -1, -1):
    tmp = (returnResMod2(i)+A[i]) % 2
    ansList[i] = tmp
    

M = sum(ansList)
print(M)
if M == 0:
    quit()
print(' '.join([str(i+1) for i, a in enumerate(ansList) if a == 1]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]


def solve(A):
    if len(A) == 0:
        return
    indexList = []
    last = A[0]
    for i, v in enumerate(A):
        if v > last:
            indexList.append(i)
            last = v
    del A[0]
    for i in indexList:
        del A[i-1]


counter = 0
while len(A) > 0:
    solve(A)
    counter += 1

print(counter)

Fixed submission:
import bisect
N = int(input())
A = [-int(input()) for i in range(N)]


dp = []
for a in A:
    i = bisect.bisect_right(dp, a)
    if i >= len(dp):
        dp.append(a)
    else:
        dp[i] = a

print(len(dp))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
R = N - K
mod = 10 ** 9 + 7


def makeTableMod(N, mod=10 ** 9 + 7):
    fac = [1 for i in range(N)]
    finv = [1 for i in range(N)]
    inv = [1 for i in range(N)]
    for i in range(2, N):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv


fac, finv = makeTableMod(N-K+2, mod)


def binomialCoefficient(N, r, mod=10 ** 9 + 7):
    if N < r:
        return 0
    else:
        return fac[N] * (finv[r] * finv[N - r] % mod) % mod


def solve(i):
    # (N-K+1, i) * (K-1, i-1)を計算すれば良い
    ans = binomialCoefficient(N-K+1, i) * binomialCoefficient(K-1, i-1)
    return ans


for i in range(K):
    if i == 0:
        print((R+1) % mod)
    else:
        ans = solve(i+1)
        print(ans % mod)

Fixed submission:
N, K = map(int, input().split())
R = N - K
mod = 10 ** 9 + 7


def makeTableMod(N, mod=10 ** 9 + 7):
    fac = [1 for i in range(N)]
    finv = [1 for i in range(N)]
    inv = [1 for i in range(N)]
    for i in range(2, N):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv


fac, finv = makeTableMod(2001, mod)


def binomialCoefficient(N, r, mod=10 ** 9 + 7):
    if N < r:
        return 0
    else:
        return fac[N] * (finv[r] * finv[N - r] % mod) % mod


def solve(i):
    # (N-K+1, i) * (K-1, i-1)を計算すれば良い
    ans = binomialCoefficient(N-K+1, i) * binomialCoefficient(K-1, i-1) % mod
    return ans


for i in range(K):
    if i == 0:
        print((R+1) % mod)
    else:
        ans = solve(i+1)
        print(ans % mod)