Harryxun/stf_run huggingface dataset:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return map(int, sys.stdin.readline().split())
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())


def FLIST(n):
    res = [1]
    for i in range(1, n+1):
        res.append(res[i-1]*i % DVSR)
    return res


N = II()
ST = input()
ST = ST[::-1]

# NUM1 =
# NUM2 =
popcnt = 0

for i in range(N):
    popcnt += ST[i] == '1'

NUM1 = 0
NUM2 = 0
pop_1 = popcnt-1
pop_2 = popcnt+1
for i in range(N):
    if ST[i] == '1':
        if pop_1 >= 0:
            NUM1 += pow(2, i, pop_1)
            NUM1 %= pop_1
        if pop_2 <= N:
            NUM2 += pow(2, i, pop_2)
            NUM2 %= pop_2

# print(pop_1, pop_2)
# print(NUM1, NUM2)

for i in range(N):
    cnt = 1
    i = N-i-1
    if ST[i] == '1':
        # print("A")
        value = NUM1 - pow(2, i, pop_1)
        value %= pop_1
        while value:
            value %= bin(value).count("1")
            cnt += 1
        print(cnt)
    else:
        # print("B")
        value = NUM2 + pow(2, i, pop_2)
        value %= pop_2
        while value:
            value %= bin(value).count("1")
            cnt += 1
        print(cnt)


### FIXED CODE ###

import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return map(int, sys.stdin.readline().split())
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())


def FLIST(n):
    res = [1]
    for i in range(1, n+1):
        res.append(res[i-1]*i % DVSR)
    return res


N = II()
ST = input()
ST = ST[::-1]

# NUM1 =
# NUM2 =
popcnt = 0

for i in range(N):
    popcnt += ST[i] == '1'

NUM1 = 0
NUM2 = 0
pop_1 = popcnt-1
pop_2 = popcnt+1
for i in range(N):
    if ST[i] == '1':
        if pop_1 > 0:
            NUM1 += pow(2, i, pop_1)
            NUM1 %= pop_1
        if pop_2 <= N:
            NUM2 += pow(2, i, pop_2)
            NUM2 %= pop_2

# print(pop_1, pop_2)
# print(NUM1, NUM2)

for i in range(N):
    cnt = 1
    i = N-i-1
    if ST[i] == '1':
        # print("A")
        if pop_1 != 0:
            value = NUM1 - pow(2, i, pop_1)
            value %= pop_1
            while value:
                value %= bin(value).count("1")
                cnt += 1
            print(cnt)
        else:
            print(0)
    else:
        # print("B")
        value = NUM2 + pow(2, i, pop_2)
        value %= pop_2
        while value:
            value %= bin(value).count("1")
            cnt += 1
        print(cnt)
import numpy as np
import functools
import math
import collections
import scipy
import fractions
import itertools

def solve():
  n = int(input())
  a = list(map(int, input().split()))
  b = collections.deque()
  for i in range(n):
    if i % 2 == n % 2:
      b.append(a[i])
    else:
      b.insert(0,a[i])
  b = map(str, b)
  print(" ".join(b))
  return 0
 
if __name__ == "__main__":
  solve()


### FIXED CODE ###

import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    deq = collections.deque()
    for i in range(n):
        if i % 2 == 0:
            deq.append(str(a[i]))
        else:
            deq.appendleft(str(a[i]))
    if n % 2 == 1:
        deq.reverse()
    print(" ".join(deq))
    return 0

if __name__ == "__main__":
    solve()
import numpy
N,K=map(int,input().split())
A=list(map(int,input().split()))
S=[0]+list(numpy.cumsum(A)) #累積和
S2=[(S[i]-i)%K for i in range(N+1)]

d = {}
ans = 0
for j in range(1,N+1):
    if j>K-1:
        d[str(S2[j-K])] = d.get(str(S2[j-K]), 0) - 1
    d[str(S2[j-1])] = d.get(str(S2[j-1]), 0) + 1
    ans += d.get(str(S2[j]), 0)
print(ans)

### FIXED CODE ###

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

if K==1:
    print(0)
    exit(0)

A=list(map(int,input().split()))
S=[0]+list(numpy.cumsum(A)) #累積和
S2=[(S[i]-i)%K for i in range(N+1)]

d = {}
ans = 0
for j in range(1,N+1):
    if j>K-1:
        if S2[j-K] in d:
            d[S2[j-K]] -= 1
        
    if S2[j-1] in d:
        d[S2[j-1]] += 1
    else:
        d[S2[j-1]] = 1
        
    if S2[j] in d:
        ans += d[S2[j]]
print(ans)
import sys
from collections import deque
l1 = list(map(int, input().split()))
N = l1[0]
M = l1[1]


per_dis = [ [] for n in range(N+1)]
people = [None] * (N+1)

for n in range(M):
    x = list(map(int, input().split()))
    per_dis[x[0]].append((x[1], x[2]))
    per_dis[x[1]].append((x[0], -x[2]))

if M != 0:
    visited = []
    unvisited = deque([(x[0], 0)])
    people[x[0]] = 0
    while unvisited:
        now = unvisited.popleft()
        for next in per_dis[now[0]]:
            if next[0] not in visited:
                people[next[0]] =  now[1] + next[1]
                unvisited.append((next[0], now[1] + next[1]))
                visited.append(now[0])

for i, x in enumerate(per_dis):
    if x != None:
        for y in x:
            if y[1] < 0:
                if people[y[0]] - people[i] != y[1]:
                    print("No")
                    sys.exit()
            else:
                if people[i] - people[y[0]] != -y[1]:
                    print("No")
                    sys.exit()


print("Yes")
                


### FIXED CODE ###

from collections import deque

def bfs(x, graph, people):
    if people[x] is not None:
        return
    unvisited = deque([x])
    people[x] = 0
    while unvisited:
        now = unvisited.popleft()
        for next, d in graph[now]:
            if people[next] is None:
                people[next] =  people[now] + d
                unvisited.append(next)

def main():
    N, M = list(map(int, input().split()))

    graph = [ [] for n in range(N+1)]
    people = [None] * (N+1)

    for n in range(M):
        L, R, D = list(map(int, input().split()))
        graph[L].append((R, D))
        graph[R].append((L, -D))
    for i in range(1, N+1):
        bfs(i, graph, people)

    for i in range(1, N+1):
        for j, d in graph[i]:
            if people[j] - people[i] != d:
                print("No")
                exit()
    else:
        print("Yes")


if __name__ == "__main__":
    main()
n = int(input())
li = list(map(int,input().split()))

ki = li[::2]
gu = li[1::2]

ki.sort()
gu.sort()

from itertools import groupby

ki_li = []
gu_li = []

for key, value in groupby(ki):
    ki_li.append((key,len(list(value))))

for key, value in groupby(gu):
    gu_li.append((key,len(list(value))))

ki_li.sort(key=lambda x:(x[1]*(-1)))
gu_li.sort(key=lambda x:(x[1]*(-1)))

if ki_li[0][0] == gu_li[0][0]:
    if ki_li[0][1] > gu_li[0][1]:
        if len(gu_li) >= 2:
            ans = n-ki_li[0][1]-gu_li[1][1]
        else:
            ans = n-ki_li[0][1]
    elif ki_li[0][1] == gu_li[0][1]:
        if ki_li[1][1] >= gu_li[1][1]:
            ans = n-gu_li[0][1]-ki_li[1][1]
        else:
            ans = n-ki_li[0][1]-gu_li[1][1]
    else:
        if len(ki_li) >= 2:
            ans = n-gu_li[0][1]-ki_li[1][1]
        else:
            ans = n-gu_li[0][1]
else:
    ans = n-gu_li[0][1]-ki_li[0][1]

print(ans)

### FIXED CODE ###

from sys import stdin
from itertools import groupby

n = int(stdin.readline().rstrip())

li = list(map(int,stdin.readline().rstrip().split()))

li1 = []
li2 = []

for i in range(n):
    if i % 2 == 0:
        li1.append(li[i])
    else:
        li2.append(li[i])

li1.sort()
li2.sort()

lin = []
lin2 = []

for key, value in groupby(li1):
    lin.append((key,len(list(value))))
for key, value in groupby(li2):
    lin2.append((key,len(list(value))))

lin.sort(key=lambda x:(x[1]))
lin2.sort(key=lambda x:(x[1]))

point = 0

if lin[-1][0] == lin2[-1][0] and lin[-1][1] == lin2[-1][1]:
    if len(lin) == 1:
        print(n//2)
    else:
        if lin[-2][1] >= lin2[-2][1]:
            print(n-lin[-2][1]-lin2[-1][1])
        else:
            print(n-lin[-1][1]-lin2[-2][1])

elif lin[-1][0] == lin2[-1][0]:
    if len(lin) == 1:
        print(n//2-lin2[-2][1])
    elif len(lin2) == 1:
        print(n//2-lin[-2][1])
    else:
        if lin[-2][1] >= lin2[-2][1]:
            print(n-lin[-1][1]-lin2[-2][1])
        else:
            print(n-lin[-2][1]-lin2[-1][1])
else:
    print(n-lin[-1][1]-lin2[-1][1])
N, M = list(map(int, input().split()))
G = {i:[] for i in range(N)}
for _ in range(M):
    x, y = list(map(int, input().split()))
    G[x-1].append(y-1)
    
dp = [-1]*N

# node iを起点とした時の有効パスの最大値
def rec(i):
    if dp[i] != -1:
        return dp[i]
    res = 0
    for v in G[i]:
        res = max(res, rec(v)+1)
    return res

ans = 0
for i in range(N):
    ans = max(ans, rec(i))
    
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5+100)

N, M = list(map(int, input().split()))
G = {i:[] for i in range(N)}
for _ in range(M):
    x, y = list(map(int, input().split()))
    G[x-1].append(y-1)
    
dp = [-1]*N
 
# node iを起点とした時の有効パスの最大値
def rec(i):
    if dp[i] != -1:
        return dp[i]
    res = 0
    for v in G[i]:
        res = max(res, rec(v)+1)
    dp[i] = res
    return res
 
ans = 0
for i in range(N):
    ans = max(ans, rec(i))
    
print(ans)
import sys
sys.setrecursionlimit(100000)

def m():
    def dfs(v, p, c, depth):
        depth[v] = c
        for child in graph[v]:
            if child == p:
                continue
            dfs(child, v, depth[v]+1, depth)
    n = int(input())
    graph = [[] for _ in range(n + 1)]
    depth_from1 = [0] * (n+1)
    depth_fromN = [0] * (n+1)
    depth_from1[1] = 0
    depth_fromN[n] = 0

    for _ in range(n-1):
        a, b = map(int, input().split())
        graph[a].append(b)
        graph[b].append(a)

    dfs(1, -1, 0, depth_from1)
    dfs(n, -1, 0, depth_fromN)
    fene = 0
    sn = 0

    for i in range(1,n+1):
        if depth_from1[i] <= depth_fromN[i]:
            fene += 1
        else:
            sn += 1
    if fene > sn:
        return "Fennec"
    else:
        return "Snuke"


print(m())

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

def m():
    def dfs(v, p, c, depth):
        depth[v] = c
        for child in graph[v]:
            if child == p:
                continue
            dfs(child, v, depth[v]+1, depth)
    n = int(input())
    graph = [[] for _ in range(n + 1)]
    depth_from1 = [0] * (n+1)
    depth_fromN = [0] * (n+1)
    depth_from1[1] = 0
    depth_fromN[n] = 0

    for _ in range(n-1):
        a, b = map(int, input().split())
        graph[a].append(b)
        graph[b].append(a)

    dfs(1, -1, 0, depth_from1)
    dfs(n, -1, 0, depth_fromN)
    fene = 0
    sn = 0

    for i in range(1,n+1):
        if depth_from1[i] <= depth_fromN[i]:
            fene += 1
        else:
            sn += 1
    if fene > sn:
        return "Fennec"
    else:
        return "Snuke"


print(m())
N, M = map(int, input().split())
c = [0] * M
A = map(int, input().split())

S = [0]
w = 0
for a in A:
    w += a
    S.append(w % M)

S.sort()
ans = 0
prev = S[0]
c = 1
for i in range(1, N+1):
    if S[i] != prev:
        prev = S[i]
        ans += c * (c - 1) // 2
        c = 1
    else:
        c += 1
ans += c * (c - 1) // 2
print(ans)


### FIXED CODE ###

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

S = [0]
w = 0
for a in A:
    w += a
    S.append(w % M)

S.sort()
ans = 0
prev = S[0]
c = 1
for i in range(1, N+1):
    if S[i] != prev:
        prev = S[i]
        ans += c * (c - 1) // 2
        c = 1
    else:
        c += 1
ans += c * (c - 1) // 2
print(ans)
n=int(input())
b=[int(x) for x in input().split()]
a=[0]*n
for i in range(n-1):
	if(i==0):
		a[0]=b[0]
		a[1]=b[1]
	if(b[i]>=b[i-1]):
		a[i+1]=b[i]
	if(b[i]<b[i-1]):		
		a[i]=b[i]
		a[i+1]=b[i]
print(sum(a))

### FIXED CODE ###

n=int(input())
b=[int(x) for x in input().split()]
a=[0]*n
for i in range(n-1):
	if(i==0):
		a[0]=b[0]
		a[1]=b[0]
	else:	
		if(b[i]>=b[i-1]):
			a[i+1]=b[i]
		if(b[i]<b[i-1]):		
			a[i]=b[i]
			a[i+1]=b[i]
print(sum(a))
m1, d1 = map(int, input().split(" "))
m2, d2 = map(int, input().split(" "))
print(1 if m2 = m1 + 1 else 0)

### FIXED CODE ###

m1, d1 = map(int, input().split(" "))
m2, d2 = map(int, input().split(" "))
print(1 if m2 == m1 + 1 else 0)
n = int(input())
for _ in range(n):
  print(sum(map(int, input().split())))n = int(input())
count = 0
for _ in range(n):
  s = [int(a) for a in input().split()]
  count += s[1] - (s[0]-1)
  
print(count)
  

### FIXED CODE ###

n = int(input())
count = 0
for _ in range(n):
  s = [int(a) for a in input().split()]
  count += s[1] - (s[0]-1)
  
print(count)
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = I()
print(A[K - 1])
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = I()
print(A[K - 1])


### FIXED CODE ###

# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = I()
print(A[K - 1])
N,M,C = map(int, input().split())
B = map(int, input().split())
A = []

for i in range(20):
	A.append(map(int, input().split()))

ans = 0

for i in range(N):
	tmp = 0
	for j in range(M):
		tmp = tmp + A[i][j]*B[j]
	if(tmp+C>0):
		ans += 1

print(ans)


### FIXED CODE ###

N,M,C = list(map(int, input().split()))
B = list(map(int, input().split()))
A = []

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

ans = 0

for i in range(N):
	tmp = 0
	for j in range(M):
		tmp = tmp + A[i][j]*B[j]
	if(tmp+C>0):
		ans += 1

print(ans)
N=int(input())

if N=1:
    print(1)
elif 2<=N<=3:
    print(2)
elif 4<=N<=7:
    print(4)
elif 8<=N<=15:
    print(8)
elif 16<=N<=31:
    print(16)
elif 32<=N<=64:
    print(32)
elif 64<=N<=100:
    print(64)

### FIXED CODE ###

N=int(input())

if N==1:
    print(1)
elif 2<=N<=3:
    print(2)
elif 4<=N<=7:
    print(4)
elif 8<=N<=15:
    print(8)
elif 16<=N<=31:
    print(16)
elif 32<=N<=63:
    print(32)
elif 64<=N<=100:
    print(64)
import sys
input = sys.stdin.readline

h, w, k = map(int, input().split())
s = []
for i in range(h):
    s.append(list(map(int, input())))

if h == 1:
    j = 0
    c = 0
    cnt = 0
    while j < w:
        c += s[j]
        if c > k:
            flag = True
        if flag:
            c = 0
            cnt += 1
            flag = False
            j -= 1
        j += 1
    print(w + cnt - 1)
    sys.exit()

ans = h + w - 2
for i in range(2**(h-1)):
    l = []
    tmp = s[0]
    for j in range(h-1):
        if i >> j & 1:
            tmp = [tmp[m] + s[j+1][m] for m in range(w)]
        else:
            l.append(tmp)
            tmp = s[j+1]
    l.append(tmp)
    c = [0] * len(l)
    cnt = 0
    flag = False
    j = 0
    while j < w:
        for m in range(len(l)):
            c[m] += l[m][j]
            if c[m] > k:
                flag = True
        if flag:
            c = [0] * len(l)
            cnt += 1
            flag = False
            j -= 1
        j += 1
    ans = min(ans, len(l) + cnt - 1)

print(ans)

### FIXED CODE ###

H, W, K = map(int, input().split())
S = [list(input()) for _ in range(H)]

res = float('inf')
for i in range(2**(H-1)):
    c = bin(i).count('1')
    cnt = c
    sum_l = [0] * (c+1)
    j = 0
    flag = True
    while j < W:
        tmp = sum_l.copy()
        pos = 0
        for k in range(H):
            if S[k][j] == '1':
                tmp[pos] += 1
            if (i >> k) & 1:
                pos += 1
        if max(tmp) <= K:
            sum_l = tmp.copy()
            j += 1
            flag = False
        else:
            if flag:
                cnt = float('inf')
                break
            cnt += 1
            flag = True
            sum_l = [0] * (c+1)

    res = min(res, cnt)

print(res)
print(int(({0} + {1} - 1)//2).format(input().split())

### FIXED CODE ###

a, b = map(int, input().split())
print((a + b + 1)//2)
n = int(input())
tt = list(map(int, input().split()))
m = int(input())
drinks = [list(map(int,input().split())) for _ in range(m)]

ans = sum(tt)
for i in range(m):
    print(ans - (tt[i] - drinks[i][1]))

### FIXED CODE ###

n = int(input())
tt = list(map(int, input().split()))
m = int(input())
drinks = [list(map(int,input().split())) for _ in range(m)]

ans = sum(tt)
for i in range(m):
    print(ans - (tt[drinks[i][0]-1] - drinks[i][1]))
job = list()
salary = list()
m_total = 0
j = 0
n,m = map(int,input().split())
for i in range(n):
    a,b = map(int,input().split())
    job.append((a,b))
    job.sort(reverse = True)
for i in range(n):
    a,b = job[i]
    salary.append(b)
    if a + j > m :
        salary.remove(min(salary))
        continue
    j += 1
print(sum(salary))


### FIXED CODE ###

a,b = map(int,input().split())
ab_list = list()
ab_list.append(a + b)
ab_list.append(a - b)
ab_list.append(a * b)
print(max(ab_list))
import itertools
L,R=map(int,input().split())
if R-L>=2019:
  print(0)
else:
  MIN=2018  
  list1=list(range(L,R+1))
  list2=list(itertools.combinations(list1,2))
  for i in range(len(list2)):
    a=list2[i][0]*list2[i][1]%2019
    MIN=min(MIN,a)
print(MIN)    

### FIXED CODE ###

import itertools
L,R=map(int,input().split())
if R-L>=2019:
  print(0)
else:
  MIN=2018  
  list1=list(range(L,R+1))
  list2=list(itertools.combinations(list1,2))
  for i in range(len(list2)):
    a=list2[i][0]*list2[i][1]%2019
    MIN=min(MIN,a)
  print(MIN)
x = int(input())
j = x.split()
a = j[0]
b = j[1]
print(max((a+b),(a-b),(a*b)))

### FIXED CODE ###

x = str(input())
j = x.split()
a = int(j[0])
b = int(j[1])
print(max((a+b),(a-b),(a*b)))
from collections import defaultdict
H, W = map(int, input().split())
s = [input() for _ in range(H)]
if H == 1 and W == 1:
    print('YES')
elif W==1:
    print('NO')
else:

    d_h = [[0 for i in range(28)] for _ in range(H)]
    d_w = [[0 for i in range(28)] for _ in range(W)]

    for i in range(H):
        for c in s[i]:
            d_h[i][ord(c) - ord("a")] += 1

    for i in range(H):
        for j in range(W):
            d_w[j][ord(s[i][j]) - ord("a")] += 1
    #
    # for i in range(H):
    #     d_h[i].sort()
    #     d_w[i].sort()

    check_h = []
    check_w = []

    for i in range(H):
        if i in check_h:
            continue
        for j in range(i + 1, H):
            if j in check_h:
                continue
            else:
                if d_h[i] == d_h[j]:
                    check_h.append(i)
                    check_h.append(j)
                    break

    for i in range(W):
        if i in check_w:
            continue
        for j in range(i + 1, W):
            if j in check_w:
                continue
            else:
                if d_w[i] == d_w[j]:
                    check_w.append(i)
                    check_w.append(j)
                    break

    c_w = 0
    c_h = 0

    for i in range(H):
        if i in check_h:
            c_h += 1
    for i in range(W):
        if i in check_w:
            c_w += 1

    if c_h >= H - 1 and c_w >= W - 1:

        print('YES')
    else:
        print('NO')


### FIXED CODE ###


n = int(input())
x = list(map(int, input().split()))
x_sort = x.copy()
x_sort.sort()
row = x_sort[n//2 - 1]
high = x_sort[n//2]

for i in range(n):
    if x[i] <= row:
        print(high)
    else:
        print(row)
import sys
INPUT = sys.stdin.readline

def SINGLE_INT(): return int(INPUT())
def MULTIPLE_INT_LIST(): return list(map(int, INPUT().split()))
def MULTIPLE_INT_MAP(): return map(int, INPUT().split())
def SINGLE_STRING(): return INPUT()
def MULTIPLE_STRING(): return INPUT().split()

N, K = MULTIPLE_INT_MAP()
trees = [int(input()) for _ in range(N)]
trees.sort()
ans = float('inf')

# for i in range(0, N-K+1):
#     ans = min(ans, trees[i+K-1] - trees[i])
#     if ans == 0:
#         break

# print(ans)

print(min(trees[i+K-1]-trees[i] for i in range(N-K+1)))

### FIXED CODE ###

D = int(input())

s = 'Christmas'

for _ in range(25-D):
    s += ' Eve'

print(s)
from scipy.misc import comb
from math import factorial
import collections

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

COUNTS = collections.Counter(BALLS)


MEMO = {}
def fact(n):
    if MEMO.get(n):
        return MEMO[n]
    r = 2
    if n - r < 0:
        return 0
    MEMO[n] = int(comb(n, r))
    return MEMO[n]

MEMO2 = {}
def solve(n):
    if MEMO2.get(n):
        return MEMO2[n]

    MEMO2[n] = sum(fact(v if k != n else v - 1) for (k, v) in COUNTS.items())
    return MEMO2[n]

for i in range(N):
    print(solve(BALLS[i]))

### FIXED CODE ###

from math import factorial
import collections

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

MEMO = {}
def fact(n):
    if MEMO.get(n):
        return MEMO[n]
    r = 2
    if n - r < 0:
        MEMO[n] = 0
        return 0
    MEMO[n] = factorial(n) // factorial(r) // factorial(n - r)
    return MEMO[n]

COUNTS = collections.Counter(BALLS)
TOTAL = sum(fact(n) for n in COUNTS.values())

MEMO2 = {}
def solve(n):
    if MEMO2.get(n):
        return MEMO2[n]

    MEMO2[n] = TOTAL - fact(COUNTS[n]) + fact(COUNTS[n] - 1)
    return MEMO2[n]

for i in range(N):
    print(solve(BALLS[i]))
import math

    a, b, h, m = map(int, input().split())
    h = h * 30
    m = m * 6
    degree = abs(h - m)
    if degree > 180:
        degree = 360 - degree
    print(float(math.sqrt(a*a + b*b - 2*a*b*math.cos(math.radians(degree)))))

### FIXED CODE ###

from math import *
a, b, h, m = map(int, input().split())
h = 30 * h + m / 2
m *= 6
d = (a * sin(radians(h))) - (b * sin(radians(m)))
e = (a * cos(radians(h))) - (b * cos(radians(m)))
print((d * d + e * e)**0.5)
n,m=map(int,input().split())
a=[0]*(n+1)
b=[int(input()) for i in range(m)]
a[0]=1
j=0
if b[0]==1:
  a[1]=0
  j=1
else:
  a[1]=1
for i in range(2,n+1):
  if i==b[j]:
    if j<m-1:
      j+=1
  else:
    a[i]=(a[i-1]+a[i-2])%(10**9+7)
print(a[n])

### FIXED CODE ###

n,m=map(int,input().split())
a=[0]*(n+1)
b=[int(input()) for i in range(m)]
a[0]=a[1]=1
if m==0:
  for i in range(2,n+1):
    a[i]=(a[i-1]+a[i-2])%(10**9+7)
else:
  j=0
  if b[0]==1:
    a[1]=0
    if m>1:
      j=1
  for i in range(2,n+1):
    if i==b[j]:
      if j<m-1:
        j+=1
    else:
      a[i]=(a[i-1]+a[i-2])%(10**9+7)
print(a[n])
X = int(input())
    if X in [7, 5, 3]:
      print ('YES')
    else:
      print ('NO')

### FIXED CODE ###

X = int(input())
if X in [5, 7, 3]:
  print ('YES')
else:
  print ('NO')
count = 0
for i range(int(input()) + 1):
  if i == 0:
    continue
  count += i
print(count)


### FIXED CODE ###

count = 0
for i in range(int(input()) + 1):
  if i == 0:
    continue
  count += i
print(count)