peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def main():
  import fractions
  
  w,h,x,y=map(float,input().split())
  
  if w/2==x and h/2==y:
    print(w*h/2,1)
  else:
    print(w*h/2,0)
  
if __name__=="__main__":
  main()
# Judge status: Accepted
## coding: UTF-8
N, A, B = map(int,input().split())

ans = 0
for i in range(1, N+1):
    s = str(i)
    w = 0
    for j in range(len(s)):
        w += int(s[j])
    if(A<= w and w <= B):
        ans += int(s)
print(ans)
# Judge status: Accepted
def main():
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())

    xa = 500
    xb = 100
    xc = 50

    Count = 0

    for i in range(A + 1):
        for j in range(B + 1):
            for k in range(C + 1):
              if (xa * i + xb * j + xc * k) == X:
                  Count += 1
    print(Count)

main()
# Judge status: Accepted
r, g, b = input().split()

if int(g + b) % 4 == 0:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
x = int(input())
ans = 0
ans += (x // 500) * 1000
ans += ((x % 1000) // 5) * 5
print(ans)
# Judge status: Accepted
n,r = map(int,input().split())
if n >= 10:
    print(r)
else:
    print(r + 100*(10-n))
# Judge status: Accepted
List = list(map(int, input().split()))
List.sort()
K=int(input())
for i in range(K):
  List[2] = List[2]*2
wa = 0
for i in range(3):
  wa += List[i]
print(wa)
# Judge status: Accepted
_, _, m = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
low = min(a) + min(b)
for _ in range(m):
    x, y, c = map(int, input().split())
    low = min(low, a[x - 1] + b[y - 1] - c)
print(low)
# Judge status: Wrong Answer
from sys import stdin

readline = stdin.readline

N = int(readline())
xy = [tuple(map(int, readline().split())) for _ in range(N)]

xy = list(set(xy))

xy.sort()

c = set(xy[:1500])
c = c | set(xy[-1500:])

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

c = c | set(xy[:1500])
c = c | set(xy[-1500:])

c = list(c)
result = 0
for i in range(len(c)):
    for j in range(i + 1, len(c)):
        result = max(result, abs(c[i][0] - c[j][0]) + abs(c[i][1] - c[j][1]))
print(result)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
R = {1:0}
i, t = A[0], 1

while K > t:
    r = R.get(i)
    if r == None:
        R[i] = t
        i = A[i-1]
        t += 1
    else:
        K -= r
        K %= t - r
        for k in range(K):
            i = A[i-1]

print(i)
# Judge status: Wrong Answer
N=int(input())
a=map(int,input().split())
c=0
d=0
e=0
f=0
for i in a:
  if i%4==0:
    c=c+1
  elif i%2==0:
    d=d+1
  e=N-d
if d==0:
  if (c+1)>=e:
    print('Yes')
  else:
    print('No')
    
else:
  if c>=0:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))[::-1]

t = 0
before = A[0] - 1
max_t = 0
for i in A:
    if before <= i:
        t += 1
        before = i
    else:
        max_t = max(t, max_t)
        t = 0
        before = i


print(max_t - 1)
# Judge status: Accepted
n = int(input())
a = []
for _ in range(n):
  a_ = int(input())
  a.append(a_)

ans = 0
c = 1
for i in range(n):
  c = a[c-1]
  ans += 1
  if c == 2:
    print(ans)
    exit()
print(-1)
# Judge status: Wrong Answer
o = list(input())
s = list(input())
for x,y in zip(o,s) :print(x+y,end = "")
# Judge status: Wrong Answer
x = int(input())
import math

while True:
  if(str(math.sqrt(x))[-2] == "."):
    print(x)
    exit()
  else:
    x = x - 1
# Judge status: Wrong Answer
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]
  
for j in range(0, N-1):
  if A[j+1] == A[j] + 1:
    ans = ans + C[j-1]
    
print(ans)
# Judge status: Accepted
a=sorted(list(map(int, input().split())))
print("Yes" if a[0] + a[1] == a[2] else "No")
# Judge status: Accepted
import numpy as np
n,m=map(int,input().split())
x=list(map(int,input().split()))

arr=np.sort(np.array(x))
dif=np.diff(arr)

lis=dif.tolist()
lis=sorted(lis)

for i in range(n-1):
    if len(lis)>0:
        lis.pop()

print(sum(lis))
# Judge status: Accepted
S = input()

if 'RRR' == S:
    print(3)
elif 'RR' in S:
    print(2)
elif 'R' in S:
    print(1)
else:
    print(0)
# Judge status: Accepted
Sa=input()
Sb=input()
Sc=input()
cur=0
while True:
  if cur==0:
    if len(Sa)==0:
      print("A")
      exit()
    cur=ord(Sa[0])-ord("a")
    Sa=Sa[1:]
  elif cur==1:
    if len(Sb)==0:
      print("B")
      exit()
    cur=ord(Sb[0])-ord("a")
    Sb=Sb[1:]
  else:
    if len(Sc)==0:
      print("C")
      exit()
    cur=ord(Sc[0])-ord("a")
    Sc=Sc[1:]
# Judge status: Accepted
N = int(input())
count = [0]*4
for i in range(N):
    S = input()
    if S == 'AC':
        count[0] += 1
    elif S == 'WA':
        count[1] += 1
    elif S == 'TLE':
        count[2] += 1
    else:
        count[3] += 1
print('AC x ' + str(count[0]))
print('WA x ' + str(count[1]))
print('TLE x ' + str(count[2]))
print('RE x ' + str(count[3]))
# Judge status: Wrong Answer
def main():
    n = int(input())
    B = input()
    B = B.split()
    B = [int(i) for i in B]
    s = 0
    for i in range(0, n-1):
        if i == 0:
            s += B[0]
        else:
            s += min(B[i - 1], B[i])
    s += B[-1]
    return s

main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 13:35:45 2020

@author: ezwry
"""

k = int(input())
a = 7

for i in range(k):
    a = a % k
    if a == 0:
        print(i+1)
        exit()
    else:
        a = a*10 + 7

print(-1)
# Judge status: Wrong Answer
N, M = map(int, input().split())
quotient = M // N
cnt = quotient - 2
M -= N * cnt
while True:
    if M < N:
        break
    cnt += 1
    M -=  N

if M % cnt == 0:
    ans = cnt
else:
    ans = M % cnt

print(ans)
# Judge status: Wrong Answer
N = int(input())
ans = N%1000
print(ans)
# Judge status: Wrong Answer
n = int(input())
b_s = list(map(int, input().split(' ')))

a = 0
if n > 3:
  for i in range(0, n-2):
    b_i, a_i = b_s[i], b_s[i+1]
    a += (b_i if b_i <= a_i else a_i)
elif n == 3:
  a += b_s[1] + b_s[0] * 2
elif n == 2:
  a += b_s[0] * 2
print(a + b_s[n-2])
# Judge status: Accepted
s = list(input())
l2r = [0]
r2l = [0]
n = len(s)
for i in range(n):
  if s[i] == '<':
    l = l2r[i]
    l2r.append(l+1)
  else:
    l2r.append(0)

for j in range(n):
  if s[n-1-j] == '>':
    r2l.append(r2l[j]+1)
  else:
    r2l.append(0)
invr2l = r2l[::-1]
ans = []
for i in range(n+1):
  m = max(l2r[i],invr2l[i])
  ans.append(m)

print(sum(ans))
# Judge status: Accepted
# -*- coding: utf-8 -*-

w, h, x, y = map(int, input().split())

def multi(w, h, x, y):
    core = (w/2, h/2)
    if (x == core[0])^(y == core[1]):
        return False
    elif x == core[0]:
        return True
    else:
        return False

print(w*h/2, 1 if multi(w, h, x, y) else 0)
# Judge status: Accepted
n,k=map(int,input().split())
d=list(map(str,input().split()))
while True:
    s=str(n)
    f=1
    for i in range(len(s)):
        if s[i] in d:
            f=0
    if f:
        print(n)
        exit()
    n+=1
# Judge status: Accepted
def main():
    import bisect

    N = int(input())
    upper = list(map(int, input().split()))
    middle = list(map(int, input().split()))
    lower = list(map(int, input().split()))

    upper.sort()
    middle.sort()
    lower.sort()

    cnt = 0

    for i in range(N):
        mid = middle[i]
        index_up = bisect.bisect_left(upper, mid)
        index_low = bisect.bisect_right(lower, mid)
        
        cnt += index_up * (N - index_low)
    
    print(cnt)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
alis = list(map(int, input().split()))
blis = list(map(int, input().split()))
clis = list(map(int, input().split()))
cache = 0
ans = 0
for i in range(n):
    a = alis[i]
    b = blis[a - 1]
    ans += b
    if cache + 1 == a:
        ans += clis[a - 2]
    cache = a
print(ans)
# Judge status: Accepted
n = int(input())
AB = [list(map(int,input().split())) for _ in range(n)]
AB.sort(key=lambda x: x[1])
# print(AB)
now = 0
ok = True
for necessary, deadline in AB:
    # print(now)
    # print(necessary, deadline)
    if now + necessary > deadline:
        ok = False
        break
    now += necessary

print("Yes" if ok else "No")
# Judge status: Wrong Answer
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
  if i%k == 0:
    print('OK')
    break
  else:
    print('NG')
# Judge status: Wrong Answer
s = input()
n = len(s)
ans = -1e9
for i in range(n):
    for j in range(i, n):
        ok = True
        for k in range(i, j + 1):
            if s[k] not in ['A', 'T', 'G', 'C']:
                ok = False
        if ok:
            ans = max(ans, j - i + 1)
print(ans)
# Judge status: Wrong Answer
n,c,k = [int(x) for x in input().split()]
t = []
for _ in range(n):
    t.append(int(input()))
t.sort()

ans = 0
tmp = {"f": 0, "num": 0}

for x in t:
    if not (x <= k + tmp["f"] and tmp["num"] <= c):
        ans += 1
        tmp["f"] = x
        tmp["num"] = 0
    tmp["num"] += 1

if tmp["num"] != 0:
    ans += 1

print(ans)
# Judge status: Accepted
N=int(input())
if N/2.0>int(N/2.0):
    print(int(N/2.0)+1)
else: print(int((N/2.0)))
# Judge status: Wrong Answer
sx,sy,tx,ty = map(int,input().split())
dx = tx-sx
dy = ty-sy
print("U"*dy+"R"*dx+"D"*dy+"L"*(dx+1)+"U"*(dy+1)+"R"*(dx+2)+"D"*(dy+2)+"L"*(dx+2))
# Judge status: Wrong Answer
N = int(input())
a = (input().split())
a_str = ''.join(a)
a_str2 = a_str
sum = 0
l_dict = {}
while len(a_str)>0:
    n = a.count(a_str[0])
    sum += int(n*(n-1)/2)
    l_dict[a_str[0]] = n
    a_str = a_str.replace(a_str[0],'')
for k in range(N):
    print(sum-l_dict[a_str2[k]]+1)
# Judge status: Wrong Answer
n=int(input())
p=list(map(int,input().split()))
li=[]
for i in range(1,n):
    q=p.count(i)
    li.append(q)
for result in li:
    print(result,"\n")
# Judge status: Accepted

S = list(input())

if S.count('a') ==1 and S.count('b') and S.count('c'):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
h1, n1, h2, n2, k = map(int,input().split())
h = h2-h1
n = n2-n1
wake = 60*h + n-1
ans = int(wake/k)
print(ans*k)
# Judge status: Wrong Answer
N,A,B = map(int,input().split())
S = list(input())

C = A + B
ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df < C:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df < C and f <= B:
      ans.append('Yes')
    else:
      ans.append('No')
      
print('\n'.join(ans))
# Judge status: Accepted
n=int(input())
s=input()
ans=0
l=0
r=0
a=0
for i in range(n):
  if s[i]=="(":
    a=a-1
    l=l+1
  else:
    a=a+1
    r=r+1
    if a>ans:
      ans=a
for i in range(ans):
  print("(",end="")
for i in range(n):
  print(s[i],end="")
for i in range(ans+l-r):
  print(")",end="")
print()
# Judge status: Accepted
n,k,s = map(int, input().split( ))
#editorial
#s..s,s+1,...s+1
#またはs,,,s,1,,,1
for i in range(k):
        print(s,end = " ")
if s<10**9:
    for i in range(k,n):
        print(s+1,end = " ")
else:
    for i in range(k,n):
        print(1,end = " ")
# Judge status: Accepted
from collections import defaultdict
n,k=map(int,input().split())
a=list(map(int,input().split()))

order = []
now = 1
count = 0
d = defaultdict(int)


for i in range(n):
    if d[now]!=0:
        s=d[now]-1
        g=i
        break
    order.append(now)
    d[now] = i+1
    now = a[now-1]


if k<=s:
    print(order[k])
else:
    k-=s
    loop = order[s:g]
    print(loop[k%len(loop)])
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = list(map(int, input().split()))




import bisect
A.sort()
A = [-1] + A
for i in range(M):
    b, c = map(int, input().split())
    idx = bisect.bisect_left(A, c)
    #print(A[:idx], A[idx:])
    #A = A[:idx] + [c] * b + A[idx:]
    #A = A[-N:]
    #print(A)
print(sum(A))
# Judge status: Accepted
import math

a,b =input().split()
c = int(a + b)
print('Yes' if math.sqrt(c).is_integer() else 'No')
# Judge status: Accepted
inp=[int(input()) for i in range(3)]
print(int((inp[0]+inp[1])*inp[2]/2))
# Judge status: Accepted
n = int(input())
xy  = [list(map(int, input().split())) for _ in range(n)]

xy.sort()
lstm = []
lstp = []
for x, y in xy:
    lstm.append(x-y)
    lstp.append(x+y)
    
lstm.sort()
lstp.sort()
ans = max(lstm[-1] - lstm[0], lstp[-1] - lstp[0])
print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=list(map(int,input().split()))
if n<k:
    print(1)
else:
    print(n//(k-1))
# Judge status: Wrong Answer
A, B = map(float,input().split())
print(int(A*B))
# Judge status: Accepted
import numpy as np
a, b, c, d = map(int, input().split())

hoge = []
hoge.append(a*c)
hoge.append(a*d)
hoge.append(b*c)
hoge.append(b*d)

if max(hoge) < 0:
  if np.sign(a) != np.sign(b) or np.sign(c) != np.sign(d):
    print(0)
  else:
    print(max(hoge))
else:
  print(max(hoge))
# Judge status: Accepted
N = int(input())
ans = 0
for i in range(1, N):
    if N % i == 0:
        ans += (N // i) - 1
    else:
        ans += N // i

print(ans)
# Judge status: Wrong Answer
a = [int(input()) for i in range(6)]

flag = True
for i in range(4):
  for j in range(i, 5):
    if a[i] - a[j] > a[len(a)-1]:
      flag = False
      break

if flag:
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]
ans = 0
ind = n-1
a.sort()
for i in range(n-1):
    if i%2:
        ans += a[ind]
    else:
        ans += a[ind]
        ind -= 1

print(ans)
# Judge status: Wrong Answer
#48b
import math
a,b,x = map(int, input().split())

first = math.ceil(a/x)
end = b//x

if a!=0:
  print(end - first + 1)
else:
  print(end - first)
# Judge status: Wrong Answer
import sys
N = int(input())
s = input()
if N%2 != 1:
  print('No')
  sys.exit()
if s[:N//2] == s[N//2+1:]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
k, x = list(map(int, input().split()))

if k == 1:
    print(x)
else:
    lower = []
    upper = []
    for i in range(1, k):
        lower.append(x-i)
        upper.append(x+i)
    
    res = lower[::-1] + [x] + upper

    r = [str(x) for x in res]
    print(" ".join(r))
# Judge status: Accepted
a = int(input())


for i in range(a,100005):
  flag = 0
  for j in range(2,i):
    if j*j < i:
      if i % j == 0:
        flag = 1
        break
  if flag == 0:
    ans = i
    break
    
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

for i in range(N-K):
  if A[K+i] > A[i]:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
import math
N = int(input())

ans = list()
for i in range(int(math.sqrt(N))):
    i += 1
    if N % i ==0:
        j = N//i
        ans.append(i + j -2) 
    else:
        pass

print(min(ans))
# Judge status: Accepted
N,M=map(int, input().split())
A = [input() for i in range(N)]
B = [input() for i in range(M)]

flag=0
for i in range(N-M+1):
  for j in range(N-M+1):
    for k in range(M):
      if A[i+k][j:j+M]!=B[k]:
        break
      #print(i,j,k,' ',A[i+k][j:j+M],' ',B[k])
    else:
      flag=1
print('Yes' if flag==1 else 'No')
# Judge status: Accepted
import math
ab = [int(i) for i in input().split()]
ab = math.gcd(ab[0], ab[1])
dic = {}
n = 2
while n**2 <= ab:
  if ab % n:
    n += 1
  else:
    ab //= n
    dic[n] = dic.get(n,0) + 1
if 1 < ab:
  dic[ab] = dic.get(ab,0) + 1

print(len(dic) + 1)
# Judge status: Accepted
import sys
import fractions
from functools import reduce

# N 時計の数
n = int(input())

# Ti 各時計が1周する秒数
t = [int(input()) for i in range(n)]

# 最小公倍数を求める
def lcm_base(a, b):
    return (a * b) // fractions.gcd(a, b)

def lcm(*num_list):
    return reduce(lcm_base, num_list, 1)

print(lcm(*t))
# Judge status: Accepted
def EatCandy(a, b, x):
    if a + b <= x:
        pass
    else:
        if a <= x:
            b = x - a
        else:
            b = 0
            a = x
    return (a, b)

def solve():
    N, x = [int(_) for _ in input().split()]
    A = [int(_) for _ in input().split()]
    st = sum(A)
    for i in range(N - 1):
        A[i], A[i + 1] = EatCandy(A[i], A[i + 1], x)
    return st - sum(A)

if __name__ == '__main__':
    print(solve())
# Judge status: Accepted
def LI(): return list(map(int,input().split()))
N,x = LI()
a = LI()
ans = 0
for i in range(N-1):
    if a[i]+a[i+1]>x:
        if a[i]>x:
            ans += a[i+1]
            a[i+1] = 0
            ans += a[i]-x
        else:
            ans += a[i+1]-(x-a[i])
            a[i+1] = x-a[i]
print(ans)
# Judge status: Accepted
# Problem C - Together

# input
N = int(input())
a_nums = list(map(int, input().split()))

# initialization
nums = [0]*(10**5 + 1)
max_count = 0

# count
for a in a_nums:
    nums[a] += 1

# max count
for i in range(10**5 + 1):
    if i==0 or i==10**5:
        continue

    tmp_count = nums[i-1] + nums[i] + nums[i+1]
    max_count = max(max_count, tmp_count)

# output
print(max_count)
# Judge status: Accepted
N,M=map(int,input().split())
ac=[0]*(N+1)
wa=[0]*(N+1)
for i in range(M):
    p,s=input().split()
    if ac[int(p)]==1:
        continue
    if s=='AC':
        ac[int(p)]=1
    elif s=='WA':
        wa[int(p)]+=1

ac_ans,wa_ans=0,0
for a,w in zip(ac,wa):
    if a==0:
        continue
    ac_ans+=a
    wa_ans+=w

print(ac_ans,wa_ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split(" ")))
a = sorted(a)[::-1]

if n % 2:
  ans = a[0] + 2 * sum(a[1:(n//2)]) + a[n//2]
else:
  ans = a[0] + 2 * sum(a[1:(n//2)])

print(ans)
# Judge status: Wrong Answer
n = input()
if n[1:].count(n[0]) >= 3 or n[:2].count(n[3]) >= 3:
	print("Yes")
	exit()
else:
	print("No")
# Judge status: Accepted
import math
n, k = map(int, input().split())
A = list(map(int, input().split()))

A_min = min(A)
N = n-len([i for i in A if i == A_min])
print(math.ceil(N/(k-1)))
# Judge status: Accepted
N = int(input())
bbb = list(map(int, input().split()))
aaa = []
for i in range(1, N - 1):
    a = min(bbb[i - 1], bbb[i])
    aaa.append(a)
print(sum(aaa) + bbb[0] + bbb[-1])
# Judge status: Accepted
import sys
import math
import bisect

def main():
    n = int(input())
    ans = []
    ans.append('Christmas')
    for i in range(25 - n):
        ans.append('Eve')
    print(' '.join(ans))

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
x,a,b = map(int, input().split())
if b <= a:
  print('delicious')
elif b < a <= b+x :
  print('safe')
else:
  print('dangerous')
# Judge status: Accepted
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n
MOD = 10**9+7
n = int(input())
a = list(map(int, input().split()))
l = a[0]
for x in a:
    l = lcm(x, l)
ans = 0
for x in a:
    ans += l*pow(x, MOD-2, MOD)%MOD
print(ans%MOD)
# Judge status: Accepted
A, B, M = [int(x) for x in input().split()]
A_price_list = [int(x) for x in input().split()]
B_price_list = [int(x) for x in input().split()]

discount_list = []

for i in range(M):
    x, y, c = [int(x) for x in input().split()]
    discount_list.append([x-1, y-1, c])


amount = min(A_price_list) + min(B_price_list)

for x, y, c in discount_list:
    tmp_price = A_price_list[x] + B_price_list[y] - c
    amount = min(tmp_price, amount)

print(amount)
# Judge status: Accepted
N = input()
if N == "SAT":
  print("1")
elif N == "SUN":
  print("7")
elif N == "MON":
  print("6")
elif N == "TUE":
  print("5")
elif N == "WED":
  print("4")
elif N == "THU":
  print("3")
else:
  print("2")
# Judge status: Accepted
dd=input("").split(" ")
a=int(dd[0])
b=int(dd[1])
c=int(dd[2])
d=int(dd[3])
s=max(a*c,b*c,a*d,b*d)
print(s)
# Judge status: Wrong Answer
X = input()
N = len(X)
cnt_h = 0
for i in range(N):
    if X[i] == "S":
        cnt_h = i
        break
cnt_f = N
for i in range(N - 1, cnt_h, -1):
    if X[i] == "T":
        cnt_f = i + 1
        break
ans = 0
for i in range(cnt_h, cnt_f):
    if X[i] == "S":
        ans += 1
    else:
        ans -= 1
print(abs(ans) + cnt_h + N - cnt_f)
# Judge status: Accepted
def resolve():
    X, Y = map(int, input().split())
    print("-1" if X%Y == 0 else X*(Y-1))
resolve()
# Judge status: Accepted
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations
    #from itertools import accumulate, product, permutations
    from math import floor, ceil

    #mod = 1000000007

    x,y,z = map(int, input().split())
    print((x-z)//(y+z))
        

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
x=input()
if x=='7' and x=='5' and x=='3':
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
import heapq

n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = sum(a[min(n, m):])
a = a[:min(n, m)]

if len(a) == 1 and n == 1:
    print(a[0]//2**m)
elif len(a) == 1:
    print(a[0]//2**m+ans)
else:
    a = [x*(-1) for x in a]
    heapq.heapify(a)
    for i in range(m):
        c = (heapq.heappop(a)*(-1)//2)*(-1)
        heapq.heappush(a, c)
    print(ans-sum(a))
# Judge status: Wrong Answer
N=int(input())
P=list(map(int,input().split()))
count=0
if P[0]!=1:
    count=count+1
elif P[N-1]!=N:
    count=count+1
for i in range(N-1):
    if P[i]+1!=P[i+1]:
        count=count+1
if count<5:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
x,l=int(input()),[0]*1001;l[1]=1
for i in range(2,int(x**0.5)+1):
  if l[i]==0:j=i*i
  while 1:
    if j>x:break
    else:l[j]=1;j*=i
for i in range(x,-1,-1):
  if l[i]==1:print(i);break
# Judge status: Wrong Answer
N, K = map(int,input().split())
A = list(map(int,input().split()))

import math
K = min(K, int(math.log(N))+2)
for k in range(K):
  light = [0] * (N+1)
  for i in range(N):
    start = max(0,i-A[i])
    end = min(N-1, i+A[i])
    light[start] += 1
    light[end+1] -= 1
  for i in range(1,N):
    light[i] += light[i-1]
    
  A = light

light.pop()
print(" ".join(map(str,light)))
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = [i for i in map(int,input().split())]
A.sort()

import bisect
for i in range(M):
  A[-1] //= 2
  A.insert(bisect.bisect(A,A[-1]),A[-1])
  A.pop()
  
print(sum(A))
# Judge status: Accepted
n, k = map(int, input().split())
p1 = list(map(int, input().split()))
p2 = sorted(p1)
p3 = sum(p2[:k])
print(p3)
# Judge status: Wrong Answer
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M = map(int, readline().split())
H = [0] + list(map(int, readline().split()))
A = [0]*(N+1)

m = map(int, read().split())
for a,b in zip(m,m):
	for _ in range(2):
		A[a] = max(A[a], H[b])
		a,b = b,a

print(sum(x>y for x,y in zip(A, H)))
# Judge status: Accepted
N = int(input())
a = {}
for i in range(N):
    a[i + 1] = int(input())

i = 1
cnt = 0
while True:
    next_i = a[i]
    cnt += 1
    if next_i < 1:
        print(-1)
        break
    elif next_i == 2:
        print(cnt)
        break

    a[i] = 0
    i = next_i
# Judge status: Wrong Answer
N = int(input())
S = list(input())
print(S)
ans = []
ans.append(len(set(S)))
for i in range(N):
    if i == 0:
        pass
    elif S[i] == S[i-1]:
        pass
    else:
        S_f = S[:i+1]
        S_b = S[i+1:]
        F = set(S_b)
        B = set(S_f)
        ans.append(len(F&B))
        
print(max(ans))
# Judge status: Accepted
D,T,S = map(int,input().split())

if D/S <= T:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
s = input()
print("2018" + s[:4])
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
num = [0 for i in range(N)]
ans = []
for i in A:
    num[i-1]+=1
sums = 0
print(num)
for i in A:
    num[i-1]-=1
    for j in range(N):
        if num[j] > 1:
            sums += 1/2*num[j]*(num[j]-1)
    ans.append(int(sums))
    sums = 0
    num[i-1]+=1

print(ans)
# Judge status: Accepted
n = int(input())
ABC = [tuple(map(int, input().split())) for i in range(n)]
A = [a for a, b, c in ABC]
B = [b for a, b, c in ABC]
C = [c for a, b, c in ABC]
DP = [[0 for j in range(3)] for i in range(n+1)]
for i in range(1, n+1):
    DP[i][0] = max(DP[i-1][1], DP[i-1][2])+A[i-1]
    DP[i][1] = max(DP[i-1][2], DP[i-1][0])+B[i-1]
    DP[i][2] = max(DP[i-1][0], DP[i-1][1])+C[i-1]
print(max(DP[n]))