Harryxun/stf_run huggingface dataset:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  l1=[]
  l2=[]

  f=True
  for x in l:
    if f:
      f=False
      l1.append(x)
    else:
      f=True
      l2.append(x)

  l1.sort()
  l2.sort()

  l3=[]
  l4=[]

  a=l1[0]
  c=1
  for x in l1[1:]:
    if a==x:
      c+=1
    else:
      l3.append([a,c])
      a=x
      c=1
  l3.append([a,c])

  a=l2[0]
  c=1
  for x in l2[1:]:
    if a==x:
      c+=1
    else:
      l4.append([a,c])
      a=x
      c=1
  l4.append([a,c])

  l3=sorted(l3,key=lambda x:x[1],reverse=True)
  l4=sorted(l4,key=lambda x:x[1],reverse=True)

  print(l3)
  print(l4)

  if l3[0][0]==l4[0][0]:
    if len(l3)==1:
      return n-l3[0][1]-l4[1][1]
    elif len(l4)==1:
      return n-l3[1][1]-l4[0][1]
    else:
      return min(n-l3[0][1]-l4[1][1],n-l3[1][1]-l4[0][1])
  else:
    return n-l3[0][1]-l4[0][1]

print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=II()
  l=LI()

  l1=[]
  l2=[]

  for i in range(len(l)):
    if i%2==0:
      l1.append(l[i])
    else:
      l2.append(l[i])

  l1.sort()
  l2.sort()

  a1=[l1[0],1]
  a2=[0,0]
  b1=[l2[0],1]
  b2=[0,0]

  _a=l1[0]
  c1=1
  for x in l1[1:]:
    if _a==x:
      c1+=1
    else:
      if c1>a1[1]:
        if a1[0]!=l1[0]:
          a2[0]=a1[0]
          a2[1]=a1[1]
        a1[0]=_a
        a1[1]=c1
      elif c1>a2[1]:
        if a1[0]!=_a:
          a2[0]=_a
          a2[1]=c1
      _a=x
      c1=1
  if c1>a1[1]:
    if a1[0]!=l1[0]:
      a2[0]=a1[0]
      a2[1]=a1[1]
    a1[0]=_a
    a1[1]=c1
  elif c1>a2[1]:
    if a1[0]!=_a:
      a2[0]=_a
      a2[1]=c1

  _b=l2[0]
  c2=1
  for x in l2[1:]:
    if _b==x:
      c2+=1
    else:
      if c2>b1[1]:
        if b1[0]!=l2[0]:
          b2[0]=b1[0]
          b2[1]=b1[1]
        b1[0]=_b
        b1[1]=c2
      elif c2>b2[1]:
        if b1[0]!=_b:
          b2[0]=_b
          b2[1]=c2
      _b=x
      c2=1
  if c2>b1[1]:
    if b1[0]!=l2[0]:
      b2[0]=b1[0]
      b2[1]=b1[1]
    b1[0]=_b
    b1[1]=c2
  elif c2>b2[1]:
    if b1[0]!=_b:
      b2[0]=_b
      b2[1]=c2

  if a1[0]!=b1[0]:
    return len(l1)-a1[1]+len(l2)-b1[1]
  else:
    return min(len(l1)-a1[1]+len(l2)-b2[1],len(l1)-a2[1]+len(l2)-b1[1])

# main()
print(main())
if N > 1000:
    hasu = N - (N // 1000)*1000
else:
    hasu = N
    
print(1000-hasu)

### FIXED CODE ###

N = int(input())

if N % 1000 == 0:
    print(0)
else:
    hasu = N - (N // 1000)*1000
    print(1000-hasu)
N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[float('inf')]*(N+1)
dp[0]=0
for i in range(N-1):
    for j in range(1,K+1):
        if i+j>N-1:
            break
        else:
            dp[i+j]=min(dp[i+j],dp[i]+abs(h[i]-h[i+j]))
print(dp[N-1])

### FIXED CODE ###

N=int(input())
a=[0]*N
b=[0]*N
c=[0]*N
hpa=[0]*N
hpb=[0]*N
hpc=[0]*N
hp=[0]*N

for i in range(N):
    a[i],b[i],c[i]=map(int,input().split())

hpa[0]=a[0]
hpb[0]=b[0]
hpc[0]=c[0]
hp[0]=max(hpa[0],hpb[0],hpc[0])

for i in range(N-1):
    hpa[i+1]=max(hpb[i]+a[i+1],hpc[i]+a[i+1])
    hpb[i+1]=max(hpa[i]+b[i+1],hpc[i]+b[i+1])
    hpc[i+1]=max(hpa[i]+c[i+1],hpb[i]+c[i+1])
    hp[i+1]=max(hpa[i+1],hpb[i+1],hpc[i+1])

print(hp[-1])
n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
dp = [float('inf')] * n
dp[0] = 0

for i in range(1, n):
    tmp = float("inf")
    hi = h[i]
    for j in range(max(i - k, 0), i):
      	res = dp[j] + abs(hi - h[j])
        if tmp > res:
            tmp = res
    dp[i] = tmp

print(dp[n - 1])

### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    n = II()
    h = LI()
    dp = [0 for i in range(n)]
    dp[1] = abs(h[0] - h[1])
    for i in range(2,n):
        dp[i] = min(dp[i - 1] + abs(h[i - 1] - h[i]), dp[i - 2] + abs(h[i - 2] - h[i]))
    print(dp[n-1])
    return

#B
def B():
    n, K = LI()
    h = LI()
    dp = [float("INF") for i in range(n + K + 1)]
    dp[0] = 0
    for i in range(n):
        for k in range(1, K + 1):
            if i + k >= n:
                break
            dp[i + k] = min(dp[i + k], dp[i] + abs(h[i] - h[i + k]))
    print(dp[n-1])
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#I
def I():
    return 
#J

#K

#L

#M
#N
# O
# P
# Q
# R
# S
# T
# U
# V
# W
# X
# Y
# Z


#Solve
if __name__ == '__main__':
    B()
N = input()
N = float(N)
result = 4/N
 
def output2():
    for i in range(3500):
        for j in range(3500):
            h = float(i+1)
            n = float(j+1)
            
            sum_ = 1/h + 1/n
            
            sum2 = result - sum_
            
            if(sum2 <= 0):
                continue
            
            w =  1/sum2
            
            if(w == int(w)):
                return('{} {} {}'.format(int(h),int(n),int(w)))
 
print(output2())

### FIXED CODE ###

N = raw_input()
print(N.count('1'))
N, A, B = map(int, input().split())
    sa = B - A
    if sa % 2 == 0:
      print(int(sa/2))
    else:
      print(int(min(A -1,N -B) + 1 + (B- A -1)//2))

### FIXED CODE ###

N, A, B = map(int, input().split())
sa = B - A
if sa % 2 == 0:
   print(int(sa//2))
else:
   print(int(min(A -1,N -B) + 1 + (B- A)//2))
N, M =map(int, input().split())
sc=[list(map(int, input().split())) for _ in range(M)]
sc.sort(key=lambda x:x[0])

ans=0
for i in range(M):
    s1, c1 = sc[i]
    if s1>N:
        ans=-1
        break
    for j in range(i+1, M):
        s2, c2 = sc[j]
        if s1==s2 and c1!=c2:
            ans=-1
            break
if sc[0][0]==1 and sc[0][1]==0:
    ans=-1

if ans!=-1:
    ans_={1:1, 2:0, 3:0, 4:0, 5:0}
    for i in range(M):
        s, c = sc[i]
        ans_[s]=c
    for i in range(1, N+1):
        ans=ans*10+ans_[i]

print(ans)

### FIXED CODE ###

N, M =map(int, input().split())
sc=[list(map(int, input().split())) for _ in range(M)]
sc.sort(key=lambda x:x[0])

ans=0
for i in range(M):
    s1, c1 = sc[i]
    if s1>N:
        ans=-1
        break
    for j in range(i+1, M):
        s2, c2 = sc[j]
        if s1==s2 and c1!=c2:
            ans=-1
            break
if M>0 and N>1 and sc[0][0]==1 and sc[0][1]==0:
    ans=-1

if ans!=-1:
    ans_={1:1, 2:0, 3:0}
    for i in range(M):
        s, c = sc[i]
        ans_[s]=c
    for i in range(1, N+1):
        ans=ans*10+ans_[i]

if N==1 and M==0:
    ans=0

print(ans)
#coding:utf-8
n,k  = map(int,input().split())
ls_a  = list(map(int,input().split()))
target = int(k*(k+1)/2)
ls_target = []
i = 1
while(1):
    for j in range(i):
        temp = ls_a[j:(len(ls_a)-i+j+1)]
        ls_target.append(sum(temp))
    if i==n:
        break
    i+=1

def check(num):
    for i in range(100):
        if (num < 2**i):
            return i-1, 2**(i-1)
mx = sum(ls_target[0])
digit, mx_bin = check(mx)
ans = 0
for d in range(digit+1):
#    print (mx_bin)
#    print (ls_target)
    new_idx = []
    cnt = 0
    for idx,ls in enumerate(ls_target):
        if ls & mx_bin > 0:
            cnt += 1
            new_idx.append(idx)
    if cnt >= k:
        ls_target = [ls_target[i] for i in new_idx]
        ans += mx_bin
    mx_bin = int(mx_bin/2)
print (ans)

### FIXED CODE ###

#coding:utf-8
n,k  = map(int,input().split())
ls_a  = list(map(int,input().split()))
target = int(k*(k+1)/2)
ls_target = []
i = 1
while(1):
    for j in range(i):
        temp = ls_a[j:(len(ls_a)-i+j+1)]
        ls_target.append(sum(temp))
    if i==n:
        break
    i+=1

def check(num):
    for i in range(50):
        if (num < 2**i):
            return i-1, 2**(i-1)
mx = ls_target[0]
digit, mx_bin = check(mx)
ans = 0
for d in range(digit+1):
#    print (mx_bin)
#    print (ls_target)
    new_idx = []
    cnt = 0
    for idx,ls in enumerate(ls_target):
        if ls & mx_bin > 0:
            cnt += 1
            new_idx.append(idx)
    if cnt >= k:
        ls_target = [ls_target[i] for i in new_idx]
        ans += mx_bin
    mx_bin = int(mx_bin/2)
print (ans)
A = int(input())
if (A%4 == 3 or A%4 == 0 or A%7 == 4 or A%7== 0) and A != 3:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b = map(int,input().split())
c = a % b == 0
if c:
  print(0)
else:
  print(1)
n, k = map(int,input().split())
a = sorted(list(map(int,input().split())))
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7
N = 10**4
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
ans = 0
for i in range(n-k+1):
  ans += (a[n-1-i]-a[i])*cmb(n-1-i,k-1,mod)
  ans %=  mod
print(ans)

### FIXED CODE ###

n, k = map(int,input().split())
a = sorted(list(map(int,input().split())))
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7
N = 10**5
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
ans = 0
for i in range(n-k+1):
  ans += (a[n-1-i]-a[i])*cmb(n-1-i,k-1,mod)
  ans %=  mod
print(ans)
pi = 3.14159265359 
r = int(input()) 
area = pi*r*r 
length = 2*r*pi

print('{:.6f}'.format(area),'{:.6f}'.format(length))


### FIXED CODE ###

pi = 3.14159265359 
r = float(input()) 
area = r*r*pi 
length = 2*r*pi 

print('{:.6f}'.format(area),'{:.6f}'.format(length))
a, b = map(int, input().slice())
if a == 2 or b == 2:
    print('No')
else:
    print('Yes')


### FIXED CODE ###

a, b = map(int, input().split())
if a == 2 or b == 2:
    print('No')
else:
    print('Yes')
from collections import deque

n = int(input())
a = list(map(int,input().split()))

b = deque()
for i in range(n):
    b.append(a[i])
    b.reverse()

print(*b)

### FIXED CODE ###

a, b, c =  map(int, input().split())
ans = min(a+b, b+c, c+a)
print(ans)
n, m = map(int, input().split())
s = input()
out = [set() for _ in range(n)]
count = [[0, 0] for _ in range(n)]
def f(c):
    if c == 'A': return 0
    else: return 1
for _ in range(m):
    a, b = map(int, input().split())
    if a == b:
        count[a-1][f(s[a-1])] += 1
    elif b-1 not in out[a-1]:
        count[a-1][f(s[b-1])] += 1
        count[b-1][f(s[a-1])] += 1
    out[a-1].add(b-1)
    out[b-1].add(a-1)
elim = set()
def eliminate(x):
    elim.add(x)
    c = f(s[x])
    for node in out[x]:
        if node not in elim:
            count[node][c] -= 1
            if count[node][0] * count[node][1] == 0:
                eliminate(node)
for i in range(n):
    if i not in elim and count[i][0] * count[i][1] == 0:
        eliminate(i)
if len(elim) < n: print('Yes')
else: print('No')

### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
n, m = map(int, input().split())
s = input()
out = [set() for _ in range(n)]
count = [[0, 0] for _ in range(n)]
def f(c):
    if c == 'A': return 0
    else: return 1
for _ in range(m):
    a, b = map(int, input().split())
    if a == b:
        count[a-1][f(s[a-1])] += 1
    elif b-1 not in out[a-1]:
        count[a-1][f(s[b-1])] += 1
        count[b-1][f(s[a-1])] += 1
    out[a-1].add(b-1)
    out[b-1].add(a-1)
elim = set()
def eliminate(x):
    elim.add(x)
    c = f(s[x])
    for node in out[x]:
        if node not in elim:
            count[node][c] -= 1
            if count[node][0] * count[node][1] == 0:
                eliminate(node)
for i in range(n):
    if i not in elim and count[i][0] * count[i][1] == 0:
        eliminate(i)
if len(elim) < n: print('Yes')
else: print('No')
a,b = input().strip().split()
if (a * b) % 2 == 0:
  print("Even") 
else if (a * b) % 2 != 0::
  print("Odd")


### FIXED CODE ###

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

multi = a * b

if multi % 2 == 0:
    print("Even")
else:
    print("Odd")
A, B = list(map(int, input().split())

if A == B:
    print(1)    
elif A % 2 != B % 2:
    print("IMPOSSIBLE")
else:
    K = (A+B) // 2
    if abs(A-K) == abs(B-K):
        print(K)
    else:
        print("IMPOSSIBLE")

### FIXED CODE ###

ab = input().split()
A, B = int(ab[0]), int(ab[1])

if A == B:
    print(1)
elif A % 2 != B % 2:
    print("IMPOSSIBLE")
else:
    K = (A+B) // 2
    if abs(A-K) == abs(B-K):
        print(K)
    else:
        print("IMPOSSIBLE")
n, m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

flg = False
for i in range(n - m + 1):
    for j in range(n - m + 1):
        if a[i][j : j + m] == b[0]:
            for k in range(i + 1, i + m):
                if a[k][j : j + m] != b[k]:
                    break
            else:
                print("Yes")
                flg = True
                break
    if flg:
        break
else:
    print("No")

### FIXED CODE ###

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

d = n - m + 1
flg = False
for i in range(d):
    for j in range(d):
        if a[i][j : j + m] == b[0]:
            for k in range(1, m):
                if a[i + k][j : j + m] != b[k]:
                    break
            else:
                print("Yes")
                flg = True
                break
    if flg:
        break
else:
    print("No")
n, m = [ int(v) for v in input().split() ]
num_list = sorted([ -int(v) for v in input().split() ])

for i in range(m):
	a, b = [ int(v) for v in input().split() ]
	for j in range(a):
		heapq.heappush(num_list,-b)

ans = 0
for i in range(n):
	ans += heapq.heappop(num_list)

print(-ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

def swap(a):
    return ((a[1],a[0]))


n, m = [ int(v) for v in input().split() ]
num_list = [ (int(v), 1) for v in input().split() ]
change_list = [ swap([ int(v) for v in input().split() ]) for i in range(m) ]
total_list = sorted(num_list + change_list, reverse = True)

k = n
ans = 0

for i in total_list:

    j = min(i[1], k)
    k -= j
    ans += i[0] * j
    if k == 0:
        break
print(ans)
lst = dict({0: 1, 1: 1, 2: 2})
def calc(n):
    if (n in lst):
        return lst[n]
    else:
        lst[n] = calc(n-1) + calc(n-2)
        return lst[n]

N, M = [int(x) for x in input().split()]
a_list = [int(input()) for _ in range(M)]
span_list = [a_list[0]-1]
for i, a in enumerate(a_list[:-1]):
    if (a_list[i+1] - a) == 1:
        print(0)
        exit()
    else:
        span_list.append(a_list[i+1] - 2 - a)
span_list.append(N - a_list[-1] -1)
max_span = max(span_list)
for i in range(max_span+1):
    calc(i)
ans = 1
for span in span_list:
    ans = (ans * lst[span]) % (10**9+7)
print(ans)


### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10**7)
lst = dict({0: 1, 1: 1, 2: 2})
def calc(n):
    if (n in lst):
        return lst[n]
    else:
        lst[n] = calc(n-1) + calc(n-2)
        return lst[n]

N, M = [int(x) for x in input().split()]
if (M != 0):
    a_list = [int(input()) for _ in range(M)]
    span_list = [a_list[0]-1]
    for i, a in enumerate(a_list[:-1]):
        if (a_list[i+1] - a) == 1:
            print(0)
            exit()
        else:
            span_list.append(a_list[i+1] - 2 - a)
    span_list.append(N - a_list[-1] -1)
else:
    span_list = [N]
max_span = max(span_list)
for i in range(max_span+1):
    calc(i)
ans = 1
for span in span_list:
    ans = (ans * lst[span]) % (10**9+7)
print(ans)
N,M = map(int,input().split())
AB = [tuple(int(i) for i in input().split()) for j in range(N)]
AB.sort()
ans = 0
for i in range(N):
	a,b = AB[i]
	if M-b > 0:
		ans += a*b
		M -= b
    else:
		ans += M*b
		break
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
AB = [tuple(int(i) for i in input().split()) for j in range(N)]
AB.sort()
ans = 0
for i in range(N):
    a,b = AB[i]
    if M -b > 0:
        ans += a*b
        M -= b
    else:
        ans += M*a
        break
print(ans)
# coding: utf-8

N=input()
A=input()

print(int((N**2))-int(A))

### FIXED CODE ###

N=int(input())

print((N*N)-int(input()))
for j in sorted([[(s,-int(p),i+1) for s,p,i in enumerate(input().split())] for _ in range(int(input()))]):print(j[2])

### FIXED CODE ###

import sys
import bisect
from collections import defaultdict

ans=0
n=int(input())
a=[]
for i in range(n):
    #s,p=map(int,input().split())
    s,p=input().split()
    a.append((s,-int(p),i+1))
#a=[(1,int(i)) for i in input().split()]
a=sorted(a)

for i in range(n):
    print(a[i][2])
#include <bits/stdc++.h>
// #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>

using namespace std;
typedef long long ll;

#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,a,b) for(int i=(a);i<(b);i++)

template<class T> inline void chmin(T& a, T b) {if (a > b) a = b;}
template<class T> inline void chmax(T& a, T b) {if (a < b) a = b;}
const ll inf = 1LL<<60;

int main() {
  int n,k,high;cin>>n>>k;
  ll ans=inf;
  ll now=0;
  int color=0;

  vector<int> a(n);
  rep(i,n){
    cin>>a[i];
  }
  for(int i=0;i<(1<<n);i++){
    high=a[0];
    color=1;
    now=0;
    for(int j=1;j<n;j++){
      if(1 & (i>>j)){
        if(a[j]<=high){
          now+=high-a[j]+1;
          high=high+1;
          color+=1;
        }else{
          color+=1;
        }
      }else{
        if(high<a[j]){
          high=a[j];
          color+=1;
        }
      }
    }
    if(k<=color){
      ans=min(ans,now);
    }
  }
  cout<<ans<<endl;
}


### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = float("inf")
 
for i in range(2**n):
    highest = a[0]
    color = 1
    money = 0
    for j in range(1,n):
        if a[j] > highest:
            color += 1
            highest = a[j]
        elif (i>>j)&1:
            color += 1
            highest = highest + 1
            money += highest - a[j]
        
    if color >= k:
        ans = min(ans,money)
print(ans)
def isPrime(p):
	if p == 2: return 1
	if p < 2 or p&1 == 0: return 0
	return 1 if pow(2,p-1,p) == 1 else 0
	
n = int(raw_input())
print sum(isPrime(int(i) for i in range(1,n+1))

### FIXED CODE ###

import math
n = []
while True:
    try:
        n.append(int(raw_input()))
    except:
        break
  
r = max(n)+1
sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
p[3::2] = [0 for x in range(3,r,2)]
for i in range(2,sqrt,2):
    if p[i]:
        p[2*i+1::i+1] = [0 for x in range(2*i+1,r,i+1)] 
  
for i in n:
     print sum(p[:i])
n, k=map(int, input().split())

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


def blue_pattern(ball, pat):
    if pat == 1:
        return 1
    return pat

def out(num):
    print(num%1000000007)

for i in range(1, k+1):
    out(cmb(n-k+1,i)*cmb(k-1, i-1))



### FIXED CODE ###

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

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


def out(num):
    print(num%1000000007)

for i in range(1, k+1):
    if n-k+1 < i:
        print("0")
    else:
        out(cmb(n-k+1,i)*cmb(k-1, i-1))
N = int(intput())
x = int(input())
T = int(input())

print(str(T*floor(N/x)))

### FIXED CODE ###

import math

N, x, T = map(int, input().split())

print(math.ceil(N / x) * T)
a,b,n = map(int,input().split()) 

ans=[]

for i in range(B):
    
    ans.append(int(a*i/b) - a * int(i/b))

print(max(ans))

### FIXED CODE ###

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

x=min(n,b-1)

ans = (int(a*x/b) - a * int(x/b))

print(ans)
import sys
import numpy as np
from operator import mul
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

d = int(readline())
c = list(map(int, readline().split()))
s = []
for _ in range(d):
    add = list(map(int, readline().split()))
    s.append(add)

#t = [0] * d
day = 0
satisfy = 0
sumC = sum(c)
count = np.zeros(26)

for i in range(d):
    t = int(readline()) - 1
    up = s[day][t]
    count += 1
    count[t] = 0
    sub = map(mul, count, c)
    satisfy += (up - sum(sub))

    # satisfy
    print(satisfy)


### FIXED CODE ###

import sys
import numpy as np
from operator import mul
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

d = int(readline())
c = list(map(int, readline().split()))
s = []
for _ in range(d):
    add = list(map(int, readline().split()))
    s.append(add)

#t = [0] * d
day = 0
satisfy = 0
sumC = sum(c)
count = np.zeros(26)

for i in range(d):
    #t = int(readline()) - 1
    tarLis = s[day]
    tar = max(tarLis)
    t = tarLis.index(tar) + 1
    print(t)
    day += 1
    '''
    up = s[day][t]
    count += 1
    count[t] = 0
    sub = map(mul, count, c)
    satisfy += (up - sum(sub))

    # satisfy
    print(satisfy)
    '''
n = int(input())
a = list(map(int, input().split()))

ans = 0
if a[0] > 0:
    op = "+"
elif a[0] < 0:
    op = "-"
elif a[0] == 0:
    ans += 1
    if a[1] > 0:
        a[0] = -1
    else:
        a[0] = 1

total = a[0]
for i in range(1, n):
    if (total+a[i]) >= 0 and op == "+":
        ans += abs((-1 - total) - a[i])
        total = -1
        op = "-"
    elif (total+a[i]) < 0 and op == "-":
        ans += abs((1 - total) - a[i])
        total = 1
        op = "+"
    elif total+a[i] == 0:
        ans += 1
        if a[1] > 0:
            a[0] = -1
        else:
            a[0] = 1
    else:
        total += a[i]
        if op == "+":
            op = "-"
        else:
            op = "+"
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))


def check(op):  # 最初の数の正負を引数とする
    total = 0
    ans = 0
    for i in range(0, n):
        if (total+a[i]) > 0 and op == "+":
            ans += abs(-1 - (total + a[i]))
            total = -1
            op = "-"
        elif (total+a[i]) < 0 and op == "-":
            ans += abs(1 - (total + a[i]))
            total = 1
            op = "+"
        elif total+a[i] == 0:
            ans += 1
            if op == "+":
                total = -1
                op = "-"
            else:
                total = 1
                op = "+"
        else:
            total += a[i]
            if op == "+":
                op = "-"
            else:
                op = "+"
    return ans


print(min(check("+"), check("-")))
X = input()
a = 2000 / X
if a >= 2000/599:
  print(8)
elif a >= 2000/799:
  print(7)
elif a >= 2000/999:
  print(6)
elif a >= 2000/1199:
  print(5)
elif a >= 2000/1399:
  print(4)
elif a >= 2000/1599:
  print(3)
elif a >= 2000/1799:
  print(2)
elif a >= 2000/1999:
  print(1)

### FIXED CODE ###

X = int(input())

a = 1999/X

if a >= 1999/599:
  print(8)
elif a >= 1999/799:
  print(7)
elif a >= 1999/999:
  print(6)
elif a >= 1999/1199:
  print(5)
elif a >= 1999/1399:
  print(4)
elif a >= 1999/1599:
  print(3)
elif a >= 1999/1799:
  print(2)
elif a >= 1999/1999:
  print(1)