Harryxun/stf_run huggingface dataset:
# coding: utf-8

import sys
import math

import array
import bisect
import collections
from collections import Counter, defaultdict
import fractions
import heapq
import re

sys.setrecursionlimit(1000000)


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]

def argsort(l, reverse=False):
    return sorted(range(len(l)), key=lambda i: l[i], reverse=reverse)

def argmin(l):
    return l.index(min(l))

def YESNO(ans, yes="YES", no="NO"):
    print([no, yes][ans])

II = lambda: int(input())
MI = lambda: map(int, input().split())
MIL = lambda: list(MI())
MIT = lambda: tuple(MI())
MIS = lambda: input().split()


def get(V, n):
    if n >= len(V):
        yield V
    else:
        yield V[:n]
        for i in range(1, n):
            yield V[:n-i] + V[-i:]
        yield V[-n:]


def main():
    N, K = MI()
    V = MIL()
    ans = 0

    for i in range(K//2, K + 1):
        # 左右からi個まで取る
        for vs in get(V, i):
            # K-i個まで、負を捨てる
            vs = sorted(vs)
            for j, v in enumerate(vs):
                if v >= 0: break
            ans = max(ans, sum(vs[min(K-i, j):]))
    return ans


if __name__ == "__main__":
    print(main())


### FIXED CODE ###

# coding: utf-8

import sys
import math

import array
import bisect
import collections
from collections import Counter, defaultdict
import fractions
import heapq
import re

sys.setrecursionlimit(1000000)


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]

def argsort(l, reverse=False):
    return sorted(range(len(l)), key=lambda i: l[i], reverse=reverse)

def argmin(l):
    return l.index(min(l))

def YESNO(ans, yes="YES", no="NO"):
    print([no, yes][ans])

II = lambda: int(input())
MI = lambda: map(int, input().split())
MIL = lambda: list(MI())
MIT = lambda: tuple(MI())
MIS = lambda: input().split()


def get(V, n):
    if n >= len(V):
        yield V
    else:
        yield V[:n]
        for i in range(1, n):
            yield V[:n-i] + V[-i:]
        yield V[-n:]


def main():
    N, K = MI()
    V = MIL()
    ans = 0

    for i in range(max(K//2, 1), K + 1):
        # 左右からi個まで取る
        for vs in get(V, i):
            # K-i個まで、負を捨てる
            vs = sorted(vs)
            for j, v in enumerate(vs):
                if v >= 0: break
            ans = max(ans, sum(vs[min(K-i, j):]))
    return ans


if __name__ == "__main__":
    print(main())
n,m,k = map(int, input().split())
a_li = list(map(int, input().split()))
b_li = list(map(int, input().split()))

a_li = [0] + a_li
b_li = [0] + b_li

time = 0
ans = 0
a = 0
temp = 0

a_wa = [0] * (n+10)
b_wa = [0] * (m+10)

s = 0
for i in range(n+1):
    s += a_li[i]
    a_wa[i] = s

s = 0
for i in range(m+1):
    s += b_li[i]
    b_wa[i] = s
    

for i in range(n+1):
    for j in range(min(temp-i, m), m+1):
        time = a_wa[i] + b_wa[j]
        if time <= k:
            ans = max(ans, i+j)
            temp = ans
        else:
            break
            
print(ans)

### FIXED CODE ###

n,m,k = map(int, input().split())
a_li = list(map(int, input().split()))
b_li = list(map(int, input().split()))

a_li = [0] + a_li
b_li = [0] + b_li

time = 0
ans = 0
a = 0
temp = 0

a_wa = [0] * (n+10)
b_wa = [0] * (m+10)

s = 0
for i in range(n+1):
    s += a_li[i]
    a_wa[i] = s

s = 0
for i in range(m+1):
    s += b_li[i]
    b_wa[i] = s
    

for i in range(n+1):
    for j in range(max(min(temp-i, m), 0), m+1):
        time = a_wa[i] + b_wa[j]
        if time <= k:
            ans = max(ans, i+j)
            temp = ans
        else:
            break
            
print(ans)
s=input()
if s=="AAA" or s="BBB":
  print('No')
else:
  print('Yes')

### FIXED CODE ###

s=input()
if s=="AAA" or s=="BBB":
  print('No')
else:
  print('Yes')
s, t = map(String, input(),split())
	print(s+t)

### FIXED CODE ###

s, t = input().split()
print(t+s)
a=int(input())
b=int(input())
if a>=b:
    c=a
    d=b
else:
    c=b
    d=a
for i in range(1,d+1):
    e=c*i
    if e%d==0:
        print(e)
        break
    else:
        continue

### FIXED CODE ###

a,b=map(int,input().split())
if a>=b:
    c=a
    d=b
else:
    c=b
    d=a
for i in range(1,d+1):
    e=c*i
    if e%d==0:
        print(e)
        break
    else:
        continue
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

n,w = MI()
item = []
for i in range(n):
	item.append(LI())

def main():
 	dp = [0]*(w+1)
	for i in range(n):
		for j in range(w,item[i][0]-1,-1):
			dp[j] = max(dp[j], dp[j-item[i][0]]+item[i][1])
	print(dp[w])

if __name__ == '__main__':
	main()


### FIXED CODE ###

def solver():
	N,W = map(int, input().split())
	item = []
	for i in range(N):
		item.append(list(map(int, input().split())))
	dp = [0 for _ in range(W+1)]
 
	for i in range(0,N):
		for j in range(W, item[i][0]-1, -1):
			dp[j] = max(dp[j], dp[j-item[i][0]]+item[i][1])
	print(dp[W])
 
solver()
import math

l = int(input())
n = math.ceil(math.log2(l))

bin_str = bin(l -  2 ** (n - 1))
value = 2 ** (n - 1)

path_add = [0 for i in range(n - 1)]
path_add_value = [0 for i in range(n - 1)]

for i in range(len(bin_str) - 2):
  if bin_str[-(i + 1)] == "1":
    path_add[-(i + 1)] = 1
    path_add_value[-(i + 1)] = value
    value += 2 ** (n - 2 - i)

print(n, (n - 1) * 2 + sum(path_add))
for i in range(n - 1):
  print(i + 1, i + 2, 0)
  print(i + 1, i + 2, 2 ** i)
  if path_add[i] == 1:
    print(i + 1, n, path_add_value[i])  

### FIXED CODE ###

l=int(input())
for i in range(21):
  if 2 ** i > l:
    n = i
    break

m = (n - 1) * 2
  
s = l -  2 ** (n - 1)
value = 2 ** (n - 1)

path_add = [0 for i in range(n - 1)]
path_add_value = [0 for i in range(n - 1)]

for i in range(n - 1):
  if s >= 2 ** (n - 2 - i) :
    s -= 2 ** (n - 2 - i)
    path_add[-(i + 1)] = 1
    path_add_value[-(i + 1)] = value
    value += 2 ** (n - 2 - i)
  
#print(path_add)
#print(path_add_value)
#print(s)  
  
print(n, m + sum(path_add))
for i in range(n - 1):
  print(i + 1, i + 2, 0)
  print(i + 1, i + 2, 2 ** i)
  
for i in range(n - 1):
  if path_add[i] == 1:
    print(i + 1, n, path_add_value[i])
# coding: utf-8
# 整数の入力
#a = int(raw_input())
# スペース区切りの整数の入力
import numpy as np

N, W = map(int, raw_input().split())

WeightValueMatrix = np.zeros((W+1, N))
data = []
for i in range(N):
    data.append(map(int, raw_input().split()))

for i in range(N):
    if i == 0:
        for j in range(W+1):
            if j < data[i][0]:
                WeightValueMatrix[j][i] = 0
            else:
                WeightValueMatrix[j][i] = data[i][1]
    else:
        for j in range(W+1):
            if j < data[i][0]:
                WeightValueMatrix[j][i] = WeightValueMatrix[j][i-1]
            else:
                if WeightValueMatrix[j-data[i][0]][i-1] + data[i][1] > WeightValueMatrix[j][i-1]:
                    WeightValueMatrix[j][i] = WeightValueMatrix[j-data[i][0]][i-1] + data[i][1]
                else:
                    WeightValueMatrix[j][i] = WeightValueMatrix[j][i-1]

print long(WeightValueMatrix[W][N-1])

### FIXED CODE ###

N, W = map(int, raw_input().split())
X = [map(int, raw_input().split()) for _ in range(N)]
 
dp = {}
dp[0] = 0
 
for w, v in X:
    d = dp.copy()
    for k in d:
        if k + w > W:
            continue
        if k + w in dp:
            dp[k + w] = max(dp[k + w], d[k] + v)
        else:
            dp[k + w] = d[k] + v
 
print max(dp.values())
N, M  = map(int, input().split())
S = []
for i in range(M):
    S.append(set(input().split()))

groups = [S[0]]

for j in range(1,len(S)-1):
    for k in range(len(groups)):
        if S[j] & groups[k] != set():
            groups[k] = S[j] | group
        else:
            groups.append(S[j])
lens = []
for group in groups:
    lens.append(len(group))
print(max(lens))

### FIXED CODE ###

D, T, S  = map(int, input().split())

if D <= T*S:
    print("Yes")
else:
    print("No")
A,B,H,M=[int(input()) for i in range (4)]

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)

### FIXED CODE ###

import math
A,B,H,M=input().split()

A=int(A)
B=int(B)
H=int(H)
M=int(M)

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)
W=int(input())
H=int(input())
x=int(input())
y=int(input())
r=int(input())

if x-r>=0 and x-r>=0 and x+r<=W and y+r<=H:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

W,H,x,y,r=[int(i) for i in input().split()]
if x-r>=0 and y-r>=0 and x+r<=W and y+r<=H:
    print("Yes")
else:
    print("No")
o = list(input())
e = list(input())
ans = []

count = 0

for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])
if len(o) != len(e):
    ans.append(e[-1])

print("".join(ans))


### FIXED CODE ###


o = list(input())
e = list(input())
ans = []

count = 0

if len(o) > len(e):
    for i in range(len(e)):
        ans.append(o[i])
        ans.append(e[i])
    ans.append(o[-1])
elif len(o) < len(e):
    for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])
    ans.append(e[-1])
else:
    for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])

print("".join(ans))
import math

r = int(input())
x = math.pi

print(2*r*x)




### FIXED CODE ###

n , m = list(map(int,input().split()))
A = list(map(int,input().split()))
S=sum(A)

if n-S >=0:
  print(n-S)
if n-S<0:
  print(-1)
n, m = map(int, input().split())
a = list(map(int, input().split())).sort()
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>(sum_/4*m)):
    print('Yes')
else: print('No')

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>=sum_/(4*m)):
    print('Yes')
else: print('No')
N,A,B,C,D = map(int,input().split())
S = input()

def obs(st,end):
  for i in range(st,end):
  	if S[i] is "#" and S[i+1] is "#": return True
  return False

if obs(B,D) or obs(A,C):
  print("No")
elif C > D:
  b = False
  for i in range(B-1,max(D,N-2)):
    if S[i] is "." and S[i+1] is "." and S[i+2] is ".":
      b = True
      break
  if b:
    print("Yes")
  else:
    print("No")
else:
  print("Yes")


    
  

### FIXED CODE ###

N,A,B,C,D = map(lambda x: int(x)-1,input().split())
S = input()

def obs(st,end):
  for i in range(st,end):
  	if S[i] is "#" and S[i+1] is "#": return True
  return False

if obs(B,D) or obs(A,C):
  print("No")
elif C > D:
  b = False
  for i in range(B-1,min(D,N-2)):
    if S[i] is "." and S[i+1] is "." and S[i+2] is ".":
      b = True
      break
  if b:
    print("Yes")
  else:
    print("No")
else:
  print("Yes")
n = int(input())
ans = ''
while n > 0:
    n -= 1
    ans += chr(97 + n%26)
    n //= 26
print(ans[::-1])

### FIXED CODE ###

a = input()
if a.isupper():
    print('A')
else:
    print('a')
for _ in[0]*int(input()):
 r=o=s=0
 while 1:
  a=input()[1]
  if'I'==a:
   if r<3:r+=1
   else:s+=1
  elif'O'==a:s+=r+1;r=0
  else:
   if r<3:o+=1
   else:print(s);break


### FIXED CODE ###

n=int(input())
r=o=s=0
while n:
 a=input()[1]
 if'I'==a:
  if r<3:r+=1
  else:s+=1
 elif'O'==a:s+=r+1;r=0
 else:
  if o<2:o+=1
  else:print(s);n-=1;r=o=s=0
k = int(input())
cou = 0
while True:
    cou += 1
    t = q.get()
    if cou == k:
        print(t)
        exit()
    if t % 10 == 0:
        q.put(t*10)
        q.put(t*10 + 1)
    elif t % 10 == 9:
        q.put(t*10 + 8)
        q.put(t*10 + 9)
    else:
        s = t % 10
        q.put(t*10 + s -1)
        q.put(t*10 + s)

### FIXED CODE ###

import queue

q = queue.Queue()
for i in range(1,10):
    q.put(i)

k = int(input())
cou = 0
while True:
    cou += 1
    t = q.get()
    if cou == k:
        print(t)
        exit()
    if t % 10 == 0:
        q.put(t*10)
        q.put(t*10 + 1)
    elif t % 10 == 9:
        q.put(t*10 + 8)
        q.put(t*10 + 9)
    else:
        s = t % 10
        q.put(t*10 + s -1)
        q.put(t*10 + s)
        q.put(t*10 + s + 1)
#!/usr/bin/env python3
import sys


def gdp(n, dp, G):
    if dp[n]!=-1:
        return dp[n]

    if G[n]==[]:
        dp[n]=0
        return 0

    for i in G[n]:
        ll=gdp(i, dp, G)
        if dp[n]<ll+1:
            dp[n]=ll+1

    return dp[n]

def solve(N: int, M: int, x: "List[int]", y: "List[int]"):
    G=[[] for _ in range(N)]
    for i in range(M):
        G[x[i]-1].append(y[i]-1)

    dp=[-1]*N

    print(max(gdp(i, dp, G) for i in range(N)))

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    x = [int()] * (M)  # type: "List[int]"
    y = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, M, x, y)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

sys.setrecursionlimit(150000)

def gdp(n, dp, G):
    if dp[n]!=-1:
        return dp[n]

    if G[n]==[]:
        dp[n]=0
        return 0

    for i in G[n]:
        ll=gdp(i, dp, G)
        if dp[n]<ll+1:
            dp[n]=ll+1

    return dp[n]

def solve(N: int, M: int, x: "List[int]", y: "List[int]"):
    G=[[] for _ in range(N)]
    for i in range(M):
        G[x[i]-1].append(y[i]-1)

    dp=[-1]*N

    print(max(gdp(i, dp, G) for i in range(N)))

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    x = [int()] * (M)  # type: "List[int]"
    y = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, M, x, y)

if __name__ == '__main__':
    main()
k=input()
pair=0
for i in range(1,k+1):
     for j in range (2,k+1)
          if i%2==0 and j%2!=0:
              pair+=1
          if i%2!=0 and j%2==0 :
               pair+=1
          
print(pair)

### FIXED CODE ###

k = int(input())
if k % 2 == 0:
    print((k // 2)**2)
else:
    print((k - (k // 2)) * (k // 2))
s=input()
k=int(input())
a=[]
a = [s[i:j] for i in range(0,len(s)) for j in range(1,len(s)+1) if i != j]
a = set(a)
a.remove("")
a=sorted(a)
print(a[k-1])


### FIXED CODE ###

s=input()
k=int(input())
a=[s[i:i+j+1] for i in range(len(s)) for j in range(k+1)]
a=set(a)
a=sorted(a)
print(a[k-1])
n, m = map(int, input().split())

graph = [[] for _ in range(n)]


for _ in range(m):
    l, r, d = map(int, input().split())
    graph[l - 1].append(( d,r - 1))
    graph[r - 1].append((-d,l - 1))

INF = float("inf")
dist = [-INF]*n

# 未探索ノードの距離を0とする
for n in range(n):
    if dist[n] != -INF:
        continue
    else:
        stack = [n]
        dist[n] = 0
        
    # stackが空になるまで探索を繰り返す
    while len(stack):
        cur = stack.pop()
        
        # ノードcurと隣り合う未探索ノードをstackに追加
        for cost, nex_node in graph[cur]:
            if dist[nex_node] != -INF:
                continue
            else:
                dist[nex_node] = dist[cur] + cost
                stack.append(nex_node)

flag = True
for i in range(n):
    if not flag:
        break
    for d,node in graph[i]:
        if dist[node]-dist[i] != d:
            print("No")
            flag = False

if flag:
    print("Yes")

### FIXED CODE ###

# 1.入力
X = int(input())
A = int(input())
B = int(input())

# 2.制約チェック
if A<1 or A>1000:
    print("制約条件1<=A<=1000")
    raise ValueError
elif B<1 or B>1000:
    print("制約条件1<=B<=1000")
    raise ValueError
elif X<A+B or X>10000:
    print("制約条件A+B<=X<=10000")
    raise ValueError

# 3.Aを引く
residue = X-A

# 4.Bを引く
while(1):
    if residue-B >= 0:
        residue = residue-B
    else:
        break
    
    
# 5.結果の表示
print(residue)
N, K = map(int, input().split())

D = []
D = list(map(int, input().split()))

num = []
for i in range(10):
    if i not in D:
        num.append(i)

N_num = []
while True:
    if N ==0:
        break
    N_num.append(N%10)
    N = N//10

N_num.sort(reverse = True)

ans = []
for i in N_num:
    for k in num:
        if k >= i:
            ans.append(k)
            break
map(str, ans)
ans = int("".join(map(str, ans)))
print(ans)


### FIXED CODE ###

#C問題
N, K = map(int, input().split())
D = list(map(str, input().split()))

def check(n, d):
    n = str(n)
    for nstr in n:
        if nstr in d:
            return False
    return True
while True:
    if check(N, D):
        print(N)
        break
    else:
        N += 1
import sys
input = sys.stdin.readline

#import fractions #fractions.gcd() python~3.4
sys.setrecursionlimit(1000000)

N, M = map(int,input().split())
A = list(map(int, input().split()))
INF = 1e+10
def f(x):
    if x == 1:
        return 2
    if x == 2:
        return 5
    if x == 3:
        return 5
    if x == 4:
        return 4
    if x == 5:
        return 5
    if x == 6:
        return 6
    if x == 7:
        return 3
    if x == 8:
        return 7 
    if x == 9:
        return 6

A.sort(reverse=True)

dp=[-INF]*(N+1)
dp[0] = 0
for i in range(1,N+1):
    for j in range(M):
        if i-f(A[j]) >= 0:
            dp[i] = max(dp[i],dp[i-f(A[j])]+1)
 
ans = ""
remain = dp[N]
match = N

while match > 0:
    for i in range(M):
        if dp[match - f(A[i])] == remain - 1:
            ans += str(A[i])
            match -= f(A[i])
            remain -= 1
            break
            
print(ans)



### FIXED CODE ###

import sys
input = sys.stdin.readline

#import fractions #fractions.gcd() python~3.4
sys.setrecursionlimit(1000000)

N, M = map(int,input().split())
A = list(map(int, input().split()))
INF = 1e+10
def f(x):
    if x == 1:
        return 2
    if x == 2:
        return 5
    if x == 3:
        return 5
    if x == 4:
        return 4
    if x == 5:
        return 5
    if x == 6:
        return 6
    if x == 7:
        return 3
    if x == 8:
        return 7 
    if x == 9:
        return 6

A.sort(reverse=True)

dp=[-INF]*(N+1)
dp[0] = 0
for i in range(1,N+1):
    for j in range(M):
        if i-f(A[j]) >= 0:
            dp[i] = max(dp[i],dp[i-f(A[j])]+1)
 
ans = ""
remain = dp[N]
match = N

while match > 0:
    for i in range(M):
        if match - f(A[i]) >=0 and dp[match - f(A[i])] == remain - 1:
            ans += str(A[i])
            match -= f(A[i])
            remain -= 1
            
            break
            
print(ans)
N,M = map(int,input().split())
a = [tuple(map(int, input().split())) for _ in range(N-1)]
b = [list(map(int, input().split())) for _ in range(M)]
ans=[0]*N
results = {}
for word in a:
    results.setdefault(word[0], []).append(word[1])

# neを根とする部分木にxを足す
def hukasa(ne,x):
    global ans
    global results
    ans[ne -1] += x
    if ne in results:
        for i in results[ne]:
            hukasa(i,x)


for i in b:
    hukasa(i[0],i[1])

for i in ans:
    print(i, end=" ")

### FIXED CODE ###

import sys
sys.setrecursionlimit(500000) 
input=sys.stdin.readline

N,M = map(int,input().split())
ans=[0]*N
a = [list(map(int, input().split())) for _ in range(N-1)]

for _ in range(M):
    e,f = list(map(int, input().split()))
    ans[e-1] += f

trees = {}
for word in a:
    trees.setdefault(word[0], []).append(word[1])
    trees.setdefault(word[1], []).append(word[0])
    

def sumup(ne,parent):
    global ans
    if ne in trees:    
        for k in trees[ne]:
            if k != parent:
                ans[k-1] += ans[ne-1]
                sumup(k,ne)

sumup(1,0)
for i in ans:
    print(i)
def fact(n, k):
  r1 = 1
  r2 = 1
  for i in range(0, k):
      r1 *= (n - i)
      r2 *= (i + 1)
  r = r1/r2
  return r

N,K = (int(x) for x in input().split())
R = N - K
mod = 1000000007

for i in range(1,K+1):
  tmp1 = fact(R+1, i)%mod
  tmp2 = fact(K-1, i-1)%mod
  ans = tmp1*tmp2%mod
  print(int(ans))


### FIXED CODE ###

import math
N,K = (int(x) for x in input().split())
R = N - K
mod = 10**9 + 7

def fact(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1,K+1):
  if N - K + 1 < i:
    ans = 0
  else:
    ans = fact(R+1, i)*fact(K-1,i-1)
  print(int(ans)%mod)
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 出力
print("{}".format( -( (1-b)//(a-1) ) )

### FIXED CODE ###

# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())
x = ((1-b)//(a-1))
# 出力
print("{}".format(-x))
a, b, x = map(int, input().split())
ans = b//x - a//x
if a%x == 0:
  ans += 1
print(ans)

### FIXED CODE ###

s = input().split()
c = [t[0] for t in s]
print("".join(c))
s = input()
k = int(input())
if(s[k-1] == '1'):
    print(1)
    exit()
for i in s:
    if(i != '1'):
        print(i)
        exit()


### FIXED CODE ###

s = input()
k = int(input())
if(k-1 < len(s)):
    for i in range(k):
        if(s[i] != '1'):break
    else:
        print(1)
        exit()
for i in s:
    if(i != '1'):
        print(i)
        exit()
import numpy as np
n = int(input())
A_1 = np.zeros((4,4), dtype='int64')
A_2 = np.ones((4,4), dtype='int64')
B = np.ones((4,4), dtype='int64')
for _ in range(n-2):
    A_3 = (B@A_2).T
    A_3 %= 10**9+7
    A_3[2,1] -= A_2[0,2]+A_1[0,2]+A_1[0,3]
    A_3[1,2] -= A_2[0,1]
    A_3[0,1] -= A_2[2,0]
    A_3[3,1] -= A_1[0,2]
    A_1, A_2 = A_2, A_3
print(np.sum(A_3)%(10**9+7))

### FIXED CODE ###

import numpy as np
n = int(input())
A_1 = np.zeros((4,4), dtype='int64')
A_2 = np.ones((4,4), dtype='int64')
B = np.ones((4,4), dtype='int64')
for _ in range(n-2):
    A_3 = np.dot(B, A_2).T
    A_3 %= 10**9+7
    A_3[2,1] -= A_2[0,2]+A_1[0,2]+A_1[0,3]
    A_3[1,2] -= A_2[0,1]
    A_3[0,1] -= A_2[2,0]
    A_3[3,1] -= A_1[0,2]
    A_1, A_2 = A_2, A_3
print(np.sum(A_3)%(10**9+7))
S = input()


found = False
pprev, prev = S[0],S[1]
t = {pprev, prev}

for i in range(2,len(S)):
    t.add(S[i])
    if len(t) == 2:
        print(i - 1, i + 1)
        found = True
    else:
        t.remove(pprev)
    pprev = prev
    prev = S[i]
    t = {pprev, prev}
    if found:
        break
    
if not found:
    print(-1, -1)

### FIXED CODE ###

n = int(input())
L = [int(_) for _ in input().split()]
L.sort()
total = 100000000000000000
num = 0
if L[0] == L[-1]:
    print(0)
else:
    for l in range(L[0], L[-1]):
        tot = 0
        for j in range(n):
            tot += abs(L[j] - l)**2
        if tot < total:
            num = l
            total = tot
            
    print(total)
inputs = map(int, input().split())

results = []
for i in (0, 1):
  for j in (2, 3):
    results.append(inputs[i] * inputs[j])

print(max(results))


### FIXED CODE ###

inputs = [int(d) for d in input().split()]

results = []
for i in (0, 1):
  for j in (2, 3):
    results.append(inputs[i] * inputs[j])

print(max(results))