Harryxun/stf_run huggingface dataset:
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)] # 親の番号
        self.size = [1]*n
    
    def root(self, x: int) -> int:
        """根を求める"""
        if self.par[x] == x: # if root
            return x
        else:
            self.par[x] = self.root(self.par[x]) # 経路圧縮
            return self.par[x]
    
    def is_same(self, x:int, y:int)->bool:
        """x と y が同じ集合に属するか否か"""
        return self.root(x)==self.root(y)
    
    def unite(self, x:int, y:int):
        """x と y の属する集合を併合"""
        x = self.root(x)
        y = self.root(y)
        if x == y: return
        self.par[x] = y
        self.size[y] += self.size[x]
        # self.size[x] = 0
        
    def get_size(self, x:int)->int:
        return self.size[self.root(x)]
        
N,M = map(int, input().split())
ab = list(tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M))

def comb2(n):
    if n==0: return 0
    return n*(n-1)//2

uf = UnionFind(N)
ans = []
nex = comb2(N)
for ai,bi in reversed(ab):
    if uf.is_same(ai,bi):
        ans.append(0)
    else:
        ans.append(uf.get_size(ai)*uf.get_size(bi))
    uf.unite(ai,bi)
print(0)
ans = ans[::-1]
for i in range(1,len(ans)):
    ans[i] += ans[i-1]
    print(ans[i])

### FIXED CODE ###

#UnionFindクラス
class UnionFind:
    def __init__(self,n):
        self.par =  [i for i in range(n)]
        self.rank = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # xとyの根を結合させる
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y: return
        if self.rank[x] < self.rank[y]:
            x, y = y, x
        self.rank[x] += self.rank[y]
        self.par[y] = x

    # x,yの根が同じかどうかを返す（根が同じ:True、根が異なる:False）
    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    # xが含まれる木の要素数を返す
    def size(self, x):
        return self.rank[self.find(x)]
    
n,m = map(int,input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(m)]
uf = UnionFind(n)
accm = []
for ai,bi in reversed(ab):
    if uf.is_same(ai,bi):
        accm.append(0)
    else:
        accm.append(uf.size(ai)*uf.size(bi))
    uf.union(ai,bi)

accm = accm[::-1]
for i in range(1,len(accm)):
    accm[i] += accm[i-1]
for a in accm:
    print(a)
n = int(input())
lst = list(map(int, input().split()))
m = 0
for i in range(0,n-2):
	if lst[i] != lst[i+2]:
    	lst[i+2] = lst[i]
    	m += 1
    elif lst[i] == lst[i+1]:
		m += 1
print(m)


### FIXED CODE ###

n = int(input())
lst = list(map(int, input().split()))
ma = {}
mb = {}
for i in range(0, n, 2):
    lst[i] in ma
    if lst[i] in ma:
        ma[lst[i]] += 1
    else:
        ma[lst[i]] = 1
    lst[i+1] in mb
    if lst[i+1] in mb:
        mb[lst[i+1]] += 1
    else:
        mb[lst[i+1]] = 1
if max(ma, key=ma.get) != max(mb, key=mb.get):
    d = n - max(ma.values()) - max(mb.values())
else:
    ma2 = max(ma.values())
    mb2 = max(mb.values())
    ma[max(ma, key=ma.get)] = 0
    mb[max(mb, key=mb.get)] = 0
    d1 = n - ma2 - max(mb.values())
    d2 = n - max(ma.values()) - mb2
    d = min(d1, d2)
print(d)
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n,k = na()
mod = 10**9 + 7
ans = 1
for i in range(k, n+1):
  ans += (2*n-i+1)*i//2-i*(i-1)//2+1
  ans %= mod

print(ans)

### FIXED CODE ###

R = int(input())
import math
print(2*R*math.pi)
D=["SUN","MON","TUE","WED","THU","FRY","SAT"]
S=input(int())

print(7-D.index(S))

### FIXED CODE ###

D=["SUN","MON","TUE","WED","THU","FRI","SAT"]
S=input()

print(7-D.index(S))
import sys

def merge(A, left, mid, right, num_compare):
	n1 = mid - left
	n2 = right - mid

	L = A[left:mid] + [SENTINEL]
	R = A[mid:right] + [SENTINEL]
	
	i = 0
	j = 0

	num_compare += right - left
	for k in range(left, right):
		if L[i] <= R[j]:
			A[k] = L[i]
			i += 1
		else:
			A[k] = R[j]
			j += 1
	return num_compare

def merge_sort(A, left, right, num_compare):
	if left + 1 < right:
		mid = (left + right) // 2
		num_compare = merge_sort(A, left, mid, num_compare)
		num_compare = merge_sort(A, mid, right, num_compare)
		num_compare = merge(A, left, mid, right, num_compare)

	return num_compare


fin = open("test.txt", "r")
#fin = sys.stdin

SENTINEL = float("inf")

n = int(fin.readline())
S = list(map(int, fin.readline().split()))

num_compare = 0
num_compare = merge_sort(S, 0, n, num_compare)

print(S[0], end = "")
for s in S[1:]:
	print(" " + str(s), end = "")
print("") 
print(num_compare)

### FIXED CODE ###

import sys

def merge(A, left, mid, right, num_compare):
	n1 = mid - left
	n2 = right - mid

	L = A[left:mid] + [SENTINEL]
	R = A[mid:right] + [SENTINEL]
	
	i = 0
	j = 0

	num_compare += right - left
	for k in range(left, right):
		if L[i] <= R[j]:
			A[k] = L[i]
			i += 1
		else:
			A[k] = R[j]
			j += 1
	return num_compare

def merge_sort(A, left, right, num_compare):
	if left + 1 < right:
		mid = (left + right) // 2
		num_compare = merge_sort(A, left, mid, num_compare)
		num_compare = merge_sort(A, mid, right, num_compare)
		num_compare = merge(A, left, mid, right, num_compare)

	return num_compare


#fin = open("test.txt", "r")
fin = sys.stdin

SENTINEL = float("inf")

n = int(fin.readline())
S = list(map(int, fin.readline().split()))

num_compare = 0
num_compare = merge_sort(S, 0, n, num_compare)

print(S[0], end = "")
for s in S[1:]:
	print(" " + str(s), end = "")
print("") 
print(num_compare)
A,B,C = map(int,input().split())
#場合分けが必要なのか？？

#B＋CがAより少ないなら０
if B+C =< A:
    print(0)
else:
    print(C-(A-B))

### FIXED CODE ###

A,B,C=map(int,input().split())
if B+C <= A:
    print(0)
else:
    print(C+B-A)
N = int(input())

t = [0]
x = [0]
y = [0]
for i in range(N):
    l = [int(c) for c in input().split()]
    t.append(l[0])
    x.append(l[1])
    y.append(l[2])

for i in range(N-1):
    move = x[i+1]-x[i] + y[i+1]-y[i]
    time = t[i+1]-t[i]
    if time%2 ^ move%2 == 1 or time < move:
        print("No")
        exit()

print("Yes")


### FIXED CODE ###

n = [int(i) for i in input().split()]

a = n[0]
b = n[1]

if (a % 2 == 0) or (b % 2 == 0):
    print("Even")
else:
    print("Odd")
wake_up_hour= int(input("Enter WakeUp Hour: "))
wake_up_minute=int(input("Enter WakeUp Minute: "))
sleep_hour=int(input("Enter Sleep Hour: "))
sleep_minute= int(input("Enter Sleep Minute:" ))
study_time=int(input("Study time :"))

#print(wake_up_hour, wake_up_minute, sleep_hour, sleep_minute, study_time)
Total_Minutes = (sleep_hour) *60 + (sleep_minute) - ((wake_up_hour) * 60 + (wake_up_minute))
if Total_Minutes > study_time:
    print("You can finish the study")
    start_before_minute= ((sleep_hour*60 +  sleep_minute) - study_time) % 60
    start_before_hour= ((sleep_hour*60 +  sleep_minute) - study_time) // 60 
    print("Start before: ", start_before_hour, start_before_minute, )
else:
    print("You are lazy!!!. wake up early")
    


### FIXED CODE ###

import math
import re
import copy

h1,m1,h2,m2,k = map(int,input().split())
w1 = h1*60 + m1
w2 = h2 * 60 + m2
w3 = (w2-w1+24*60)%(24*60)
w3 = w3 - k
print(w3)
N = int(input())
X = [int(i) for i in input().split()]

X = sorted(X)
X_undupe = list(set(X))
stamina = []
for i in range(X_undupe[0], X_undupe[len(X_undupe)-1] + 1):
    s = 0
    for ii in X:
        s = s + ((ii - i) ** 2)
    stamina.append(s)

print(min(stamina))

### FIXED CODE ###

N = int(input())
X = [int(i) for i in input().split()]

# X = sorted(X)
# X_undupe = list(set(X))
stamina = []
for i in range(1, 100):
    s = 0
    for ii in X:
        s = s + ((ii - i) ** 2)
    stamina.append(s)

print(min(stamina))
import re, sys
print sum(map(int,re.sub("[^\d]+"," ",sys.stdin.readlines()).strip().split()))

### FIXED CODE ###

import re, sys
print sum(map(int,re.sub(r"[^\d]+",r" "," ".join(sys.stdin.readlines())).strip().split()))
N, M, X = map(int, input().split())

nums = []

for i in range(N):
    a = list(map(int,input().split()))
    nums.append(a)

ans = 10000000000


for i in range(2**N):

    money = 0
    skill_point = [0]*M
    goal = [0]*M
    buy = []
    
    for k in range(N):
        if i>>k & 1:
            buy.append(nums[k])

    for d in buy:
        money += d[0]
        for e in range(M):
            skill_point[e] += d[e+1]

    for f in range(M):
        if skill_point[f] >= X:
            goal[f] = 1

    
    if (0 not in goal) and (money < ans) :
        ans = money

    

if ans != 10000000000:
    print(ans)
else:
    print(-1)


### FIXED CODE ###

S = str(input())
T = str(input())

len_T = len(T)

if S == T[0:len_T-1]:
      print('Yes')
else:
      print('No')
a,b=map(int, input().split())

if a==1:
  a=14
else:
  a=a+0
if b==1:
  b=14
else:
  b=b+0
  
if a>b:
  print("Alice")
elif a==b:
  print("Draw")
else a<b:
  print("Bob")

### FIXED CODE ###

a,b=map(int, input().split())

if a==1:
  k=14
else:
  k=a
if b==1:
  m=14
else:
  m=b
  
if k>m:
  print("Alice")
elif k==m:
  print("Draw")
else:
  print("Bob")
import numpy as np

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

x = np.arange(0, N+1)
X = np.floor(A * x / B) - A * np.floor(x / B)

print(int(np.max(X)))

### FIXED CODE ###

# -*- coding: utf-8 -*-
A,B,N = map(int, input().split())
 
def function(x):
  return (A*x)//B-A*(x//B)
 
if B-1<=N:
  print(function(B-1))
else:
  print(function(N))
N = int(input())
E = [set() for _ in range(N)]
C = {}
for i in range(N-1):
  a,b,c = map(int,input().split())
  E[a-1].add(b-1)
  E[b-1].add(a-1)
  C[min(a-1,b-1)*N+max(a-1,b-1)] = c
  
Q,K = map(int,input().split())
K -= 1
Query = []
for i in range(Q):
  x,y = map(int,input().split())
  Query.append([x-1,y-1])
#print(E)
#print(C)
#print(K)
#print(Query)

Kcost = [0 for _ in range(N)]
def dfs(u,v):
  if v != -1:
    Kcost[u] = Kcost[v] + C[min(u,v)*N+max(u,v)]
  for t in E[u]:
    if t != K and Kcost[t] == 0:
      dfs(t,u)
dfs(K,-1)

for x,y in Query:
  print(Kcost[x]+Kcost[y])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())
E = [set() for _ in range(N)]
C = {}
for i in range(N-1):
  a,b,c = map(int,input().split())
  E[a-1].add(b-1)
  E[b-1].add(a-1)
  C[min(a-1,b-1)*N+max(a-1,b-1)] = c
  
Q,K = map(int,input().split())
K -= 1
#print(E)
#print(C)
#print(K)

Kcost = [0 for _ in range(N)]
def dfs(u,v):
  if v != -1:
    Kcost[u] = Kcost[v] + C[min(u,v)*N+max(u,v)]
  for t in E[u]:
    if t != K and Kcost[t] == 0:
      dfs(t,u)
dfs(K,-1)

for i in range(Q):
  x,y = map(int,input().split())
  print(Kcost[x-1]+Kcost[y-1])
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0
for j in range(a,b+1):
    if j%c != 0 and j%d != 0:
        cnt += 1
    else:
        pass
print(cnt)

### FIXED CODE ###

s = str(input())
s = list(s)
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print("Bad")
else:
    print("Good")
import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()
if len(array) == len(list(set_array)): print(0);sys.exit()

print(len(list(set_array))) if len(list(set_array) % 2 == 1 else print(len(list(set_array) - 1)

### FIXED CODE ###

import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()

print(len(list(set_array))) if len(list(set_array)) % 2 == 1 else print(len(list(set_array)) - 1)
N,M,H=list(map(int().input(),split()))
B=list(map(int,input().split()))
count=0
for i in range(N):
  A=list(map(int,input().split()))
  ans=0
  for k in range(M):
    ans+=A[k]*B[k]
  if ans+H>:
    count+=1
print(count)


### FIXED CODE ###

N,M,H=list(map(int,input().split()))
B=list(map(int,input().split()))
count=0
for i in range(N):
  A=list(map(int,input().split()))
  ans=0
  for k in range(M):
    ans+=A[k]*B[k]
  if ans+H>0:
    count+=1
print(count)
import fractions
n,X=map(int,input().split())
x=list(map(int,input().split()))
for i in range(n):
  x[i]=x[i]-X
print(fractions.gcd(*x))



### FIXED CODE ###

import fractions
import sys
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
if n==1:
  print(abs(x[0]-X))
  sys.exit()
for i in range(n):
  y.append(abs(x[i]-X))
G=100000000000
for j in range(n-1):
  G=min(G,fractions.gcd(y[j],y[j+1]))
print(G)
import math
n = int(input())
a = list(map(int,input().split()))
a.sort()
gcd = a[-1]
for i in range(n-1):
    gcd = math.gcd(gcd,a[(-1)*(i+2)])
print(gcd)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a.sort()
gcd = a[-1]
def Euclid(n1,n2):
    if n1 % n2 == 0:
        return n2
    return Euclid(n2,n1%n2)
for i in range(n-1):
    gcd = Euclid(gcd,a[(-1)*(i+2)])
print(gcd)
a = list(map(int,input().split()))
sum = a[0] + a[1] + a[2]
if sum >= 22
	print("bust")
else
	print("win")

### FIXED CODE ###

a = list(map(int,input().split()))
sum = a[0] + a[1] + a[2]
if sum >= 22:
	print("bust")
else:
	print("win")
a,b=map(int,input().split())
h=[int(i) for i in input().split()]
for i in range(b):
    c,d=map(int,input().split())
    ch=h[c-1]
    dh=h[d-1]
    if ch==dh:
        ansl.append(c-1)
        ansl.append(d-1)
        ansl=list(set(ansl))
    else:
        if ch<dh:
            ansl.append(c-1)
        else:
            ansl.append(d-1)
        ansl=list(set(ansl))
print(a-len(ansl))

### FIXED CODE ###

a,b=map(int,input().split())
h=[int(i) for i in input().split()]
ansl=[]
dic={i:0 for i in range(a)}
aans=[]
for i in range(b):
    c,d=map(int,input().split())
    if True:
        ch=h[c-1]
        dh=h[d-1]
        if ch==dh:
            if dic[c-1]==0:
                ansl.append(c-1)
                dic[c-1]+=1
            if dic[d-1]==0:
                ansl.append(d-1)
                dic[d-1]+=1
        else:
            if ch<dh:
                if dic[c-1]==0:
                    ansl.append(c-1)
                    dic[c-1]+=1
            else:
                if dic[d-1]==0:
                    ansl.append(d-1)
                    dic[d-1]+=1
        aans.append([c,d])
print(a-len(ansl))
import math
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
ans = 0
for i in range(n-1):
  ans += b[n-(math.floor(i/2))]
print(ans)


### FIXED CODE ###

import math
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
ans = 0
for i in range(n-1):
  ans += b[n-1-(math.ceil(i/2))]
print(ans)
a,b,c,d,e = [int(input()) for _ in range(4)]
k = int(input())

if abs(a-b) >k or abs(a-c) >k or abs(a-d) >k or abs(a-e) >k or abs(b-c) >k or abs(b-d) >k or abs(e-b) >k or abs(c-d) >k or abs(c-e) >k or abs(d-e) >k :
  print(":(")
else:
  print("Yay!")

### FIXED CODE ###

a,b,c,d,e = [int(input()) for _ in range(5)]
k = int(input())

if abs(a-b) >k or abs(a-c) >k or abs(a-d) >k or abs(a-e) >k or abs(b-c) >k or abs(b-d) >k or abs(e-b) >k or abs(c-d) >k or abs(c-e) >k or abs(d-e) >k :
  print(":(")
else:
  print("Yay!")
print("Enter Number")
a = int(input())
b = int(input())

i = a * b
if i % 2 == 0:
    print("Even")
else:
    print("Odd")


### FIXED CODE ###

s = list(map(int,input().split()))

i = s[0] * s[1]
if i % 2 == 0:
    print("Even")
else:
    print("Odd")
n=int(input())
A=sorted(map(int,input().split()))
L=[A[0]]

c=0
if A[0]!=A[1]:
    c=1
for i in range(n-1):
    flag=0
    for l in L:
        if A[i+1]%l==0:
            flag=1
            break
    L.append(A[i+1])
    if flag==0:
        c+=1
print(c)

### FIXED CODE ###

from collections import defaultdict
n=int(input())
A=sorted((map(int,input().split())))
maxA=max(A)
L=[0]*(maxA+1)
AD=defaultdict(int)
for a in A:
	L[a]=1
	AD[a]+=1
for a in A:
	if AD[a]>=2:
		L[a]=0
	for i in range(2*a,maxA+1,a):
		L[i]=0
print(sum(L))
import sys
input=sys.stdin.readline
import math

def main():
    N,_ = map(int, input().split())
    X = list(map(int, input().split()))
    X.sort()
    D = []
    for i in range(len(X)-1):
        D.append([i+1] - X[i])
    D.sort(reverse=True)
    D = D[math.ceil(N/2):]
    n = 0
    for d in D:
        n += d[1]
    print(n)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input=sys.stdin.readline
import math

def main():
    N,_ = map(int, input().split())
    X = list(map(int, input().split()))
    X.sort()
    D = []
    for i in range(len(X)-1):
        D.append(X[i+1] - X[i])
    D.sort(reverse=True)
    D = D[N-1:]
    n = 0
    for d in D:
        n += d
    print(n)

if __name__ == '__main__':
    main()
import math

XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=math.gcd(x,x_dy)

print(ans)

### FIXED CODE ###

def euclidean_alg(x,y):
    while y:
        x,y=y,x%y
    return x

XY=list(map(int,input().split()))
x=max(XY)
y=min(XY)

print(euclidean_alg(x,y))
N,M,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

sumt = 0
cnt = 0
    
for i in range(N+M):
    
    if len(A) > 0:
        tmpA = A[0]
    else:
        tmpA = 10**10

    if len(B) > 0:
        tmpB = B[0]
    else:
        tmpA = 10**10

    if tmpA <= tmpB:
        sumt += A.pop(0)
    else:
        sumt += B.pop(0)

    if sumt > K:
        print(cnt)
        exit(0)
        
    cnt += 1
print(cnt)


### FIXED CODE ###

import bisect
N,M,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

SumA = [0]
SumB = [0]
cnt = 0
for i in range(N):
    SumA.append(SumA[i] + A[i])
for i in range(M):
    SumB.append(SumB[i] + B[i])

for i in range(N+1):
    if SumA[i] > K:
        break
    tmpcnt = bisect.bisect_right(SumB, K - SumA[i]) - 1
    #print([SumA,SumB])
    #print(SumA[i])
    #print(K - SumA[i])
    #print(tmpcnt)
    #print([i,tmpcnt])
    cnt = max(cnt, i + tmpcnt)
print(cnt)
import math
a,b=map(int,input().split())
print(math.gcd(a, b))

### FIXED CODE ###

import fractions
a,b=map(int,input().split())
print((a * b) // fractions.gcd(a, b))
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
sum_list = []
for i in range(N):
  if K < sum(A[:i+1]):
    break
  for j in range(M):
    sum_ = sum(A[:i+1]) + sum(B[:j+1])
    if sum_ <= K:
      sum_list.append(len(A[:i+1]) + len(B[:j+1]))
    elif K < sum_:
      break
if 1 <= len(sum_list):
  print(max(sum_list))
elif 0 == len(sum_list):
  print(0)

### FIXED CODE ###

a = int(input())
res = a + a**2 + a**3
print(res)
N, Y = map(int, input().split())

flag = True
def f(x_1,x_2):
    global flag
    x_3 = int((Y - 10000*x_1 - 5000*x_2) / 1000)
    if x_1 + x_2 + x_3 == N:
        print(str(x_1) + " " + str(x_2) + " " + str(x_3))
        flag = False

for i in range(Y // 10000 + 1):
    spliting = int((Y - 10000*i) / 2 // 5000)
    
    if spliting <= N:
        for k in range(spliting + 1):
            f(i,k)
            if flag == False:
                break
    else:
        for k in range(spliting , (Y - 10000*a) // 5000 + 1):
            f(i,k)
            if flag == False:
                break
    if flag == False:
        break
    
if flag:
    print("-1 -1 -1")

### FIXED CODE ###

N, Y = map(int, input().split())

flag = True

for i in range(Y // 10000 + 1):
    for k in range((Y - 10000*i) // 5000 + 1):
        l = int((Y - 10000*i - 5000*k) / 1000)
        if (i + k + l) == N:
            print(str(i) + " " + str(k) + " " + str(l))
            flag = False
            break
    if flag == False:
        break
if flag:
    print("-1 -1 -1")
n=int(input())
a=[]

for j in range(0,n):
  a.append(int,input())
  
x=max(a)
y=a.index(x)
del a[y]
z=max(a)

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    print(z)
  


### FIXED CODE ###

n=int(input())
a=[]

for j in range(0,n):
  a.append(int(input()))
  
x=max(a)
y=a.index(x)
del a[y]
z=max(a)

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    print(z)
n = input()

print(n.replace("1","9").repace("9","1")
      


### FIXED CODE ###

n = input()

print(n.replace("1","x").replace("9","1").replace("x","9"))
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


N, K = map(int, input().split())

for i in range(1, K + 1):
    print((cmb(N - K + 1, i) %
           (10**9 + 7)) * (cmb(K - 1, i - 1) %
                           (10**9 + 7)))


### FIXED CODE ###

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


N, K = map(int, input().split())

for i in range(1, K + 1):
    if N - K + 1 < i:
        print(0)
    else:
        print((cmb(N - K + 1, i) * cmb(K - 1, i - 1)) % (10**9 + 7))
X = input().split()
S = X[0]
T = X[1]
Y = input().split()
A = int(Y[0])
B = int(Y[1])
U = input()

A -= 1 if U == S else B-= 1

print(A + " " + B)

### FIXED CODE ###

[S, T] = input().split()
[A, B] = [int(x) for x in input().split()]
U = input()

if U == S:
    print(A-1, B)
else:
    print(A, B-1)
n,l=map(int,input().split())
s=list(input() for _ in range(n))
s.sort()
result=''.join(s)
print(result)

### FIXED CODE ###

abc = [int(x) for x in input().split()]
abc.sort()
print("YES" if abc == [5,5,7] else "NO")
import re

N = int(input())
H = list(map(int, input().split()))
X = []

if N == 1:
    print('0')
else:
    for n in range(N-1):
        if H[n] >= H[n+1]:
            X.append('T')
        else:
            X.append('F')

    XX = ''.join(X)

    T = re.findall('T*T', XX)

    Y=[]
    for y in T:
        Y.append(len(y))

    print(max(Y))

### FIXED CODE ###

import re

N = int(input())
H = list(map(int, input().split()))
X = []

if N == 1:
    print('0')
else:
    for n in range(N-1):
        if H[n] >= H[n+1]:
            X.append('T')
        else:
            X.append('F')

    XX = ''.join(X)

    if XX.find('T') == -1:
        print('0')
    else:
        T = re.findall('T*T', XX)

        Y=[]
        for y in T:
            Y.append(len(y))

        print(max(Y))
# B - Five Dishes

n = []
# n = [29, 20, 7, 35, 120]
for _ in range(5):
    n.append(int(input()))

mini = 10
for y, x in enumerate(n):
    rest = x % 10 
    if rest != 0:
        if rest < mini:
            mini = rest
            mini_num = y 
            
# print(mini)
# print(mini_num)

# print(n.pop(mini_num))

time = n.pop(mini_num)
print(n)
for x in n:
    if x % 10 != 0:
        item = x + (10-x%10)
        time += item
    else:
        item = x
        time += item
#     print('item:', item)
#     print(time)
    
print(time)

### FIXED CODE ###

# B - Five Dishes

n = []
for _ in range(5):
    n.append(int(input()))

time = 0
mini = 10
for x in n:
    rest = x%10
    if rest != 0:
        mini = min(rest, mini)
    while x%10 != 0:
        x += 1
    time += x
print(time-10+mini)
n, m = map(int, input().split())

solved = [0]* 10*5
penalty_sum = 0
penalty = 0

for _ in range(m):
    q, result = input().split()
    q = int(q)
    
    if result == 'AC':
        if solved[q] == 0:
            penalty_sum += penalty
            penalty = 0
    else:
        if solved[q] == 0:
            penalty += 1

print(str(len(ac)) + " " + str(penalty_sum))

### FIXED CODE ###

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

solved = [0]* 10**5
penalty = [0]* 10**5
penalty_sum = 0
for _ in range(m):
    q, result = input().split()
    q = int(q) - 1
    
    if result == 'AC':
        if solved[q] == 0:
            solved[q] = 1
            penalty_sum += penalty[q]
    else:
        if solved[q] == 0:
            penalty[q] += 1

print(str(sum(solved)) + " " + str(penalty_sum))
al=list(map(int,input.split()))
al.sort()
print(sum(al)-al[1]*2)

### FIXED CODE ###

al=list(map(int,input().split()))
al.sort()
print(sum(al)-al[1]*2)
K, X = map(int, intpu().split())
print("Yes" if K * 400 >= X else "No")

### FIXED CODE ###

K, X = map(int, input().split())
print("Yes" if K * 500 >= X else "No")