Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python
# coding: utf-8
#

import copy

            
    
def main(n, k, l):
    cost_l = []

    if k == 0:
        print(0)
        return
    
    if k == 1:
        t = [abs(l[i]) for i in range(len(l)) ]
        print(min(t))
        return
    
    for i in range(n - k):
        mae = i
        ato = i + k - 1
        if l[mae] * l[ato] < 0:
            cost_l.append(min(- l[mae] * 2 + l[ato], - l[mae] + l[ato] * 2))
        elif l[mae] >= 0:
            cost_l.append(l[ato])
        elif l[ato] <= 0:
            cost_l.append(-l[mae])
            
    print(min(cost_l))

    
    
if __name__ == '__main__':
    try:
        n, k = list(map(int,input().strip().split(" ")))
        l = list(map(int,input().strip().split(" ")))
        main(n, k, l)
    except EOFError:
        pass


### FIXED CODE ###

#!/usr/bin/env python
# coding: utf-8
#

import copy

            
    
def main(n, k, l):
    cost_l = []

    if k == 0:
        print(0)
        return
    
    if k == 1:
        t = [abs(l[i]) for i in range(len(l)) ]
        print(min(t))
        return
    
    for i in range(n - k + 1):
        mae = i
        ato = i + k - 1
        if l[mae] * l[ato] < 0:
            cost_l.append(min(- l[mae] * 2 + l[ato], - l[mae] + l[ato] * 2))
        elif l[mae] >= 0:
            cost_l.append(l[ato])
        elif l[ato] <= 0:
            cost_l.append(-l[mae])
            
    print(min(cost_l))

    
    
if __name__ == '__main__':
    try:
        n, k = list(map(int,input().strip().split(" ")))
        l = list(map(int,input().strip().split(" ")))
        main(n, k, l)
    except EOFError:
        pass
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
num = 1
for i in range(1,N+1):
  if a[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
num = 1
for i in range(N):
  if A[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)
s = input()
t = input()


for i in range 3:
  if s[i] == t[i]:
    count += 1
    print(count)

### FIXED CODE ###

s = input()
t = input()
count = 0

for i in range(3):
  if s[i] == t[i]:
    count += 1

print(count)
import sys
import heapq  # heapqライブラリのimport

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N, C = rl()
STC = [[] for _ in range(C+1)]

for _ in range(N):
    s, t, c = rl()
    STC[c].append((s, t))

for i in range(1, C+1):
    stc = STC[i]
    if len(stc) > 1:
        for j in range(1, len(stc)):
            if stc[j][0] == stc[j-1][1]:
                stc[j] = (stc[j-1][0], stc[j][1])
                stc.pop(j-1)
        STC[i] = stc

program = []
for stc_list in STC:
    for s, t in stc_list:
        program.append((s, t))

program.sort()

recorder = [-1]
heapq.heapify(recorder)

for s, t in program:
    if s-0.5 > recorder[0]:
        heapq.heappop(recorder)
    heapq.heappush(recorder, t)

print(len(recorder))


### FIXED CODE ###

import sys
import heapq  # heapqライブラリのimport

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N, C = rl()
STC = [[] for _ in range(C+1)]

for _ in range(N):
    s, t, c = rl()
    STC[c].append((s, t))

for i in range(1, C+1):
    stc = STC[i]
    stc.sort()
    p = []
    for j in range(1, len(stc)):
        if stc[j][0] == stc[j-1][1]:
            stc[j] = (stc[j-1][0], stc[j][1])
            p.append(j-1)
    for x in p[::-1]:
        stc.pop(x)
    STC[i] = stc

program = []
for stc_list in STC:
    for s, t in stc_list:
        program.append((s, t))

program.sort()

recorder = [-1]
heapq.heapify(recorder)

for s, t in program:
    if s-0.5 > recorder[0]:
        heapq.heappop(recorder)
    heapq.heappush(recorder, t)

print(len(recorder))
def areDistinct(arr) : 
  
    n = len(arr) 
  
    s = set() 
    for i in range(0, n):  
        s.add(arr[i]) 
      

    return (len(s) == len(arr)) 
  

N = int(input())
S =  [int(x) for x in input().split()]
  
if (areDistinct(S)):  
    print("YES") 
  
else :  
    print("NO")

### FIXED CODE ###

S = input()
print('x'*len(S))
import numpy as np

N,M=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(N)]
A.sort()

A = np.array(A)

cnt = 0
for day in range(1,M+1):
    B = A[A[:,0]<=day,1]
    if B.size > 0:
        index = np.argmax(B)
        cnt += B[index]
        A = np.delete(A,index,0)
print(cnt)


### FIXED CODE ###

from heapq import*
(N,M),*t=[map(int,s.split())for s in open(0)]
q=[0]*10**5
v=[[]for _ in q]
z=0
for a,b in t:v[a-1]+=[b]
for i in v[:M]:
	for j in i:heappush(q,-j)
	z-=heappop(q)
print(z)
def cns(ls,m,sm):
    global n, s
    count = 0
    if m == n:
        if sm == s: return 1
        else      : return 0
    elif s-mx(9-m)-1 <= sm and sm <= s:
        for i in range(9-m+1):
            rls = ls[:]
            k = rls.pop(i)
            count += cns(rls,m+1,sm+(m+1)*k)
        return count
    else: return 0

def mx(i):
    if i == 0: return 0
    else     : return (i+1)*i + mx(i-1)

ls = [0,1,2,3,4,5,6,7,8,9]
while True:
    n, s = map(int, raw_input().split())
    if s > mx(n): print 0
    else        : print cns(ls,0,0)

### FIXED CODE ###

def mxmn(ls,m):
	global n
	s1,s2 = 0, 0
	for i in range(m):
		s1 += (n-i)*ls[-i-1]
		s2 += (n-i)*ls[i]
	return s1,s2

def f(ls,m,s):
	global n
	count = 0
	if m > 0:
		mx,mn = mxmn(ls,m)
		if mx < s or mn > s: return 0
		elif mx == s or mn == s: return 1
		for i in range(len(ls)):
			lls = ls[:]
			a = (n-m+1)*lls.pop(i)
			if s-a < 0:	break
			else: count += f(lls,m-1,s-a)
		return count
	else:
		return 1 if s == 0 else 0
			
ls = [i for i in range(10)]
while True:
	try:
		n,s = map(int, raw_input().split())
		print f(ls,n,s)
	except:
		break
n, m = map(int, input().split())
a = list(map(int, input().split()))

a.sort(reverse=True)
num_of_matches = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [-1] * (n+1)
dp[0] = 0
for i in range(1, n+1):
    val = -1
    for aa in a:
        if i - num_of_matches[aa] < 0:
            continue
        if i - num_of_matches[aa] == 0:
            val = 1
        elif dp[i - num_of_matches[aa]] > 0:
            val = max(val, dp[i - num_of_matches[aa]] + 1)
    dp[i] = val

res = ''
remain = dp[n]
match = n
while match > 0:
    for i in range(m):
        if remain - 1 == dp[match-num_of_matches[a[i]]] and match - num_of_matches[a[i]] >= 0:
            match -= num_of_matches[a[i]]
            remain -= 1
            res += str(a[i])
            break
print(res)


### FIXED CODE ###

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

a.sort(reverse=True)
num_of_matches = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [-1] * (n+1)
dp[0] = 0
for i in range(1, n+1):
    val = -1
    for aa in a:
        if i - num_of_matches[aa] < 0:
            continue
        if i - num_of_matches[aa] == 0:
            val = 1
        elif dp[i - num_of_matches[aa]] > 0:
            val = max(val, dp[i - num_of_matches[aa]] + 1)
    dp[i] = val

res = ''
remain = dp[n]
match = n
while match > 0:
    for i in range(m):
        if match - num_of_matches[a[i]] >= 0 and remain - 1 == dp[match-num_of_matches[a[i]]]:
            match -= num_of_matches[a[i]]
            remain -= 1
            res += str(a[i])
            break
print(res)
import numpy as np

def select():
    max_=0
    index=0
    for i in X:
        temp=min(abs(a-i))+i
        if temp>max_:
            max_=temp
            index=i
    return index

def walk(a,X,ans):
    min_=float('inf')
    x=0
    ppp=0
    for i in X:
        p=abs(a-i)
        dis_min_index=np.argmin(p)
        temp=p[dis_min_index]
        if temp<min_:
            ppp=dis_min_index
            min_=temp
            x=i
    if a[ppp]>x:
        a[ppp]-=min_
    else:
        a[ppp]+=min_
    ans+=min_
    X.remove(x)
    return ans,X

N,M=list(map(int,input().split()))
X=sorted(list(map(int,input().split())))
if N==1:
    print(X[-1]-X[0])  
elif N>=M:
    print(0)
else:
    a=np.array([X[0],X[-1]])
    ans=0
    for i in range(N-2):
        a=np.append(a,select())
    for i in a:
        X.remove(i)
    while(X!=[]):
        ans,X=walk(a,X,ans)
    print(ans) 

### FIXED CODE ###

import numpy as np
N,M=list(map(int,input().split()))
X=np.sort(np.array(list(map(int,input().split()))))

if N>=M:
    print(0)
else:
    L=np.sort(np.diff(X))
    ans=X[-1]-X[0]
    for i in range(1,N):
        ans-=L[-i]
    print(ans)
S=input()
K=int(input())
count=0
if S[0] == S[-1]:
  count+= (K-1)  
if S[-1]==S[-2]:
  count+=1
A=[]
D=1
for i in range(len(S)-2):
  if S[i]==S[i+1]:
    D+=1
  else:
    A.append(D)
    D=1
A.append(D)
B=[i for i in A if not i==1]
C=[(i//2) for i in B]

print(sum(C)*K+count)  

### FIXED CODE ###

S=input()
K=int(input())
T=S+S
if len(set(S))!=1:
  A=[]
  D=1
  for i in range(len(S)-1):
    if S[i]==S[i+1]:
      D+=1
    else:
      A.append(D)
      D=1
  A.append(D)
  B=[i for i in A if not i==1]
  C=[(i//2) for i in B]
  Scount=(sum(C))

  E=[]
  H=1
  for j in range(len(T)-1):
    if T[j]==T[j+1]:
      H+=1
    else:
      E.append(H)
      H=1
  E.append(H)
  F=[j for j in E if not j==1]
  G=[(j//2) for j in F]
  Tcount=(sum(G))
  ans=(Tcount-Scount)*(K-1)+Scount
  print(ans)
else:
  print(K*len(S)//2)
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
xy.sort()
deff_xy = []
memo = {}
for i in range(N-1):
    x = str(xy[i+1][0]-xy[i][0])
    y = str(xy[i+1][1]-xy[i][1])
    deff_xy = ('').join([x, y])
    if deff_xy in memo:
        memo[deff_xy] += 1
    else:
        memo[deff_xy] = 1
print(max(memo.values()))


### FIXED CODE ###

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
x, y = [], []
for i, j in xy:
    x += [i]
    y += [j]
ans = 0
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        p = x[j] - x[i]
        q = y[j] - y[i]
        c = 0
        for k in range(N):
            for l in range(N):
                if k == l:
                    continue
                if (x[k] - x[l]) == p and (y[k] - y[l]) == q:
                    c += 1
        ans = max(ans, c)
if N != 1:
    print(N-ans)
else:
    print('1')
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    S = int(input())
    MOD = 10 ** 9 + 7

    dp = [1] * (S + 1)
    dp[0] = 0
    dp[1] = 0
    dp[2] = 0

    for i in range(3, S + 1):
        for j in range(i - 3, 1, -1):
            dp[i] += dp[j]
            dp[i] %= MOD

    print(dp[S] % MOD)


if __name__ == '__main__':
    main()



### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    S = int(input())
    MOD = 10 ** 9 + 7

    if S <= 2:
        print(0)
        exit()

    dp = [1] * (S + 1)
    dp[0] = 0
    dp[1] = 0
    dp[2] = 0


    for i in range(3, S + 1):
        for j in range(i - 3, 1, -1):
            dp[i] += dp[j]
            dp[i] %= MOD

    print(dp[S] % MOD)


if __name__ == '__main__':
    main()
n = int(input())
p = list(map(int,input().split()))
ans = 0

flag = False
for i in range(n):
    if flag:
        flag = False
        continue
    if p[i] == i+1:
        if i < n+1 and p[i+1] == i+2:
            flag = True
        ans += 1

print(ans)


### FIXED CODE ###

n = int(input())
p = list(map(int,input().split()))
ans = 0

flag = False
for i in range(n):
    if flag:
        flag = False
        continue
    if p[i] == i+1:
        if i < n-1 and p[i+1] == i+2:
            flag = True
        ans += 1

print(ans)
N, M = [int(s) for s in input().split()]

def main():
    n = N
    m = M
    d = 1_000_000_007
    if abs(n - m) > 1:
        print(0)
        return
    n, m = (m, n) if n > m else (n, m)
    ans = 1
    for i in range(1, n + 1):
        ans *= i ** 2
        ans = ans % d
    last_n = 2 if n == m else m
    ans = ans * last_n % d
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

N, M = [int(s) for s in input().split()]

def main():
    n = N
    m = M
    d = 1000000007
    if abs(n - m) > 1:
        print(0)
        return
    n, m = (m, n) if n > m else (n, m)
    ans = 1
    for i in range(1, n + 1):
        ans *= i ** 2
        ans = ans % d
    last_n = 2 if n == m else m
    ans = ans * last_n % d
    print(ans)

if __name__ == '__main__':
    main()
def nCk(n, k):
    return bunshi(n,k)/bunbo(k)
def bunshi(n,k):
    p = 1
    for i in range(k):
        p = p*(n-i)
    return p
def bunbo(k):
    p = 1
    for i in range(k):
        p = p*(i+1)
    return p
    

N, M = map(int,input().split())
a=[-1]
for i in range(M):
    a.append(int(input()))
a.append(N+1)
#print(a)
D=[]
for i in range(M+1):
    D.append((a[i+1]-1)-(a[i]+1))
#print(D)

ans=1
for i in range(len(D)):
    temp = 0
    for j in range(D[i]//2+1):
        temp += (nCk(D[i]-j,j)%1000000007)
    ans=(ans%1000000007)*(temp%1000000007)
print(int(ans%1000000007))

### FIXED CODE ###

import math
N, M = map(int,input().split())
a = [int(input()) for i in range(M)]
b = [-1]+ a+ [N+1]
fib = [0,1]
for i in range(10**5):
    fib.append((fib[-1]+fib[-2])%1000000007)
ans = 1
for i in range(len(b)-1):
    ans= (ans*fib[b[i+1]-b[i]-1])%1000000007
print(ans)
s = input()

l = 0
r = len(s) - 1
answer = 0

while l != r:
    if s[l] == s[r]:
        l += 1
        r -= 1
    elif s[l] == 'x':
        l += 1
        answer += 1
    elif s[r] == 'x':
        r -= 1
        answer += 1
    else:
        print(-1)
        exit()

print(answer)

### FIXED CODE ###

s = input()

l = 0
r = len(s) - 1
answer = 0

while l < r:
    if s[l] == s[r]:
        l += 1
        r -= 1
    elif s[l] == 'x':
        l += 1
        answer += 1
    elif s[r] == 'x':
        r -= 1
        answer += 1
    else:
        print(-1)
        exit()

print(answer)
N=int(input())
s=[int(input()) for _ in range(N)]
M=int(input())
t=[int(input()) for _ in range(M)]
l=list(set(N))
print(max(0,max(s.count(l[i])-t.count(l[i]) for i in range len(l))))

### FIXED CODE ###

N=int(input())
s=[input() for _ in range(N)]
M=int(input())
t=[input() for _ in range(M)]
l=list(set(s))
print(max(0,max(s.count(l[i])-t.count(l[i]) for i in range(len(l)))))
o = list(input())
e = list(input())
for i in range(len(o)):
    print(o[i] + e[i], end="")


### FIXED CODE ###

o = list(input())
e = list(input()) + [""]
for i, j in zip(o, e):
    print(i + j, end="")
S = input()
K = int(input())

if len(S) == 1:
    print(0)
else:
    c = 0
    flg = False
    for i in range(len(S)-1):
        if S[i] == S[i+1] and flg is False:
            c += 1
            flg = True
        else:
            flg = False

    if flg is False and S[-1] == S[0]:
        j = 1
    else:
        j = 0

print(c*K+j*(K-1))
# print(c, j)


### FIXED CODE ###

S = input()
K = int(input())

if len(S) == 1:
    print(K//2)
elif len(set(S)) == 1:
    print(len(S)*K//2)
else:
    c = 0
    flg = False
    for i in range(len(S)-1):
        if S[i] == S[i+1] and flg is False:
            c += 1
            flg = True
        else:
            flg = False

    S2 = S*2
    d = 0
    flg = False
    for i in range(len(S2)-1):
        if S2[i] == S2[i+1] and flg is False:
            d += 1
            flg = True
        else:
            flg = False

    ar = 0
    if c*2 != d:
        ar = 1

    if ar == 1:
        print((c+1)*K-1)
    else:
        print(c*K)
if N[0] == "7" or N[1] == "7" or N[2] == "7":
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = input()
if N[0] == '7' or N[1] == '7' or N[2] == '7':
  print("Yes")
else:
  print("No")
a,b=map(Decimal,input().split())
print(int(a*b))

### FIXED CODE ###

from decimal import *
a,b=map(Decimal,input().split())
print(int(a*b))
from math import gcd
from collections import defaultdict
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return [a[0] for a in arr]

N = int(input())
A = sorted([int(i) for i in input().split()])
dict_A = defaultdict(int)
dep_flag = False
for a in A:
  dict_A[a] += 1
  if a != 1 and dict_A[a] >= 2:
    dep_flag=True
if dep_flag == False:  
  all_flag = True
  devisors = set()
  for n in range(N-1):
      if n == 0:
          g = gcd(A[n],A[n+1])
      else:
          g = gcd(A[n+1],g)
      temp = factorization(A[n])
      for t in temp:
          if t in devisors:
              all_flag=False
          else:
              devisors.add(t)
  if all_flag and g == 1:
      print('pairwise coprime')
  elif g==1:
      print('setwise coprime')
  else:
      print('not coprime')
else:
    print('not coprime')

### FIXED CODE ###

import sys
input = sys.stdin.readline
class UnionFind():
    def __init__(self, n):
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x
N,M = map(int,input().split())
uf = UnionFind(N)
for m in range(M):
    temp = [int(i)-1 for i in input().split()]
    uf.union(temp[0],temp[1])
print(-min(uf.parents))
import numpy as np
N, A = map(int, input().split())
x = list(map(int, input().split()))

X = max(x)
if X < A:
    X = A

def check(j, k, s):
    if dp[j][k][s] != -1:
        return dp[j][k][s]
    if j == 0 and k == 0 and s == 0:
        dp[j][k][s] = 1
        return 1
    if j >= 1 and s < x[j-1]:
        a = check(j-1, k ,s)
        dp[j][k][s] = a
        return a
    if j >= 1 and k >= 1 and s >= x[j-1]:
        a = check(j-1, k, s) + check(j-1, k-1, s-x[j-1])
        dp[j][k][s] = a
        return a
    dp[j][k][s] = 0
    return 0
        
dp = [[[-1] * (N*X+1) for _ in range(N+1)] for _ in range(N + 1)]
dp = np.array(dp)
# print (dp)
# for j in range(N+1):
#     for k in range(N+1):
#         for s in range(N*X + 1):
#             print (j, k, s)
#             dp[j][k][s] = check(j, k, s)

ans = 0
for k in range(1, N+1):
    ans += check(N, k, k * A)
    # ans += dp[N][k][k * A]

print (ans)

### FIXED CODE ###

N, A = map(int, input().split())
x = list(map(int, input().split()))

X = max(x)
if X < A:
    X = A

def check(j, k, s):
    if dp[j][k][s] != -1:
        return dp[j][k][s]
    if j == 0 and k == 0 and s == 0:
        dp[j][k][s] = 1
        return 1
    if j >= 1 and s < x[j-1]:
        a = check(j-1, k ,s)
        dp[j][k][s] = a
        return a
    if j >= 1 and k >= 1 and s >= x[j-1]:
        a = check(j-1, k, s) + check(j-1, k-1, s-x[j-1])
        dp[j][k][s] = a
        return a
    dp[j][k][s] = 0
    return 0
        
dp = [[[-1] * (N*X+1) for _ in range(N+1)] for _ in range(N + 1)]
# dp = np.array(dp)
# print (dp)
# for j in range(N+1):
#     for k in range(N+1):
#         for s in range(N*X + 1):
#             print (j, k, s)
#             dp[j][k][s] = check(j, k, s)

ans = 0
for k in range(1, N+1):
    ans += check(N, k, k * A)
    # ans += dp[N][k][k * A]

print (ans)
##C
n=input().int
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

### FIXED CODE ###

##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])
input()
if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

### FIXED CODE ###

S=input()
if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
a , b = map(int,input())
print((1900*b+(a-b)*100)*2**b)

### FIXED CODE ###

a , b = map(int,input().split())
print((1900*b+(a-b)*100)*2**b)
import numpy as np
N, M = map(int, input().split())
list_coStu = []
list_coChe = []
for i in range(N):
    list_coStu.append(list(map(int, input().split())))
for i in range(N):
    list_coChe.append(list(map(int, input().split())))

#calc distance

for iS in range(len(list_coStu)):
    coStu = np.array(list_coStu[iS])
    min_iC = 0
    d = 2 * 10**8 + 1
    for iC in range(len(list_coChe)):
        coChe = np.array(list_coChe[iC])
        dif = coChe - coStu
        dist = np.sum(np.abs(dif))
        if dist < d:
            min_iC = iC
            d = dist
    print(min_iC + 1)


### FIXED CODE ###

import numpy as np
N, M = map(int, input().split())
list_coStu = []
list_coChe = []
for i in range(N):
    list_coStu.append(list(map(int, input().split())))
for i in range(M):
    list_coChe.append(list(map(int, input().split())))

#calc distance

for iS in range(len(list_coStu)):
    coStu = np.array(list_coStu[iS])
    min_iC = 0
    d = 4 * 10**8 + 1
    for iC in range(len(list_coChe)):
        coChe = np.array(list_coChe[iC])
        dif = coChe - coStu
        dist = np.sum(np.abs(dif))
        if dist < d:
            min_iC = iC
            d = dist
    print(min_iC + 1)
n=int(input())
l=[input() for i in range(n)]
l.sort()
sum=0

for i in range(n-1):
  sum+=l[i]

if(sum>=l[n-1]):
  print("No")
else:
  print("Yes")

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
sum=0
l.sort()
for i in range(n-1):
  sum+=l[i]

if(sum<=l[n-1]):
  print("No")
else:
  print("Yes")
def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))
    color = [0] * 8
    sub_color = 0
    count = 0
    for score in a
        if score <= 0:
            continue
        for i in range(8):
            if i*400 <= score <= 399+(i*400):
                color[i] += 1
        if score >= 3200:
            sub_color += 1
    for j in color:
        if j != 0:
            count += 1
    if count + sub_color >= 8:
        print(count, 8, sep=" ")
    else:
        print(count, count+sub_color, sep=" ")

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n = int(input())
    a = list(map(int, input().split()))
    color = [False] * 8
    sub_color = 0
    for score in a:
        for i in range(8):
            if i*400 <= score <= 399+(i*400):
                color[i] = True
        if score >= 3200:
            sub_color += 1
    cnt = len([x for x in color if x])
    if cnt == 0:
        print(1, sub_color, sep=" ")
    else:
        print(cnt, cnt+sub_color, sep=" ")

if __name__ == "__main__":
    main()
import math
A = int(input())
B = int(input())
H = int(input())
M = int(input())
t = H * 60 + M
CC = A**2 + B **2 - 2 * A * B * math.cos(((math.pi/60)-(math.pi/360))*t)
print(CC ** (1/2))

### FIXED CODE ###

import math
 
PI = math.pi
A, B, H, M = map(int, input().split())
 
arg_a = (float(H) + float(M)/60) / 12.0 * 360
arg_b = float(M) / 60.0 * 360
 
 
C = math.sqrt(A*A + B*B - 2*A*B* math.cos((arg_a-arg_b)/360*2*PI))
print(C)
N, M = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse=True)

s = sum(A)
c = s / (4 * M)

if A[M] < c:
    print('No')
else:
    print('Yes')



### FIXED CODE ###

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

A.sort(reverse=True)

s = sum(A)
c = s / (4 * M)

if A[M - 1] < c:
    print('No')
else:
    print('Yes')
N,M = map(int,input().split())
A = [int(input()) for i in range(M)]

def recur(step):
  if step == N:
    return 1　
  
  elif step in A or step > N:
    return 0
  
  else:
    ret1 = recur(step + 1) 
    ret2 = recur(step + 2) 
    return (ret1 + ret2) % (10 ** 9 + 7) 
    
print(recur(0))
    

### FIXED CODE ###

N,M = map(int, input().split())
A = [int(input()) for a in range(M)]
A = set(A)
	
DP = [0] * (N + 1)	
DP[0] = 1

mod = (10 ** 9) + 7

for i in range(1,N+1):
	if i in A:
		DP[i] = 0
	else:
		DP[i] = DP[i-1] + DP[i-2]

print(DP[N] % (mod))