Harryxun/stf_run huggingface dataset:
n,m = map(int,input().split())

a = [0]*n
a = [int(s) for s in input().split()]

a_half = [s//2 for s in a]
#print(a)

def check(x):
    while (all(c%2 == 1 for c in x)):
        if any(c%2 == 1 for c in x):
            return 0
        x /= 2
    
    return 1

def gcd(x,y):
    #print(x,y)
    if(x%y == 0):
        #print(y)
        return y
    else:
        return gcd(y,x%y)


def lcm(x,y):
    return x/gcd(x,y)*y

if(check(a)== 1):
    x = a_half[0]
    for i in range(1,n):
        y = a_half[i]
        x = lcm(x,y)
    
    res = (m//x+1)//2
    print(res)
else:
    print(0)
    
    
    


### FIXED CODE ###

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

a = [1]*n
#print(a)
a = [int(s) for s in input().split()]

a_half = [s//2 for s in a]
#print(a)

def check(x):
    while (all(c%2 == 0 for c in x)):
        x = [s//2 for s in x]
        if any(c%2 == 1 for c in x) and any(c%2 == 0 for c in x):
            return 0
        
    
    return 1

def gcd(x,y):
    #print(x,y)
    if(x%y == 0):
        #print(y)
        return y
    else:
        return gcd(y,x%y)


def lcm(x,y):
    return x//gcd(x,y)*y

if(check(a)== 1):
    x = a_half[0]
    for i in range(1,n):
        y = a_half[i]
        x = lcm(x,y)
    if(x > m):
        print(0)
    else:
        res = int((m//x+1)//2)
        print(res)
else:
    print(0)
s, t = input().split()
 
if t.startswith(s):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s = input()
t = input()
 
if t.startswith(s):
  print('Yes')
else:
  print('No')
a, b, k = map(int, input().split())
for i in range(k):
    print(a + i)



for j in range(k - 1, -1, -1):
    print(b-j)

### FIXED CODE ###

a,b,k = map(int, input().split())
n = a
c = 1
while n <= b:
    print(n)
    n += 1
    c += 1
    if c > k:
        break
if n <= (b - k):
    n = b - k + 1

c = 1
while n <= b:
    print(n)
    n += 1
    c += 1
    if c > k:
        break
N,M = map(int,input().split())
#Dストックを昇順で生成する。
Dstock = {}
Nstock = {}
for i in range(1,N):
    Dstock[i]=""
    Nstock[i]=""
Nstock[N] = ""

count = 0
while Nstock and count<M:
    count += 1
    for i in Dstock.keys():
        for j in Nstock.keys():
            print(j,j+i)
            del Nstock[j]
            del Nstock[j+i]
            del Dstock[i]
            del Dstock[N-i]
            break
        else:
            continue
        break

### FIXED CODE ###

import math
X = int(input())
d = 100
year = 0
while True:
    year += 1
    if d+math.floor(d*0.01) >= X:
        print(year)
        exit()
    else:
        d += math.floor(d*0.01)
x=raw_input()
print( x**3 )

### FIXED CODE ###

import sys

x = int( sys.stdin.readline() )
print( "{}".format( x**3 ) )
import networkx as nx

def main():
  N,M=map(int,input().split())
  S = [list(input()) for _ in range(N)]

  if N == M == 1:
    print(0)
    print(S[0][0])
    exit()

  index = lambda i,j: i*M+j

  G=nx.DiGraph()
  G.add_node('source')
  G.add_node('sink')
  dx,dy=(1,0),(0,1)
  E = []
  for i in range(N):
    for j in range(M):
      if S[i][j]=='#':continue
      if (i+j) %2:
        E.append((index(i,j),'sink'))
      else:
        E.append(('source',index(i,j))
      for k in range(2):
        v1,v2 = index(i,j),index(i+dx[k],j+dy[k])
        if not (0<=i+dx[k]<N and 0<=j+dy[k]<M):
          continue
        if S[i+dx[k]][j+dy[k]] == '#': continue
        if (i+j) % 2:
          E.append((v2,v1))
        else:
          E.append((v1,v2))
     
  G.add_edges_from(E,capacity=1)
  flow_value, flow_dict = nx.maximum_flow(G, "source", "sink")

  for v1 in flow_dict.keys():
    if v1 in ('sink','source'):continue
    for v2 in flow_dict[v1].keys():
      if v2 in ('sink','source'):continue
      if flow_dict[v1][v2]:
        i1,j1 = divmod(v1,M)
        i2,j2 = divmod(v2,M)
        if i1 > i2 or j1 > j2:
          (i1,j1),(i2,j2) = (i2,j2),(i1,j1)
        if i1 < i2:
          S[i1][j1] = 'v'
          S[i2][j2] = '^'
        else:
          S[i1][j1] = '>'
          S[i2][j2] = '<'

  print(flow_value)
  for i in range(N):
    print(''.join(S[i]))
    
if __name__ == "__main__":
  main()

### FIXED CODE ###

import networkx as nx

def main():
  N,M=map(int,input().split())
  S = [list(input()) for _ in range(N)]

  if N == M == 1:
    print(0)
    print(S[0][0])
    exit()

  index = lambda i,j: i*M+j

  G=nx.Graph()
  dx,dy=(1,0),(0,1)
  E = []
  n1,n2 = [],[]
  for i in range(N):
    for j in range(M):
      if S[i][j]=='#':continue
      if (i+j)%2:
        n1.append(index(i,j))
      else:
        n2.append(index(i,j))
      for k in range(2):
        v1,v2 = index(i,j),index(i+dx[k],j+dy[k])
        if not (0<=i+dx[k]<N and 0<=j+dy[k]<M):
          continue
        if S[i+dx[k]][j+dy[k]] == '#': continue
        if (i+j) % 2:
          E.append((v2,v1))
        else:
          E.append((v1,v2))
     
  G.add_nodes_from(n1, bipartite=0)
  G.add_nodes_from(n2, bipartite=1)
  G.add_edges_from(E)
  u = [n for n in G.nodes if G.nodes[n]['bipartite'] == 0]
  match = nx.bipartite.maximum_matching(G, top_nodes=u)
  match = {v:match[v] for v in match.keys() if v < match[v]}
 
  for v in match.keys():
    i1,j1 = divmod(v,M)
    i2,j2 = divmod(match[v],M)
    if i1 > i2 or j1 > j2:
      (i1,j1),(i2,j2) = (i2,j2),(i1,j1)
    if i1 < i2:
      S[i1][j1] = 'v'
      S[i2][j2] = '^'
    else:
      S[i1][j1] = '>'
      S[i2][j2] = '<'

  print(len(match))
  for i in range(N):
    print(''.join(S[i]))
    
if __name__ == "__main__":
  main()
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())

i = 0
while i<N:
  b = int(input())
  j=0
  while j<3:
    k=0
    while k<3:
      if A[j][k]==b:
        A[j][k]=0
      k+=1
    j+=1
  i+=1

flag = False
i = 0
while i<3:
  if A[i][0]+A[i][1]+A[i][2] == 0:
    flag = True
    break
  if A[0][i]+A[1][i]+A[2][i] == 0:
    flag = True
    break
  i += 1

if A[0][0]+A[1][1]+A[2][2] == 0:
  flag = Trueå
if A[2][0]+A[1][1]+A[0][2] == 0:
  flag = True

if flag == True:
  print("Yes")
else:
    print("No")
    


### FIXED CODE ###

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())

i = 0
while i<N:
  b = int(input())
  j=0
  while j<3:
    k=0
    while k<3:
      if A[j][k]==b:
        A[j][k]=0
      k+=1
    j+=1
  i+=1

flag = False
i = 0
while i<3:
  if A[i][0]+A[i][1]+A[i][2] == 0:
    flag = True
    break
  if A[0][i]+A[1][i]+A[2][i] == 0:
    flag = True
    break
  i += 1

if A[0][0]+A[1][1]+A[2][2] == 0:
  flag = True
if A[2][0]+A[1][1]+A[0][2] == 0:
  flag = True

if flag == True:
  print("Yes")
else:
    print("No")
S = input()
S = sorted(S)
i = 0
if S[0] != "a":
    print("a")
    exit(1)
while i<len(S)-1:
    if ord(S[i]) == ord(S[i+1]) or ord(S[i]) == ord(S[i+1])-1:
        i += 1
    else:
        print(chr(ord(S[i])+1))
        exit(0)

if S[-1] == "z":
    print("None")
else:
    print(chr(ord(S[i])+1))

### FIXED CODE ###

S = input()
S = sorted(S)
i = 0
if S[0] != "a":
    print("a")
    exit(0)
while i<len(S)-1:
    if ord(S[i]) == ord(S[i+1]) or ord(S[i]) == ord(S[i+1])-1:
        i += 1
    else:
        print(chr(ord(S[i])+1))
        exit(0)

if S[-1] == "z":
    print("None")
else:
    print(chr(ord(S[i])+1))
N=int(input())
Flag=False
for i in range(N):
  C=input()
  if C=='Y':
    Flag=True
    
print('Four' if Flag else 'Three')
  

### FIXED CODE ###

input()
print("Four" if "Y" in input() else "Three")
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
    s = input()
    if s == 'AC':
        AC += 1
    elif s == 'WA':
        WA += 1
    elif s == 'TLE':
        TLE += 1
    else:
        RE += 1
print('AC x', AC)
print('WA x', WA)
print('TLE x', TLE)
print('RE x', RE)

### FIXED CODE ###

N = int(input())
if N % 1000 > 0:
    print(1000 - (N % 1000))
elif N % 1000 == 0:
    print(0)
a, p = map(int, input().split())
apple = a*3 + p
return apple/2

### FIXED CODE ###

a, p = map(int, input().split())
print(int((a*3 + p)/2))
n = int(input())
a = list(map(int,input().split().strip())
for i in range(n):
    key = a[i]
    j = i - 1
    while j >= 0 and a[j] > key:
        a[j+1] = a[j]
        j -= 1
    a[j+1] = key
    print(' '.join(map(str,a)))

### FIXED CODE ###

n = int(input())
lst = list(map(int,input().split()))
for i in range(n):
    key = lst[i]
    j = i-1
    while j >= 0 and lst[j] > key:
        lst[j+1] = lst[j]
        j -= 1
    lst[j+1] = key
    print(' '.join(map(str,lst)))
N = int(input())
l = [int(input()) for i in range(N)]

cnt_t = 0
cnt_f = 0

for i in l:
  if i%4=0:
    cnt_f += 1
  else:
    cnt_t += 1

num = N-cnt_t-cnt_f

if num <= cnt_f+1:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

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

cnt_t = 0
cnt_f = 0

for i in l:
  if i%4==0:
    cnt_f += 1
  elif i%2==0:
    cnt_t += 1

num = N-cnt_t-cnt_f

if cnt_t == 0:
  cnt_f += 1
if num <= cnt_f:
  print("Yes")
else:
  print("No")
line = input().split()
N = int(line[0])
i = int(line[1])

print(n-i+1)


### FIXED CODE ###

line = input().split()
N = int(line[0])
i = int(line[1])

print(N-i+1)
d = {
    1: 2,
    2: 5,
    3: 5,
    4: 4,
    5: 5,
    6: 6,
    7: 3,
    8: 7,
    9: 6,
}
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)

inf = 10**18
dp = [-inf]*(N+1)
dp[0] = 0


for a in A:
    for j in range(d[a], N + 1):
        dp[j] = max(dp[j], dp[j - d[a]] + 1)

ans = ""
remain = dp[N]
match = N
while match > 0:
    for a in A:
        if dp[match - d[a]] == remain - 1:
            ans += str(a)
            match -= d[a]
            remain -= 1
            break

print(ans)


### FIXED CODE ###

d = {
    1: 2,
    2: 5,
    3: 5,
    4: 4,
    5: 5,
    6: 6,
    7: 3,
    8: 7,
    9: 6,
}
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)

inf = 10**9
dp = [-inf]*(N+1)
dp[0] = 0


for a in A:
    for j in range(d[a], N + 1):
        dp[j] = max(dp[j], dp[j - d[a]] + 1)

ans = ""
remain = dp[N]
match = N
while match > 0:
    for a in A:
        if match - d[a] < 0:
            continue
        if dp[match - d[a]] == remain - 1:
            ans += str(a)
            match -= d[a]
            remain -= 1
            break

print(ans)
n = int(input())
a = [int(input()) for i in range(n)]
A = [0]*10000000
for i in a:
  if A[i] == 0:
    A[i] = 1
  else:
    A[i] = 0
print(A.count(1))

### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
wordcount = {}
for i in a:
  if i in wordcount:
    del wordcount[i]
  else:
    wordcount[i] = 1
print(len(wordcount))
a = int(raw_input())
b = int(raw_input())

if a == 1:
	a = 14

if b == 1:
	b = 14

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")


### FIXED CODE ###

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

if a == 1:
	a = 14

if b == 1:
	b = 14

if a > b:
	print "Alice"
elif a < b:
	print "Bob"
else:
	print "Draw"
n = int(input())
print('Yes' if s[0] == s[-1] else 'No')


### FIXED CODE ###

n = input()
print('Yes' if n[0] == n[-1] else 'No')
n=eval(input())
t=(n//1000)+1
f=1000*t-n
pring(f)

### FIXED CODE ###

n=eval(input())
f=(n//1000)
o=n/1000
if o==f:
  print(0)
else:
  p=(f+1)*1000-n
  print(p)
import math
import itertools
from fractions import gcd

N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7
color = [0]*3
ans = 1
for i in range(N):
  ind = color.index(A[i])
  ans *= len([c for c in color if c == A[i]])
  ans %= mod
  color[ind] += 1

#ans = rec(color,0)
print(ans)

### FIXED CODE ###

import math
import itertools
from fractions import gcd

N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7
color = [0]*3
ans = 1
for i in range(N):
  if A[i] not in color:
    ans = 0
    break
  ind = color.index(A[i])
  ans *= len([c for c in color if c == A[i]])
  ans %= mod
  color[ind] += 1

#ans = rec(color,0)
print(ans)
def solve(n, m, ABC):
    distance = [None] * n
    distance[0] = 0

    for _ in range(n):
        for a, b, c in ABC:
            if distance[a - 1] is not None and
                (distance[b - 1] is None or distance[b - 1] < distance[a - 1] + c):
                distance[b - 1] = distance[a - 1] + c

    for a, b, c in ABC:
        if distance[b - 1] < distance[a - 1] + c:
            return 'inf'

    return distance[n - 1]

_n, _m = map(int, input().split())
_ABC = [list(map(int, input().split())) for _ in range(_m)]
print(solve(_n, _m, _ABC))


### FIXED CODE ###

def solve(n, m, ABC):
    distance = [None] * n
    distance[0] = 0

    for _ in range(n - 1):
        for a, b, c in ABC:
            if distance[a - 1] is None:
                continue
            if distance[b - 1] is None or distance[b - 1] < distance[a - 1] + c:
                distance[b - 1] = distance[a - 1] + c

    for _ in range(n - 1):
        for a, b, c in ABC:
            if distance[a - 1] is None or distance[b - 1] is None:
                continue
            if distance[b - 1] < distance[a - 1] + c:
                distance[b - 1] = distance[a - 1] + c
                if b == n:
                    return 'inf'

    return distance[n - 1]

_n, _m = map(int, input().split())
_ABC = [list(map(int, input().split())) for _ in range(_m)]
print(solve(_n, _m, _ABC))
import math

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

ans = 0
MOD = 10**9 + 7

p = [0]*(n-1)
p[0] = 1 * math.factorial(n-1)
for i in range(1,n-1):
    p[i] = p[i-1] + math.factorial(n-1)/(i+1)
    p[i] %= MOD

for i in range(n-1):
    ans += (x[i+1]-x[i])*p[i]
    ans %= MOD

ans %= MOD

print(int(ans))

### FIXED CODE ###

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


def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

def mod_inv(a,mod):
    x = extgcd(a,mod)[0]
    return (mod+x%mod)%mod

ans = 0
MOD = 10**9 + 7

factorial = 1
for i in range(2,n):
    factorial = (factorial * i%MOD) %MOD

p = [0]*(n-1)
p[0] = 1 * factorial%MOD

for i in range(1,n-1):
    p[i] = p[i-1] + factorial*mod_inv(i+1,MOD)
    p[i] %= MOD

for i in range(n-1):
    ans += (x[i+1]-x[i])%MOD*p[i]
    ans %= MOD

print(int(ans))
n=int(input())
lista=[0 for i in range(n)]
lista=input().split()
n2=int(input())
listb=[0 for i in range(n2)]
listb=input().split()
cnt=0
for i in range(n2):
    x=0
    
    for j in range(n):
        if listb[i]==lista[j] and if x==0:
            x=1
            cnt+=1

print(cnt)


### FIXED CODE ###


n=int(input())
lista=[0 for i in range(n)]
lista=input().split()
n2=int(input())
listb=[0 for i in range(n2)]
listb=input().split()
cnt=0
for i in range(n2):
    x=0
    
    for j in range(n):
        if listb[i]==lista[j] and x==0:
            x=1
            cnt+=1

print(cnt)
s = input()
a = s.count()
print(s[0]+a+s[-1])

### FIXED CODE ###

s = input()
a = str(len(s)-2)
print(s[0] + a + s[-1])
n = int(input())
a = list(map(int,input().split()))
ma1 = [1]*n
ma2 = [0]*n
mi2 = [0]*n

for i in range(1,n):
    ma1[i]=ma1[i-1]*2-a[i]
    if ma1[i]<0:
        print(-1)
        exit()
if n == 1:
    if a[0]==1:
        print(-1)
        exit()
    if a[0]==0:
        if a[1]==1:
            print(2)
            exit()
        elif a[1]==2:
            print(3)
            exit()
        else:
            print(-1)
            exit()

ma2[n-1]=a[n]
ma2[n-2]=ma2[n-1]
mi2[n-1]=a[n]
mi2[n-2]=mi2[n-1]//2 + mi2[n-1]%2
if n!=2:
    for i in range(2,n):
        ma2[n-1-i]=min(ma2[n-i]+a[n-i+1],2**(n-i)-a[n-i])
        mi2[n-1-i]=(mi2[n-i]+a[n-i+1])//2 + (mi2[n-i]+a[n-i+1])%2
        if mi2[n-1-i]>ma2[n-1-i]:
            print(-1)
            exit()
ma2 = [1]+ma2
ans = 0
for i in range(n):
    ans += min(ma1[i],ma2[i])
ans +=sum(a)

print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ma1 = [1]*n
ma2 = [0]*n
mi2 = [0]*n

if n ==0:
    if a[0]==1:
        print(1)
        exit()
    else:
        print(-1)
        exit()

for i in range(1,n):
    ma1[i]=ma1[i-1]*2-a[i]
    if ma1[i]<0:
        print(-1)
        exit()
if n == 1:
    if a[0]==1:
        print(-1)
        exit()
    if a[0]==0:
        if a[1]==1:
            print(2)
            exit()
        elif a[1]==2:
            print(3)
            exit()
        else:
            print(-1)
            exit()

ma2[n-1]=a[n]
ma2[n-2]=ma2[n-1]
mi2[n-1]=a[n]
mi2[n-2]=mi2[n-1]//2 + mi2[n-1]%2
if n!=2:
    for i in range(2,n):
        ma2[n-1-i]=min(ma2[n-i]+a[n-i+1],2**(n-i)-a[n-i])
        mi2[n-1-i]=(mi2[n-i]+a[n-i+1])//2 + (mi2[n-i]+a[n-i+1])%2
        if mi2[n-1-i]>ma2[n-1-i]:
            print(-1)
            exit()
ma2 = [1]+ma2
ans = 0
for i in range(n):
    ans += min(ma1[i],ma2[i])
ans +=sum(a)

print(ans)
alphabet = 'abcdefghijklmnopqrstuvwxyz'
s = input()
K = int(input())
ans = ''
for i in range(len(s) - 1):
    s_i = alphabet.index(s[i])
    elif (26 - s_i < K) & (s_i != 0):
        K -= 26 - s_i
        s_i = 0
    ans += alphabet[s_i]
s_i = (alphabet.index(s[-1]) + K) % 26
ans += alphabet[s_i]
print(ans)


### FIXED CODE ###

alphabet = 'abcdefghijklmnopqrstuvwxyz'
s = input()
K = int(input())
ans = ''
for i in range(len(s) - 1):
    s_i = alphabet.index(s[i])
    if s[i] == 'a':
        ans += 'a'
        continue
    if (26 - s_i <= K):
        K -= 26 - s_i
        ans += 'a'
    else:
        ans += s[i]
ans += alphabet[(K + alphabet.index(s[-1])) % 26]
print(ans)
N = int(input())
S = input()

if N % 2:
  print("No")
else:
  for i in range(N/2):
    if S[i] != S[N/2 + i]:
      print("No")
      return
  print("Yes")

### FIXED CODE ###

N = int(input())
S = input()

ans = 1
if N % 2:
  ans = 0
else:
  for i in range(N//2):
    if S[i] != S[N//2 + i]:
      ans = 0
if ans:
  print("Yes")
else:
  print("No")
N, A, B = map(int, input().split())

x = N // (A+B)
y = N % (A+B)
if A < y:
  sum = A*X + A
else:
  sum = A*X + y
print(sum)

### FIXED CODE ###

N, A, B = map(int, input().split())
 
x = N // (A+B)
y = N % (A+B)
sum = A*x + min(A, y)
print(sum)
a,b,x=map(int,input().split())
def binary_search(start,end):
    if end-start<=1:return start
    else:
        i=(start+end)//2
        s = a * (i) + b * len(str(i))
        if s<=x:return binary_search(i,end)
        else:return binary_search(start,i)
print(binary_search(0,10**9+1))

### FIXED CODE ###

S=input()
if S=="SUN":print("7")
if S=="MON":print("6")
if S=="TUE":print("5")
if S=="WED":print("4")
if S=="THU":print("3")
if S=="FRI":print("2")
if S=="SAT":print("1")
from bisect import bisect_right
from numpy import cumsum
from sys import stdin
input=stdin.readline
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a=numpy.cumsum(a)
b=numpy.cumsum(b)
ans=0
for i in range(len(a)):
  x=k-a[i]
  y=bisect.bisect_right(b,x)
  if ans<y+i+1:
    ans=y+i+1
print(ans)

### FIXED CODE ###

from bisect import bisect_right
from numpy import cumsum
from sys import stdin
input=stdin.readline
n,m,k=map(int,input().split())
a=[0]+list(map(int,input().split()))
b=list(map(int,input().split()))
a=cumsum(a)
b=cumsum(b)
ans=0
for i in range(len(a)):
  x=k-a[i]
  if x>=0:
    y=bisect_right(b,x)
    if ans<y+i:
      ans=y+i
  else:
    break
print(ans)
from fractions import gcd
from sys import stdin
import math 
S = str(input())
K = int(input())
ans = 1

for itr in range(100):
    if S[itr] != '1':
        ans = int(S[itr])  
        break
    if itr == K:
        break

print(ans)

### FIXED CODE ###

from fractions import gcd
from sys import stdin
import math 
S = str(input())
K = int(input())
ans = 1

for itr in range(100):
    if S[itr] != '1':
        ans = int(S[itr])  
        break
    if itr+1 == K:
        break

print(ans)
S = input()
if S =< 2019/04/30:
  print("Heisei")
else:
  print("TBD")

### FIXED CODE ###

S = input()

if S <= "2019/04/30":
    print("Heisei")
else:
    print("TBD")
li = [int(x) for x in input().split()]
    li.sort()
    li.reverse()
    if(li[0]==li[1]+li[2]):
      print('Yes')
    else:
      print('No')

### FIXED CODE ###

li = [int(x) for x in input().split()]
li.sort()
li.reverse()
if(li[0]==li[1]+li[2]):
  print('Yes')
else:
  print('No')
import sys
sys.setrecursionlimit(10**5)
def main():
    n = int(input())
    h = [int(x) for x in input().split()]
    memo = [None for i in range(n)]

    # def rec(n):
    #     if memo[n-1] == None:
    #         if n <= 1:
    #             memo[n-1] = 0
    #         elif n == 2:
    #             memo[n-1] = abs(h[1]-h[0])
    #         else:
    #             d1 = rec(n-2)+abs(h[n-1]-h[n-3])
    #             d2 = rec(n-1)+abs(h[n-1]-h[n-2])
    #             memo[n-1] = min(d1,d2)
    #     return memo[n-1]
        
    # print(rec(n))

    def f(n, h):
        if memo[n-1] == None:
          if n <= 1:
              memo[0] = 0
          elif n == 2:
              memo[1] = abs(h[1]-h[0])
          else:
              d1 = abs(h[n-1]-h[n-2]) + f(n-1,h)
              d2 = abs(h[n-1]-h[n-3]) + f(n-2,h)
              memo[n-1] = min(d1,d2)
        return memo[n-1]

    print(f(n,h))


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)
def main():
    n = int(input())
    h = [int(x) for x in input().split()]
    memo = [None for i in range(n)]

    def rec(n):
        if memo[n-1] == None:
            if n <= 1:
                memo[n-1] = 0
            elif n == 2:
                memo[n-1] = abs(h[1]-h[0])
            else:
                d1 = rec(n-2)+abs(h[n-1]-h[n-3])
                d2 = rec(n-1)+abs(h[n-1]-h[n-2])
                memo[n-1] = min(d1,d2)
        return memo[n-1]
        
    print(rec(n))

if __name__ == "__main__":
    main()
from itertools import accumulate
n,x = map(int,input().split())
blr = [list(map(int,input().split())) for i in range(n)]
tad = []
for i in range(n):
  b,l,r = blr[i]
  tad.append(((x-b)*r+b*l,-b*l,(x-b)*r,i))
tad.sort(reverse=True)
t = list(zip(*tad))[2]
a = list(zip(*tad))[1]
a = [a[i]*(-1) for i in range(n)]
tacc = list(accumulate(t))
aacc = list(accumulate(a))
for i in range(n):
  if tacc[i]>=aacc[n-1]-aacc[i]:
    p = i
    break
if p == 0:
  tsum = 0
  asum = aacc[n-1]
else:
  tsum = tacc[p-1]
  asum = aacc[n-1]-aacc[p-1]
vis = [0]*n
for i in range(p):
  if tad[i][0] == tad[p][0]:
    continue
  v = tad[i][3]
  vis[v] = 1
ans = 10**18
for i in range(n):
  if vis[i]:
    continue
  b,l,r = blr[i]
  asumd = asum-b*l
  dif = tsum-asumd
  anstmp = p*x
  if dif >= 0:
    anstmp += b-dif//l
    print(2/0)
  else:
    anstmp += (-dif+r-1)//r+b
  if anstmp > (p+1)*x:
    continue
  ans = min(ans,anstmp)
print(ans)

### FIXED CODE ###

import sys
N,A,B,C,D = map(int, input().split())
S = input()
for i in range(N-1):
  if S[i] == S[i+1] == '#':
    if A < i+1 < C or B < i+1 < D:
      print("No")
      sys.exit()
if C>D:
  for i in range(N-2):
    if S[i] == S[i+1] == S[i+2] == '.':
      if B <= i+2 <= D:
        break
    if i == N-3:
      print("No")
      sys.exit()
print("Yes")
alice = 0
bob = 0
n = int(input())
a = sorted(list(map(int, input().split(' ')))).reverse()

for i in asorted[::2]: alice += i
for i in asorted[1::2]: bob += i
print(alice - bob)

### FIXED CODE ###

alice = 0
bob = 0
n = int(input())
a = list(map(int, input().split(' ')))
asrt = sorted(a, reverse = True)

for i in asrt[::2]: alice += i
for i in asrt[1::2]: bob += i
print(alice - bob)