Harryxun/stf_run huggingface dataset:
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
total=0
for i in range(N):
  total+=A[i]
if A[M]>=total/(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)
total=0
for i in range(N):
  total+=A[i]
if A[M-1]>=total/(4*M):
  print("Yes")
else:
  print("No")
from itertools import groupby, accumulate, product, permutations, combinations
def solve():
  ans = float('inf')
  N, A, B = map(int, input().split())
  mae = [list(map(int, input().split())) for _ in range((N+1)//2)]
  usiro = [list(map(int, input().split())) for _ in range(N-(N+1)//2)]
  if N==1:
    a,b,c = mae[0]
    if a*B==b*A:
      return c
    return -1
  mae_lis = [[float('inf')]*201 for _ in range(201)]
  for p in product([0,1],repeat=N//2):
    a,b,c = 0,0,0
    for i in range(N//2):
      if p[i]==1:
        a += mae[i][0];b += mae[i][1];c += mae[i][2]
      mae_lis[a][b] = min(mae_lis[a][b],c)
  usiro_lis = [[float('inf')]*201 for _ in range(201)]
  for p in product([0,1],repeat=N-N//2):
    a,b,c = 0,0,0
    for i in range(N//2):
      if p[i]==1:
        a += usiro[i][0];b += usiro[i][1];c += usiro[i][2]
      usiro_lis[a][b] = min(usiro_lis[a][b],c)
  for i in range(1,201):
    for j in range(1,201):
      c = mae_lis[i][j]
      if c==float('inf'):
        continue
      for k in range(1,201):
        if (i+k)*B%A!=0:
          continue
        l = (i+k)*B//A - j
        if l<=0:
          continue
        ans = min(ans,c+usiro_lis[k][l])
  return ans if ans<float('inf') else -1
print(solve())

### FIXED CODE ###

from itertools import groupby, accumulate, product, permutations, combinations
def solve():
  ans = float('inf')
  N, A, B = map(int, input().split())
  mae = [list(map(int, input().split())) for _ in range((N+1)//2)]
  usiro = [list(map(int, input().split())) for _ in range(N-(N+1)//2)]
  if N==1:
    a,b,c = mae[0]
    if a*B==b*A:
      return c
    return -1
  mae_lis = [[float('inf')]*201 for _ in range(201)]
  mae_lis[0][0] = 0
  for p in product([0,1],repeat=(N+1)//2):
    a,b,c = 0,0,0
    for i in range((N+1)//2):
      if p[i]==1:
        a += mae[i][0];b += mae[i][1];c += mae[i][2]
    mae_lis[a][b] = min(mae_lis[a][b],c)
  usiro_lis = [[float('inf')]*201 for _ in range(201)]
  usiro_lis[0][0] = 0
  for p in product([0,1],repeat=N-(N+1)//2):
    a,b,c = 0,0,0
    for i in range(N-(N+1)//2):
      if p[i]==1:
        a += usiro[i][0];b += usiro[i][1];c += usiro[i][2]
    usiro_lis[a][b] = min(usiro_lis[a][b],c)
  for i in range(1,201):
    for j in range(1,201):
      c = mae_lis[i][j]
      if c==float('inf'):
        continue
      for k in range(201):
        if (i+k)*B%A!=0:
          continue
        l = (i+k)*B//A - j
        if l<0 or l>200 or usiro_lis[k][l]==float('inf'):
          continue
        ans = min(ans,c+usiro_lis[k][l])
  for k in range(1,201):
    if k*B%A!=0:
      continue
    l = k*B//A
    if l>200 or usiro_lis[k][l]==float('inf'):
      continue
    ans = min(ans,usiro_lis[k][l])
  return ans if ans<float('inf') else -1
print(solve())
a,b,c,d = map(int, input().split())

alist = [a,b,c,d]
pre = a
for char in alist[1:3]:
  if pre == char:
    print("Bad")
    return
  else:
    pre = char
print("Good")

### FIXED CODE ###

S = str(input())
a = int(S[0])
b = int(S[1])
c = int(S[2])
d = int(S[3])

def afunc(a,b,c,d):
  alist = [a,b,c,d]
  pre = a
  for char in alist[1:4]:
    if pre == char:
      print("Bad")
      return
    else:
      pre = char
  print("Good")

afunc(a,b,c,d)
N = int(input())

n = 1000 - N
if 1000 < N:
  m = n * (-1)
else:
  m = n

print((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1])))






### FIXED CODE ###

N = int(input())

n = 1000 - N
if N == 2000 or N == 3000 or N == 4000 or N ==5000 or N == 6000 or N == 7000 or N == 8000 or N == 9000 or N == 10000or N == 0:
  print(0)
elif 1000 < N:
  m = n * (-1)
  if m < 10:
    print(1000-m)
  elif m < 100:
    print(1000-(int(str(m)[-2])*10) + (int(str(m)[-1])))
  else:
    print(1000-((int(str(m)[-3])*100) + (int(str(m)[-2])*10) + (int(str(m)[-1]))))
else:
  print(n)
#標準入力
N = int(input())
A = list(map(int, input().split()))
 
#累積和
S = [0]*N
for n in range(N):
  S[n] = S[n-1] + A[n]
  
_sum = int(0)
for i in range(N-1):
  _sum = _sum + int((A[i] * (S[N] - S[i])))

#modulo
_sum = _sum % (1000000000+7)
  
print(_sum)

### FIXED CODE ###

#標準入力
N = int(input())
A = list(map(int, input().split()))

#累積和
S = [0]*N
for n in range(N):
  S[n] = S[n-1] + A[n]

_sum = int(0)
for i in range(N-1):
  _sum = _sum + (A[i] * (S[-1] - S[i]))

#modulo
_sum = _sum % (1000000000+7)
  
print(_sum)
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

a = sorted(a)
b = sorted(b)
c = sorted(c)

la = []

for i in range(x):
    for n in range(max(y-3000//(i+1),0),y):
        for m in range(max(z-3000//((i+1)*(k+1)),0),z):
            la.append(a[i]+b[n]+c[m])

la = sorted(la)

for i in range(k):
    print(la[-i-1])


### FIXED CODE ###

x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

a = sorted(a)
b = sorted(b)
c = sorted(c)

la = []

for i in range(x):
    s = x-i
    for n in range(max(y-5-3000//s,0),y):
        u = y-n
        for m in range(max(z-5-3000//(s*u),0),z):
            #print(s,u,m)
            la.append(a[i]+b[n]+c[m])

la = sorted(la)

for i in range(k):
    print(la[-i-1])
n,k=map(int,input().split())
lists=list(map(int,input().split()))
a=format(k,"b")
length=max(len(a),len(format(max(lists),"b")))
fixedlists=[0]*n
uselists=[0]*length
for some in lists:
    check=format(some,"0%ib"%length)

    for i in range(length):
        if check[i]=="1":
            uselists[length-1-i]+=1         
if k>=1:
    order=0
    for i in range(length):
        if  2**i<=k<2**(i+1):
            order=i
            break  
            
    fixedlists=[0]*(k-2**order+1)
    for g in range(0,k-2**order+1):
        fixedlists[g]=format(g,"0%ib"%order)
        
    ans1=0
    ans2=0
    for j in range(order):
        ans1+=(2**j)*max(uselists[j],n-uselists[j])
        
    for j in range(order+1,length):
        ans2+=(2**j)*uselists[j]
    ans2+=(2**order)*(n-uselists[order])
    bigger=0
    for g in range(0,k-2**order+1):
        some=fixedlists[g]
        checker=0
        for i in range(order):
            if some[i]=="1":
                checker+=(2**(order-1-i))*(n-uselists[i])
            else:
                checker+=(2**(order-1-i))*uselists[i]
                
        bigger=max(bigger,checker)  
        
    ans2=ans2+bigger
    print(max(ans1,ans2))
elif k==0:
    print(1)


### FIXED CODE ###

n,k=map(int,input().split())
k2=format(k+1,"0%ib"%40)
lists=list(map(int,input().split()))
countlist=[0]*40
for j in lists:
    c=format(j,"0%ib"%40)
    for i in range(40):
        if c[i]=="1":
            countlist[i]+=1

emptylist=[]
for i in range(40):
    if k2[i]=="1":
        emptylist.append(i)
if k>=1:
    ans=0
    for i in emptylist:
        subing=0
        for j in range(40):
            if j<i:
                if k2[j]=="1":
                    subing+=(2**(39-j))*(n-countlist[j])
                elif k2[j]=="0":
                    subing+=(2**(39-j))*countlist[j]
            if j==i:
                subing+=(2**(39-i))*countlist[i]
            
            if j>i:
                subing+=(2**(39-j))*max(countlist[j],n-countlist[j])
        ans=max(ans,subing)
    print(ans)
elif k==0:
    ans=0
    for i in range(40):
        ans+=(2**(39-i))*countlist[i]
    print(ans)
# -*- coding:utf8 -*-

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

ans = 0
for i in range(n):
    ans += b[a[i - 1]]
    if i != 0 and a[i] == a[i - 1] + 1:
        ans += c[a[i - 1] - 1]
print(ans)

### FIXED CODE ###

# -*- coding:utf8 -*-

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

ans = 0
for i in range(n):
    ans += b[a[i] - 1]
    if i != 0 and a[i] == a[i - 1] + 1:
        ans += c[a[i - 1] - 1]
print(ans)
N = int(input())


ss = list()
for i in range(N):
    s, p = input().split()
    ss = ss.append([s, int(p), i])

ss_sorted = sorted(ss, key = lambda x:(x[0], -x[1]))

print([out[2] for out in ss_sorted])

### FIXED CODE ###

N = int(input())

ss = dict()
sss = dict()
for i in range(N):
    s, p = input().split()
    sss[s, p] = i + 1
    if s in ss:
        ss[s] = ss[s] + ',' + p
    else:
        ss[s] = p

ss_sorted = sorted(ss.items())

for tmp_ss in ss_sorted:
    s = tmp_ss[0]
    ps = list(map(int, tmp_ss[1].split(',')))
    ps.sort(reverse=True)
    for p in ps:
        print(sss[s, str(p)])
#A
"""
a,b = map(int, input().split())
if b % a == 0:
    print(b + a)
else:
    print(b-a)
"""

#B
"""
n, m = map(int, input().split())
ans = list(map(int, input().split()))
del ans[0]
ans = set(ans)
for i in range(n-1):
    a = list(map(int, input().split()))
    del a[0]
    ans = ans & set(a)
print(len(ans))
"""


#C
"""
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

#D
n,m = map(int, input().split())
a = list(map(int, input().split()))
num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
ans = [-float("inf") for _ in range(n + 1)]
num_ans = []
a.sort(reverse=True)
for i in a:
    num_ans.append(num[i])
ans[0] = 0
for i in range(n + 1):
    for b in num_ans:
        if i - b >= 0:
            ans[i] = max(ans[i - b] + 1, ans[i])
anse = ""
while ans[n] > 0:
    for k, i in enumerate(num_ans):
        if ans[n] - 1 == ans[n - i]:
            anse += str(a[k])
            n -= i
            break
    if n < 0:
        break
            
print(anse)

### FIXED CODE ###

#A
"""
a,b = map(int, input().split())
if b % a == 0:
    print(b + a)
else:
    print(b-a)
"""

#B
"""
n, m = map(int, input().split())
ans = list(map(int, input().split()))
del ans[0]
ans = set(ans)
for i in range(n-1):
    a = list(map(int, input().split()))
    del a[0]
    ans = ans & set(a)
print(len(ans))
"""


#C
"""
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

#D
n,m = map(int, input().split())
a = list(map(int, input().split()))
num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
ans = [-float("inf") for _ in range(n + 1)]
num_ans = []
a.sort(reverse=True)
for i in a:
    num_ans.append(num[i])
ans[0] = 0
for i in range(n + 1):
    for b in num_ans:
        if i - b >= 0:
            ans[i] = max(ans[i - b] + 1, ans[i])
anse = ""
while ans[n] > 0:
    for k, i in enumerate(num_ans):
        if n - i >= 0:
            
            if ans[n] - 1 == ans[n - i]:
                anse += str(a[k])
                n -= i
                break
    if n < 0:
        break
            
print(anse)
s = int(input())

x1 = 0
y1 = 0
x2 = int(s ** 0.5)
y3 = -(-s // x2)
x3 = 1
y2 = x2 * y3 - s
if x2 * y3 - x3 * y2 != s or x2 > 10 ** 9 or y3 > 10 ** 9:
    a
print(x1, y1, x2, y2, x3, y3)


### FIXED CODE ###

s = int(input())

x1 = 0
y1 = 0
x2 = int(s ** 0.5)
y3 = -(-s // x2)
x3 = 1
if y3 > 10 ** 9:
    x2 += 1
    y3 = -(-s // x2)
y2 = x2 * y3 - s
print(x1, y1, x2, y2, x3, y3)
from collections import Counter

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

c = Counter(A)

for i in range(len(A)-K):
    ans += c.most_common()[i][1]

print(ans)

### FIXED CODE ###

import collections

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

number = len(set(A))

c = collections.Counter(A)
values,counts=zip(*c.most_common())
count = 0
for i in range(number):
    if number <= K:
        print(count)
        break
    count += counts[-(i+1)]
    number -= 1
K = input()
S = input()
print(S if len(S)<=K)

### FIXED CODE ###

k = int(input())
s = str(input())
if len(s) <= k:
    print(s)
else:
    print((s[:k]) + "...")
N = int(input())
h = [int(input()) for _ in range(N)]
ans = sum(h)
if ans%10!=0:
    print(ans)
else:
    s = [i for i in s if s%10]
    print(ans - min(s))


### FIXED CODE ###

N = int(input())
h = [int(input()) for _ in range(N)]
ans = sum(h)
if ans%10!=0:
    print(ans)
else:
    s = [i for i in h if i%10]
    print(ans - min(s) if len(s) else 0)
n, m = map(int, input().split())

people = []
lang = [[] for _ in range(m)]

for i in range(n):
  kl = list(map(int, input().split()))
  k = kl[0]
  people.append(kl[1:])
  for l in kl[1:]:
    lang[l-1].append(i)

visited = [False for _ in range(n)]

def dfs(i):
  if visited[i]:
    return
  else:
    visited[i] = True
    for l in people[i]:
      for nexp in lang[l-1]:
        dfs(nexp)

dfs(0)

if all(visited):
  print('YES')
else:
  print('NO')


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def dfs(v):
    used[v] = True
    for _v in adjl[v]:
        if not used[_v]:
            dfs(_v)

n, m = map(int, input().split())
adjl = [[] for v in range(n + m)]
for i in range(n):
    kl = list(map(int, input().split()))
    k = kl[0]
    llist = kl[1:]
    for l in llist:
        adjl[i].append(l + n - 1)
        adjl[l + n - 1].append(i)

used = [False] * (n + m)
dfs(0)

if all(used[:n]):
  print('YES')
else:
  print('NO')
n = int(input())

ans = 0


i = 1
while i * i <= n:
    if n % i == 0:
        if n // (i-1) == n % (i-1):
            ans += n // i - 1
    i += 1

print(ans)

### FIXED CODE ###

n = int(input())

ans = 0


i = 1
while i * i < n:
    if n % i == 0:
        m = n // i - 1
        if m > i:
            ans += m
    i += 1

print(ans)
N, K = map(int, input().split())
l = []
for i in range(N):
  l.append(int(input()))
  
cnts = [0] * 20
for i in range(N-1):
  tmp = 0
  for j in range(max(l[i]-3, 0), min(l[i]+4, 300000)):
    tmp = max(tmp, cnts[j])
  cnts[l[i]] = tmp+1
print(max(cnts))

### FIXED CODE ###

N, K = map(int, input().split())
l = []
for i in range(N):
  l.append(int(input()))
  
cnts = [1] * N
for i in range(N):
  for j in range(max(0, i-200), i):
    if abs(l[i]-l[j]) <= K:
      cnts[i] = max(cnts[i], cnts[j]+1)
print(max(cnts))
num = list(map(int,input()
.split()))
if num[0] == 0:
    ans = num[1]
elif num[0] == 1:
    ans = num[1]*100
elif num[0] == 2:
    ans = num[1]*10000
else :
    
print(ans)

### FIXED CODE ###

num = list(map(int,input()
.split()))
if num[1] !=100:
    if num[0] == 0:
        ans = num[1]
    elif num[0] == 1:
        ans = num[1]*100
    elif num[0] == 2:
        ans = num[1]*10000
else:
    if num[0] == 0:
        ans = num[1]+1
    elif num[0] == 1:
        ans = num[1]*100+100
    elif num[0] == 2:
        ans = num[1]*10000+10000

print(ans)
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,k=map(int,input().split())
G=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    a-=1; b-=1
    G[a].append(b)
    G[b].append(a)

class InverseTable:
    __slots__ = ['In', 'fac', 'Ifac']

    def __init__(self, mod, maxnum):
        self.In = [0, 1]; self.fac = [1, 1]; self.Ifac = [1, 1]
        for i in range( 2, maxnum + 1 ):
            self.In.append( ( -self.In[mod % i] * (mod//i) ) % mod )
            self.fac.append( ( self.fac[-1] * i ) % mod )
            self.Ifac.append( (self.Ifac[-1] * self.In[-1]) % mod )
        
    def cmb(self, n, r):
        if ( r<0 or r>n ): return 0
        r = min(r, n-r)
        return self.fac[n] * self.Ifac[r] * self.Ifac[n-r] % mod

invt = InverseTable(mod, 2*10**5)
# maxnum=10**6だとテーブル生成に200ms程かかるので
# 最大生成領域は問題ごとに要検討

def dfs(s,node,parent):
    if len(G[node])-s==0: result=1
    else: result=(invt.fac[k-1-s]*invt.Ifac[k-1-s-(len(G[node])-s)])%mod
    for i ,di in enumerate(G[node]):
        if di == parent: continue
        result*=dfs(1,di,node); result%=mod
    # print(node,result)
    return result

print((k*dfs(0,0,-1))%mod)


    



### FIXED CODE ###

#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
sys.setrecursionlimit(10**7)

n,k=map(int,input().split())
G=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    a-=1; b-=1
    G[a].append(b)
    G[b].append(a)

class InverseTable:
    __slots__ = ['In', 'fac', 'Ifac']

    def __init__(self, mod, maxnum):
        self.In = [0, 1]; self.fac = [1, 1]; self.Ifac = [1, 1]
        for i in range( 2, maxnum + 1 ):
            self.In.append( ( -self.In[mod % i] * (mod//i) ) % mod )
            self.fac.append( ( self.fac[-1] * i ) % mod )
            self.Ifac.append( (self.Ifac[-1] * self.In[-1]) % mod )
        
    def cmb(self, n, r):
        if ( r<0 or r>n ): return 0
        r = min(r, n-r)
        return self.fac[n] * self.Ifac[r] * self.Ifac[n-r] % mod

invt = InverseTable(mod, 2*10**5)
# maxnum=10**6だとテーブル生成に200ms程かかるので
# 最大生成領域は問題ごとに要検討

def dfs(s,node,parent):
    if len(G[node])>=k: return 0
    elif len(G[node])-s==0: return 1
    else: result=(invt.fac[k-1-s]*invt.Ifac[k-1-s-(len(G[node])-s)])%mod
    for i ,di in enumerate(G[node]):
        if di == parent: continue
        result*=dfs(1,di,node); result%=mod
    # print(node,result)
    return result

print((k*dfs(0,0,-1))%mod)
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[0]*n
for i in range(n):
  g=[]
  for j in range(1,k+1):
    if 0<=i-j<=n-1:
       g.append(dp[i-j]+abs(h[i]-h[i-j]))
  if g!=[]:
    dp[i]=min(g)
  else:
    dp[i]=0
print(dp[n-1])


### FIXED CODE ###

n=int(input())
dp=[0]*n
h=list(map(int,input().split()))
for i in range(1,n):
  if i-2>=0:
     dp[i]=min(dp[i-1]+max(h[i]-h[i-1],h[i-1]-h[i]),dp[i-2]+max(h[i]-h[i-2],h[i-2]-h[i]))
  else:
    dp[i]=dp[i-1]+max(h[i]-h[i-1],h[i-1]-h[i])
print(dp[n-1])
if sorted([int(_) for _ in input().split()]) == [5, 5, 7]:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

print('A'+input().split()[1][0]+'C')
n = int(input())
V = [int(v) for v in input().split]
C = [int(c) for c in input().split]

G = [v - c for v, c in zip(V, C)]

s = 0
for g in G:
    if g > 0:
        s += g

print(s)

### FIXED CODE ###

n = int(input())
V = [int(v) for v in input().split()]
C = [int(c) for c in input().split()]

G = [v - c for v, c in zip(V, C)]

s = 0
for g in G:
    if g > 0:
        s += g

print(s)
# -*- coding: utf-8 -*-
import sys
from collections import deque

N=input()

nl=[ [] for i in range(N+1)]
D=[ 0 for i in range(N+1)]	# No.1からの距離
V=[ 0 for i in range(N+1)]	# 訪問済みフラグ

for i in range(N-1):
	a,b=map(int, sys.stdin.readline().split())
	nl[a].append(b)
	nl[b].append(a)


def bfs(v):	#1からの頂点Nまでの距離を算出
	q = deque([]) 
	V[v]=1
	q.append(v)
	while q:
		v=q.popleft()
		for i in nl[v]:
			if V[i]==0:
				D[i]=D[v]+1
				V[i]=1
				q.append(i)

bfs(1)


L=deque([]) 	#1-Nまでの最短経路を復元 
def bfs2(v):
	q = deque([]) 
	q.append(v)
	while q:
		v=q.popleft()
		for i in nl[v]:
			if D[i]==D[v]-1 and i!=1:
				q.append(i)
				L.appendleft(i)

bfs2(N)


color=[ None for i in range(N+1)]
color[1]="b"
color[N]="w"

l=len(L)
for i in range( (l+1)/2 ):
	color[ L[i] ]="b"

for i in range( (l+1)/2, l ):
	color[ L[i] ]="w"



def bfs3(v):
	q = deque([]) 
	q.append(v)
	while q:
		v=q.popleft()
		for i in nl[v]:
			if color[i] is None:
				color[i]=color[v]
				q.append(i)
for i in L:
	bfs3(i)
		


b_cnt=color.count("b")
w_cnt=color.count("w")


if N%2==1:
	if b_cnt>w_cnt:
		print "Fennec"
	else:
		print "Snuke"
else:
	if b_cnt==w_cnt:	
		print "Snuke"
	elif b_cnt>w_cnt:
		print "Fennec"
	else:
		print "Snuke"



### FIXED CODE ###

#Python

l = map(int, raw_input().split())

A=l[0]
B=l[1]
#print A
#print B

if A%3==0 or B%3==0 or (A+B)%3==0:
	print 'Possible'
else:
	print 'Impossible'
n , k = map(int,input().split())
list = map(int,input().split())

list = sorted(list)

a = 0

for i in range(k):
    a += list[k]

print(a)

### FIXED CODE ###

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

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

a = 0

for i in range(k):
    a += list[i]

print(a)
n = int(input())
A = []
B = []
for _ in range(n):
    v1, v2 = list(map(int, input().split(' ')))
    A.append(v1)
    B.append(v2)

A.sort()
B.sort()

if n % 2:
    print(B[n//2] - A[n//1] + 1)
else:
    print((B[n//2]+B[n//2-1]) - (A[n//2]+A[n//2-1]) + 1)

### FIXED CODE ###

n = int(input())
A = []
B = []
for _ in range(n):
    v1, v2 = list(map(int, input().split(' ')))
    A.append(v1)
    B.append(v2)

A.sort()
B.sort()

if n % 2:
    print(B[n//2] - A[n//2] + 1)
else:
    print((B[n//2]+B[n//2-1]) - (A[n//2]+A[n//2-1]) + 1)
x = list(map(int, input().split()))
print(x.index(0) + 1)

### FIXED CODE ###

x = list(map(int, input().split()))
print(x.index(0) + 1)
n = int(input())
a = int(input())
if ( N - A )% 500 == 0:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

n = int(input())
a = int(input())
if  n% 500 <= a:
	print("Yes")
else:
	print("No")
input()
aa = map(int, input().split())

bb = [0] * len(aa)
bb[0] = aa[0]
bb[1] = aa[1]
for i in range(2,len(aa)):
    bb[i] = bb[i-2] + aa[i]

sum0 = bb[len(aa)-2]
sum1 = bb[len(aa)-1]
ret = sum1
if len(aa)%2 == 0:
    ret = max(ret, sum0)
if len(aa)%2:
    sum0 = bb[len(aa)-1]
    sum1 = bb[len(aa)-2]
    for i in range(len(aa)//2):
        ret = max(ret, sum0 - aa[2*i])

# 0 -> 1
for i in range(0,len(aa)//2):
    try:
#        print(i, bb[2*i] - bb[2*i+3] + sum1 + aa[2*i+3])
        ret = max(ret, bb[i] - bb[i+3] + sum1 + aa[i+3] )
    except:
        0
# 1 -> 0
for i in range(0,len(aa)//2):
    try:
#        print(i, bb[2*i+1] - bb[2*i+4] + sum0 + aa[2*i+4])
        ret = max(ret, bb[2*i+1] - bb[2*i+4] + sum0 + aa[2*i+4] )
    except:
        0
print(ret)

### FIXED CODE ###

input()
aa = list(map(int, input().split()))
state = {(0,False)}
skipmax = len(aa)%2 + 1
state_all = {(i, True) for i in range(skipmax+1)}.union({(j, False) for j in range(skipmax+1)})
dp_0 = {a:None for a in state_all }
dp_0[(0,False)] = 0
skipcount = 0

def getmax(a, b):
    if a is None:
        return b
    if b is None:
        return a
    return max(a,b)

for i,a in enumerate(aa):
    dp_1 = {}
    for s in state_all:
        if s[1] & (dp_0[(s[0], False)] is not None):
            dp_1[s] = dp_0[(s[0], False)] + a
            continue
        dp_1[s] = getmax(dp_0[(s[0], True)], dp_0.get((s[0]-1, False), None))
    dp_0 = dp_1.copy()
if len(aa)%2:
    print(getmax(dp_0[(2,True)], dp_0[(1,False)]))
else:
    print(getmax(dp_0[(1,True)], dp_0[(0,False)]))
n, W, H = [int(i) for i in input().split()]
X = [[int(i) for i in input().split()] for j in range(n)]

imos_h = [0] * (H + 2)
imos_w = [0] * (W + 2)

for x, y, w in X:
  imos_h[max(0, y - w)] += 1
  imos_h[min(W + 1, y + w + 1)] -= 1
  imos_w[max(0, x - w)] += 1
  imos_w[min(H + 1, x + w + 1)] -= 1
  
for h in range(H):
  imos_h[h + 1] += imos_h[h]
  
for w in range(W):
  imos_w[w + 1] += imos_w[w]

is_w = all(imos_w[w] >= 1 for w in range(W + 1))
is_h = all(imos_h[h] >= 1 for h in range(H + 1))

if is_h or is_w:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

n, W, H = [int(i) for i in input().split()]
X = [[int(i) for i in input().split()] for j in range(n)]

imos_h = [0] * (H + 2)
imos_w = [0] * (W + 2)

for x, y, w in X:
  imos_h[max(0, y - w)] += 1
  imos_h[min(H + 1, y + w)] -= 1
  imos_w[max(0, x - w)] += 1
  imos_w[min(W + 1, x + w)] -= 1
  
for h in range(H):
  imos_h[h + 1] += imos_h[h]
  
for w in range(W):
  imos_w[w + 1] += imos_w[w]

is_w = all(imos_w[w] >= 1 for w in range(W))
is_h = all(imos_h[h] >= 1 for h in range(H))

if is_h or is_w:
  print('Yes')
else:
  print('No')