Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l1=[0]*61
l=list(map(int,input().split()))
for j in range(n):
  s=list(str(bin(l[j])))
  for i in range(61):
    if i==len(s)-2:
      break
    if s[-i-1]=='1':
      l1[i]+=1
c=0
for i in range(61):
  c+=pow(2,i,10**9+7)*(n-l1[i])*l1[i]%(10**9+7)
print(c%(10**9+7))

Fixed submission:
n=int(input())
l1=[0]*61
l=list(map(int,input().split()))
for j in range(n):
  s=list(str(bin(l[j])))
  for i in range(61):
    if i==len(s)-2:
      break
    if s[-i-1]=='1':
      l1[i]+=1
c=0
for i in range(61):
  c+=pow(2,i,10**9+7)*(n-l1[i])*l1[i]%(10**9+7)
print(c%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
sum=0
mod=10**9+7
for i in range(n-1):
  for j in range(i+1,n):
    sum=(sum+(l[i]^l[j]))%mod
print(sum)

Fixed submission:
n=int(input())
l1=[0]*61
l=list(map(int,input().split()))
for j in range(n):
  s=list(str(bin(l[j])))
  for i in range(61):
    if i==len(s)-2:
      break
    if s[-i-1]=='1':
      l1[i]+=1
c=0
for i in range(61):
  c+=pow(2,i,10**9+7)*(n-l1[i])*l1[i]%(10**9+7)
print(c%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
sum=0
mod=10**9+7
for i in range(n-1):
  for j in range(i+1,n):
    sum=(sum+(l[i]^l[j]))%mod
print(sum)

Fixed submission:
n=int(input())
l1=[0]*61
l=list(map(int,input().split()))
for j in range(n):
  s=list(str(bin(l[j])))
  for i in range(61):
    if i==len(s)-2:
      break
    if s[-i-1]=='1':
      l1[i]+=1
c=0
for i in range(61):
  c+=pow(2,i,10**9+7)*(n-l1[i])*l1[i]%(10**9+7)
print(c%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    x=j+1
    y=n-1
    while y!=x:
      if L[i]+L[j]>L[(x+y)//2]:
        x=(x+y)//2
      else:
        y=(x+y)//2
    p=y if L[i]+L[j]>L[y] else x
    if L[i]+L[j]<=L[p]:
      count+=0
    else:
      count+=p-j
print(count)

Fixed submission:
n=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    x=j+1
    y=n-1
    while y!=x+1 and y!=x:
      if L[i]+L[j]>L[(x+y)//2]:
        x=(x+y)//2
      else:
        y=(x+y)//2
    p=y if L[i]+L[j]>L[y] else x
    if L[i]+L[j]<=L[p]:
      count+=0
    else:
      count+=p-j
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    x=j+1
    y=n-1
    while y!=x+1 and y!=x:
      if L[i]+L[j]>L[(x+y)//2]:
        x=(x+y)//2
      else:
        y=(x+y)//2
    p=y if L[i]+L[j]>L[y] else x
    if L[i]+L[j]<=L[p]:
      count+=0
    else:
      count+=p-j
print(count)

Fixed submission:
n=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    x=j+1
    y=n-1
    while y!=x+1 and y!=x:
      if L[i]+L[j]>L[(x+y)//2]:
        x=(x+y)//2
      else:
        y=(x+y)//2
    p=y if L[i]+L[j]>L[y] else x
    if L[i]+L[j]<=L[p]:
      count+=0
    else:
      count+=p-j
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if L[i]+L[j]>L[k]:
        count+=1
      else:
        break
print(count)

Fixed submission:
n=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    x=j+1
    y=n-1
    while y!=x+1 and y!=x:
      if L[i]+L[j]>L[(x+y)//2]:
        x=(x+y)//2
      else:
        y=(x+y)//2
    p=y if L[i]+L[j]>L[y] else x
    if L[i]+L[j]<=L[p]:
      count+=0
    else:
      count+=p-j
print(count)
Buggy python submission (verdict: Runtime Error):
ugrd={'L'}
grd={'R'}
s=string(input())
for i in range(len(s)):
  if i%2==0:
    if s[i] in ugrd:
      print('No')
      break
  if i%2==1:
    if s[i] in grd:
      print('No')
      break
  elif i==len(s)-1:
    print('Yes')

Fixed submission:
ugrd={'L'}
grd={'R'}
s=str(input())
for i in range(len(s)):
  if i%2==0:
    if s[i] in ugrd:
      print('No')
      break
  if i%2==1:
    if s[i] in grd:
      print('No')
      break
  if i==len(s)-1:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
l=[]
for i in range(n):
  v=[i,0]
  l.append(v)
for j in range(q):
  p=int(input())
  l[p-1][1]+=1
for l in range(n):
  if l[l][1]>q-k:
    print('Yes')
  else:
    print('No')

Fixed submission:
n,k,q=map(int,input().split())
l=[]
for i in range(n):
  v=[i,0]
  l.append(v)
for j in range(q):
  p=int(input())
  l[p-1][1]+=1
for m in range(n):
  if l[m][1]>q-k:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().split()))
vec=[]
vec.append(v[0])
for i in range(0,n-1):
  vec.append(min(v[i],v[i+1]))
vec.append(v[n-1])
sum=0
for i in range(n+1):
  sum+=vec[i]
print(sum)

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
vec=[]
vec.append(v[0])
for i in range(0,n-2):
  vec.append(min(v[i],v[i+1]))
vec.append(v[n-2])
sum=0
for i in range(n):
  sum+=vec[i]
print(sum)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
sum=k
tmp=k
for i in range(1,n):
  sum+=k+i
  if abs(tmp)>abs(k+i):
    tmp=k+i
print(sumtmp)

Fixed submission:
n,k=map(int,input().split())
sum=k
tmp=k
for i in range(1,n):
  sum+=k+i
  if abs(tmp)>abs(k+i):
    tmp=k+i
print(sum-tmp)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
sum=k
tmp=abs(k,0)
for i in range(1,n):
  sum+=k+i
  if tmp>abs(k+i,0):
    tmp=abs(k+i,0)
print(sum-tmp)

Fixed submission:
n,k=map(int,input().split())
sum=k
tmp=k
for i in range(1,n):
  sum+=k+i
  if abs(tmp)>abs(k+i):
    tmp=k+i
print(sum-tmp)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=[0]
for i in range(n):
  d.append(d[-1]+l[i])
  if d[-1]>x:
    print(len(d)-1)
     break
  if i==n-1:
    print(n+1)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=[0]
for i in range(n):
  d.append(d[-1]+l[i])
  if d[-1]>x:
    print(len(d)-1)
    break
  if i==n-1:
    print(n+1)
Buggy python submission (verdict: Time Limit Exceeded):
import queue
q=queue.Queue()
l=[]
n,m=map(int,input().split())
for i in range(m):
  p=int(input())
  q.put(p)
que=q.get()
for j in range(n+1):
  if j==0:
    l.append(1)
  elif j==1 and que!=1:
    l.append(1)
  elif j==que:
    l.append(0)
    que=q.get()
  else:
    l.append(l[j-2]+l[j-1])
print(l[n]%(10**9+7))

Fixed submission:
n,m=map(int,input().split())
broken=[]
for i in range(m):
  broken.append(int(input()))
b=set(broken)
l=[1]
for j in range(1,n+1):
  if j in b:
    l.append(0)
  elif j==1:
    l.append(1)
  else:
    l.append(l[j-2]+l[j-1])
print(l[n]%(10**9+7))
Buggy python submission (verdict: Runtime Error):
a,p=map(int,input())
print((3*a+p)//2)

Fixed submission:
a,p=map(int,input().split())
print((3*a+p)//2)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ltmp=1,rtmp=n
for i in range(m):
  l,r=map(int,input().split())
  ltmp=max(l,ltmp)
  rtmp=min(r,rtmp)
if ltmp>rtmp:
  print(0)
else:
  print(rtmp-ltmp+1)

Fixed submission:
n,m=map(int,input().split())
ltmp=1
rtmp=n
for i in range(m):
  l,r=map(int,input().split())
  ltmp=max(l,ltmp)
  rtmp=min(r,rtmp)
if ltmp>rtmp:
  print(0)
else:
  print(rtmp-ltmp+1)
Buggy python submission (verdict: Runtime Error):
l=str(input())
n=0
for i in range(len(l)):
  if i%2==0,l[i]==0:
    n+=1
  if i%2==1,l[i]==1:
    n+=1
print(min(n,len(l)-n))

Fixed submission:
l=str(input())
n=0
for i in range(len(l)):
  if i%2==0 and l[i]=='0':
    n+=1
  if i%2==1 and l[i]=='1':
    n+=1
print(min(n,len(l)-n))
Buggy python submission (verdict: Runtime Error):
s=str(input())
l=[]
for i in range(len(s)):
  if s[i]=='A':
    l.append('T')
  if s[i]=='T':
    l.append('A')
  if s[i]=='G':
    l.append('C')
  if l[i]=='C':
    l.append('G')
print(''.join(l))


Fixed submission:
s=str(input())
l=[]
for i in range(len(s)):
  if s[i]=='A':
    l.append('T')
  if s[i]=='T':
    l.append('A')
  if s[i]=='G':
    l.append('C')
  if s[i]=='C':
    l.append('G')
print(''.join(l))

Buggy python submission (verdict: Runtime Error):
b=str(input())
l=[]
for i in range(len(s)):
  if s[i]=='A':
    l.append('T')
  if s[i]=='T':
    l.append('A')
  if s[i]=='G':
    l.append('C')
  if l[i]=='C':
    l.append('G')
print(''.join(l))


Fixed submission:
s=str(input())
l=[]
for i in range(len(s)):
  if s[i]=='A':
    l.append('T')
  if s[i]=='T':
    l.append('A')
  if s[i]=='G':
    l.append('C')
  if s[i]=='C':
    l.append('G')
print(''.join(l))
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
r=m//n
for i in range(r):
  if m%(r-i)==0 and m//(r-i)>=n:
    print(r-i)
    break

Fixed submission:
n,m=map(int,input().split())
r=m//n
if r>=10**7:
  for i in range(n,r):
    if m%i==0:
      print(m//i)
      break
else:
  for i in range(r):
    if m%(r-i)==0 and m//(r-i)>=n:
      print(r-i)
      break
Buggy python submission (verdict: Runtime Error):
n,m,x,y=map(int(input().split()))
tmpx=x
tmpy=y
for i in range(n):
  x_i=int(input())
  tmpx=max(tmpx,x_i)
for j in range(m):
  y_i=int(input())
  tmpy=min(tmpy,y_i)
if tmpx+1<=tmpy:
  print('No War')
else:
  print('War')

Fixed submission:
n,m,x,y=map(int,input().split())
tmpx=x
tmpy=y
li_x=list(map(int,input().split()))
li_y=list(map(int,input().split()))
for i in range(n):
  tmpx=max(tmpx,li_x[i])
for j in range(m):
  tmpy=min(tmpy,li_y[j])
if tmpx+1<=tmpy:
  print('No War')
else:
  print('War')
Buggy python submission (verdict: Runtime Error):
def count(n):
  p=0
  while n%2==0:
    p+=1
  return(p)

n=int(input())
l=list(map(int,input().split()))
count=0
for i in range(n):
  count+=count(l[i])
print(count)

Fixed submission:
def count(n):
  p=0
  while n%2==0:
    p+=1
    n=n//2
  return(p)

n=int(input())
l=list(map(int,input().split()))
sum=0
for i in range(n):
  sum+=count(l[i])
print(sum)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input())
s=0
for i in range(b-a-1):
  s+=1+i
print(s-a)

Fixed submission:
a,b=map(int,input().split())
s=0
for i in range(b-a-1):
  s+=1+i
print(s-a)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
n=int(input())
l=list(map(int,input().split()))
cl=copy.deepcopy(l)
l.sort()
for i in range(n):
  tmp=cl[i]
  l.remove(tmp)
  print(l[n//2-1])
  l.append(tmp)
  l.sort()

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
list=sorted(l)
for i in range(n):
  if l[i]<=list[n//2-1]:
    print(list[n//2])
  else:
    print(list[n//2-1])
Buggy python submission (verdict: Runtime Error):
l=[]
list(map(int,input().split())).append(l)
list(map(int,input().split())).append(l)
list(map(int,input().split())).append(l)
for i in range(2):
  if l[i][1]-l[i][0]!=l[i+1][1]-l[i+1][0] and l[i][2]-l[i][1]!=l[i+1][2]-l[i+1][1]:
    print('No')
    break
  if i==1:
    print('Yes')


Fixed submission:
l=[]
l.append(list(map(int,input().split())))
l.append(list(map(int,input().split())))
l.append(list(map(int,input().split())))
for i in range(2):
  if l[i][1]-l[i][0]!=l[i+1][1]-l[i+1][0] or l[i][2]-l[i][1]!=l[i+1][2]-l[i+1][1]:
    print('No')
    break
  if i==1:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
s=str(input())
s[3]='8'
print(s)

Fixed submission:
s=list(str(input()))
s[3]='8'
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]
print(len(set(l))

Fixed submission:
n=int(input())
l=[int(input()) for _ in range(n)]
print(len(set(l)))
Buggy python submission (verdict: Time Limit Exceeded):
n,h=map(int,input().split())
a_l=[]
b_l=[]
c=0
for i in range(n):
  a,b=map(int,input().split())
  a_l.append(a)
  b_l.append(b)
a_l.sort()
b_l.sort()
for i in range(1,n+1):
  if a_l[-1]<=b_l[(-1)*i]:
    h-=b_l[(-1)*i]
    c+=1
    if h<=0:
      break
  else:
    break
while h>0:
  h-=a_l[-1]
  c+=1
print(c)

Fixed submission:
import math
n,h=map(int,input().split())
a_l=[]
b_l=[]
c=0
for i in range(n):
  a,b=map(int,input().split())
  a_l.append(a)
  b_l.append(b)
a_l.sort()
b_l.sort()
for i in range(1,n+1):
  if a_l[-1]<=b_l[(-1)*i]:
    h-=b_l[(-1)*i]
    c+=1
    if h<=0:
      break
  else:
    break
if h>0:
  c+=math.ceil(h/a_l[-1])
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=[]
for i in range(n):
  x=int(input())
  if not x in set(l):
    l.append(x)
  else:
    l.remove(x)
print(len(l))

Fixed submission:
n=int(input())
s=set([])
for i in range(n):
  x=int(input())
  if not x in s:
    s.add(x)
  else:
    s.remove(x)
print(len(s))

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[]
for i in range(n):
  x=int(input())
  if x in set(l):
    l.append(x)
  if not x in set(l):
    l.remove(x)
print(len(l))

Fixed submission:
n=int(input())
s=set([])
for i in range(n):
  x=int(input())
  if not x in s:
    s.add(x)
  else:
    s.remove(x)
print(len(s))
Buggy python submission (verdict: Runtime Error):
s=str(input())
l=str(len(s))
list=[s[0],l,s[l-1]]
print(''.join(list))

Fixed submission:
s=str(input())
l=len(s)
li=str(l-2)
list=[s[0],li,s[l-1]]
print(''.join(list))

Buggy python submission (verdict: Runtime Error):
x=str(input())
l=str(len(s))
list=[s[0],l,s[l-1]]
print(''.join(list))

Fixed submission:
s=str(input())
l=len(s)
li=str(l-2)
list=[s[0],li,s[l-1]]
print(''.join(list))

Buggy python submission (verdict: Runtime Error):
x=str(input())
l=len(s)
list=[s[0],l,s[l-1]]
print(''.join(list))

Fixed submission:
s=str(input())
l=len(s)
li=str(l-2)
list=[s[0],li,s[l-1]]
print(''.join(list))
Buggy python submission (verdict: Runtime Error):
s=list(str(input()))
s[5]=' '
s[13]=' '
print('',join(s))

Fixed submission:
s=list(str(input()))
s[5]=' '
s[13]=' '
print(''.join(s))

Buggy python submission (verdict: Runtime Error):
k,s=map(int,input().split())
c=0
for i in range(k+1):
  for j in range(k+1):
    for l in range(k+1):
      if i+j+l==s:
        c+=1
        break
print(c)

Fixed submission:
s=list(str(input()))
s[5]=' '
s[13]=' '
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1

N1 = (N-1)/2
N2 = (N+3)/2

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]


Fixed submission:
import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1

N1 = int((N-1)/2)
N2 = int((N+3)/2)

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]

flag = True
for ss in [s1, s2, s3]:
    ss_l = len(ss)
    for i in range(ss_l):
        if ss[i] != ss[ss_l-i-1]:
            flag = False
            break
    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1

N1 = (N-1)/2
N2 = (N+3)/2

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]

flag = True
for ss in [s1, s2, s3]:
    ss_l = len(ss)
    for i in range(ss_l):
        if ss[i] != ss[ss_l-i-1]:
            flag = False
            break
    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')



Fixed submission:
import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1

N1 = int((N-1)/2)
N2 = int((N+3)/2)

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]

flag = True
for ss in [s1, s2, s3]:
    ss_l = len(ss)
    for i in range(ss_l):
        if ss[i] != ss[ss_l-i-1]:
            flag = False
            break
    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1


N1 = (N-1)/2
N2 = (N+3)/2

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]

flag = True
for ss in [s1, s2, s3]:
    ss_l = len(ss)
    for i in range(ss_l):
        if ss[i] != ss[ss_l-i-1]:
            flag = False
            break
    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')



Fixed submission:
import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1

N1 = int((N-1)/2)
N2 = int((N+3)/2)

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]

flag = True
for ss in [s1, s2, s3]:
    ss_l = len(ss)
    for i in range(ss_l):
        if ss[i] != ss[ss_l-i-1]:
            flag = False
            break
    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


n, m = map(int, input().split())

max_m = [0]*(m+1)
m_list = [[0] for _ in range(m+1)]

for _ in range(n):
    a, b = map(int, input().split())

    if a <= m:
        m_list[a].append(b)

all_r = 0

for i in range(1, m+1):
    max_m[i] = max(m_list[i])

    max_ind = 1
    max_v = max_m[1]
    for j in range(2, i+1):
        if max_m[j] >= max_v:
            max_ind = j
            max_v = max_m[j]

    ind = m_list[max_ind].index(max_v)
    all_r += m_list[max_ind].pop(ind)
    if len(m_list[max_ind]) == 0:
        m_list[max_ind].append(0)

    max_m[max_ind] = max(m_list[max_ind])

print(all_r)

Fixed submission:
import sys
input = sys.stdin.readline
from heapq import heappush, heappop


n, m = map(int, input().split())

m_list = [[] for _ in range(m+1)]

for _ in range(n):
    a, b = map(int, input().split())

    if a <= m:
        m_list[a].append(b)


all_r = 0
hq = []

for i in range(1, m+1):
    for v in m_list[i]:
        heappush(hq, -1*v)

    if len(hq) != 0:
        max_v = -1 * heappop(hq)
        all_r += max_v

print(all_r)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
from math import factorial

MAX_V = 10**9 + 7

from math import factorial


'''
def nCr(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(n - r) * factorial(r))

'''
def nCr(n, r):
    numerator = 1
    denominator = 1

    p = r if r < n-r else n-r

    for i in reversed(range(n-p+1, n+1)):
        numerator *= i

    for i in reversed(range(1, p+1)):
        denominator *= i

    return int(numerator / denominator)


n, b_k = map(int, input().split())
r_k = n-b_k
spot = r_k+1

min_k = min(b_k, spot)

#for i in range(1, min_k+1):
for i in range(1, b_k+1):
    c = nCr(spot, i) * nCr(b_k-1, i-1)
    print(c % MAX_V)

Fixed submission:
import sys
input = sys.stdin.readline
from math import factorial

MAX_V = 10**9 + 7

from math import factorial


def nCr(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(n - r) * factorial(r))

'''
def nCr(n, r):
    numerator = 1
    denominator = 1

    p = r if r < n-r else n-r

    for i in reversed(range(n-p+1, n+1)):
        numerator *= i

    for i in reversed(range(1, p+1)):
        denominator *= i

    return int(numerator / denominator)
'''

n, b_k = map(int, input().split())
r_k = n-b_k
spot = r_k+1

min_k = min(b_k, spot)

#for i in range(1, min_k+1):
for i in range(1, b_k+1):
    c = nCr(spot, i) * nCr(b_k-1, i-1)
    print(c % MAX_V)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

MAX_V = 10**9 + 7


def nCr(n, r):
    numerator = 1
    denominator = 1

    p = r if r < n-r else n-r

    for i in reversed(range(n-p+1, n+1)):
        numerator *= i

    for i in reversed(range(1, p+1)):
        denominator *= i

    return int(numerator / denominator)


n, b_k = map(int, input().split())
r_k = n-b_k
spot = r_k+1

min_k = min(b_k, spot)

for i in range(1, min_k+1):
    c = nCr(spot, i) * nCr(b_k-1, i-1)
    print(c % MAX_V)
    

Fixed submission:
import sys
input = sys.stdin.readline
from math import factorial

MAX_V = 10**9 + 7

from math import factorial


def nCr(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(n - r) * factorial(r))

'''
def nCr(n, r):
    numerator = 1
    denominator = 1

    p = r if r < n-r else n-r

    for i in reversed(range(n-p+1, n+1)):
        numerator *= i

    for i in reversed(range(1, p+1)):
        denominator *= i

    return int(numerator / denominator)
'''

n, b_k = map(int, input().split())
r_k = n-b_k
spot = r_k+1

min_k = min(b_k, spot)

#for i in range(1, min_k+1):
for i in range(1, b_k+1):
    c = nCr(spot, i) * nCr(b_k-1, i-1)
    print(c % MAX_V)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

a = []
b = []
for i in range(n):
    tmp1, tmp2 = map(int, input().split())
    a.append(tmp1)
    b.append(tmp2)

p_list = []
t = zip(a, b)
ts = sorted(t)
a, b = zip(*ts)
for ai, bi in zip(a, b):
    for i in range(bi):
        p_list.append(ai)

print(p_list[k-1])




Fixed submission:
n, k = map(int, input().split())

a = []
b = []
for i in range(n):
    tmp1, tmp2 = map(int, input().split())
    a.append(tmp1)
    b.append(tmp2)

p_list = []
t = zip(a, b)
ts = sorted(t)
a, b = zip(*ts)
ans = 0
count = 0
for ai, bi in zip(a, b):
    count += bi
    if count >= k:
        ans = ai
        break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

a = []
b = []
for i in range(n):
    tmp1, tmp2 = map(int, input().split())
    a.append(tmp1)
    b.append(tmp2)

p_list = []
t = zip(a, b)
ts = sorted(t)
a, b = zip(*ts)
for ai, bi in zip(a, b):
    for i in range(bi):
        p_list.append(ai)

p_list.sort()

print(p_list[k-1])




Fixed submission:
n, k = map(int, input().split())

a = []
b = []
for i in range(n):
    tmp1, tmp2 = map(int, input().split())
    a.append(tmp1)
    b.append(tmp2)

p_list = []
t = zip(a, b)
ts = sorted(t)
a, b = zip(*ts)
ans = 0
count = 0
for ai, bi in zip(a, b):
    count += bi
    if count >= k:
        ans = ai
        break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

a = []
b = []
for i in range(n):
    tmp1, tmp2 = map(int, input().split())
    a.append(tmp1)
    b.append(tmp2)

p_list = []
for ai, bi in zip(a, b):
    for i in range(bi):
        p_list.append(ai)

p_list.sort()

print(p_list[k-1])




Fixed submission:
n, k = map(int, input().split())

a = []
b = []
for i in range(n):
    tmp1, tmp2 = map(int, input().split())
    a.append(tmp1)
    b.append(tmp2)

p_list = []
t = zip(a, b)
ts = sorted(t)
a, b = zip(*ts)
ans = 0
count = 0
for ai, bi in zip(a, b):
    count += bi
    if count >= k:
        ans = ai
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math 

mysum = 0
K = int(input())
for i in range(1,K+1):
	for j in range(1,K+1):
		for k in range(1,K+1):
			mysum += math.gcd(math.gcd(i,j),k)

print(mysum)

Fixed submission:
from math import gcd 

mysum = 0
K = int(input())
for i in range(1,K+1):
	for j in range(1,K+1):
		for k in range(1,K+1):
			mysum += gcd(gcd(i,j),k)

print(mysum)

Buggy python submission (verdict: Runtime Error):
import math 

mysum = 0
K = int(input())
for i in range(1,K+1):
	for j in range(1,K+1):
		for k in range(1,K+1):
			mysum += math.gcd(math.gcd(x,y),z)

print(mysum)

Fixed submission:
from math import gcd 

mysum = 0
K = int(input())
for i in range(1,K+1):
	for j in range(1,K+1):
		for k in range(1,K+1):
			mysum += gcd(gcd(i,j),k)

print(mysum)

Buggy python submission (verdict: Time Limit Exceeded):
import math 

def mygcd(x,y,z):
	return math.gcd(math.gcd(x,y),z)

mysum = 0
K = int(input())
for i in range(1,K+1):
	for j in range(1,K+1):
		for k in range(1,K+1):
			mysum += mygcd(i,j,k)

print(mysum)

Fixed submission:
from math import gcd 

mysum = 0
K = int(input())
for i in range(1,K+1):
	for j in range(1,K+1):
		for k in range(1,K+1):
			mysum += gcd(gcd(i,j),k)

print(mysum)