peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import sys
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

x = int(input())

if is_prime(x):
    print(x)
    sys.exit()

for i in range(x,int(1e5)):
    for j in range(2,x):
        if i % j == 0:
            break
        elif j == x-1:
            print(i)
            sys.exit()

print(None)
# Judge status: Accepted
s = input()

howmany = len(s)
judge = "Yes"

for x in range(howmany):
  if x % 2 == 0:
    if s[x] != "R" and s[x] != "U" and s[x] != "D":
      judge = "No"
      break
  else:
    if s[x] != "L" and s[x] != "U" and s[x] != "D":
      judge = "No"
      break
      
print(judge)
# Judge status: Accepted
x,a,b=map(int, input().split())

if b<=a:
  print("delicious")
elif a+x>=b:
  print("safe")
else:
  print("dangerous")
# Judge status: Wrong Answer
N = int(input())
for i in range(N):
  if N < 2**i:
    print(2**(i-1))
    break
# Judge status: Accepted
N,M = map(int, input().split())
tmp = [False] * N
for _ in range(M):
  a,b = map(int, input().split())
  if a == 1:
    if tmp[b-1]:
      print('POSSIBLE')
      exit()
    else:
      tmp[b-1] = True
  elif b == N:
    if tmp[a-1]:
      print('POSSIBLE')
      exit()
    else:
      tmp[a-1] = True
print('IMPOSSIBLE')
# Judge status: Accepted
n, k= map(int, input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))
# Judge status: Accepted
import math
a, b, x = map(int, input().split())
vs = a*a*b
rem = vs - x
if rem > x:
    y = 2*x/(a*b)
    theta = math.degrees(math.atan2(b, y))
    print(theta)
else:
    y = 2*rem/(a*a)
    theta = math.degrees(math.atan2(y, a))
    print(theta)
# Judge status: Accepted
def main():
    N, M, K = map(int, input().split())

    for n in range(N + 1):
        for m in range(M + 1):
            overlap = 2 * n * m
            cnt = n * M + m * N - overlap
            if cnt == K:
                print("Yes")
                return
    else:
        print("No")
        return


main()
# Judge status: Accepted
S=list(input().split())
print("A"+S[1][0]+"C")
# Judge status: Accepted
N = int(input())
S = input()

add_left = 0
add_right = 0
for c in S:
    if c == '(':
        add_right += 1
    elif add_right == 0:
        add_left += 1
    else:
        add_right -= 1
ans = '(' * add_left + S + ')' * add_right
print(ans)
# Judge status: Accepted
#131_D
n=int(input())
ab=[tuple(map(int,input().split())) for _ in range(n)]
ab.sort(key=lambda x:x[1])

tmp=0
flg=True
for a,b in ab:
    tmp+=a
    if tmp>b:
        flg=False
        break
print('Yes' if flg else 'No')
# Judge status: Wrong Answer
a, b, c, d, e = map(int, input().split())
if a== 0:
    print(1)
elif b== 0:
    print(a)
elif c== 0:
    print(a+b)
elif d== 0:
    print(a+b+c)
elif e==0:
    print(a+b+c+d)
# Judge status: Accepted
S = str(input())
import collections

Q = collections.deque()

for i in range (0, len(S)):
	if S[i] == 'B':
		if len(Q) >= 1:
			D = Q.pop()
	else:
		Q.append(S[i])

T = str()
while Q:
	V = Q.popleft()
	T=T+V
    
print(T)
# Judge status: Accepted
a,b,c=map(int,input().split())
if a%2==0 or b%2==0 or c%2==0:
    print(0)
else:
    print(a*b*c//max(a,b,c))
# Judge status: Accepted
import math

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

print(math.ceil(n/x)*t)
# Judge status: Wrong Answer
a,b = map(int,input().split())
#lis = list(map(int,input().split()))
count = 0
if a>b:
    count += a
    a -= 1
else:
    count += b
    a -= 1
if a>b:
    count += a
    a -= 1
else:
    count += b
    a -= 1
print(count)
# Judge status: Accepted
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
v = V - W
sa = abs(A-B)
if v <= 0:
    print("NO")
else:
    if sa / v <= T:
        print("YES")
    else:
        print("NO")
# Judge status: Accepted
A = [int(i) for i in input().split()]

A.sort()
if A[0] + A[1] == A[2]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
from collections import Counter, defaultdict


def solve():
    N = int(input())
    
    A = [input() for _ in range(N)]
    count_A = Counter(A)
    
    M = int(input())
    B = [input() for _ in range(M)]
    count_B = Counter(B)
    for k,v in count_B.items():
        if k in count_A:
            count_A[k] -= v
    
    print(count_A.most_common()[0][1])
    
solve()
# Judge status: Accepted
from functools import reduce
s, t = input(), input()
ans = 10**9
for i in range(0, len(s) - len(t)+1):
    ans = min(ans, reduce(lambda x, a: x + (1 if a[0] != a[1] else 0), zip(s[i:], t), 0))
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())

if a==1:
    a=14

if b==1:
    b=14

print("Alice" if a>b else "Bob" if b>a else "Draw")
# Judge status: Wrong Answer
N=int(input())
p=[]
count=0
for i in range (N):
  a=int(input())
  p.append(a)
list.sort(p)
flag=1
for j in range (N-1):
  if p[j]==p[j+1]:
    flag*=-1
  else:
    if flag>0:
      count+=1
    else:
      count-=1
    flag=1
if flag>0:
  count-=1
else:
  count+=1
print(count)
# Judge status: Wrong Answer
n=int(input())
v=[int(input()) for i in range(n)]
m1=v[0]
m2=v[1]
if m2>m1:m1,m2=m2,m1
for i in v:
  if i > m1:
    m2=m1
    m1=i
  elif i>m2:
    m2=i
for i in v:
  print(m2 if i==m1 else m1)
# Judge status: Wrong Answer
a,b=map(int, input().split())
if a<b:
  print(a)
else:
  print(a-1)
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))

result = B[0]

for i in range(N - 2):
    A = min(B[i], B[i + 1])
    result += A

result += B[N - 2]

print(result)
# Judge status: Accepted
def main():
  S = input()
  x = S.count("a")
  y = S.count("b")
  z = S.count("c")
  if max(abs(x - y), abs(y - z), abs(z - x)) <= 1:
    print("YES")
  else:
    print("NO")

if __name__ == "__main__":
  main()
# Judge status: Accepted
import math

h = int(input())
cnt = 0
x = h

while x > 1:
    x = math.floor(x/2)
    cnt += 1

print(2**(cnt+1)-1)
# Judge status: Accepted
import numpy as np
import collections

N = int(input())
A = list(map(int, input().split()))
ans = 0
dists_A2i = []

for i in range(1, N+1):
    dist_A2i = A[i-1] - i
    dists_A2i.append(dist_A2i)

dists_A2i = np.array(dists_A2i)
dists_median = np.median(dists_A2i)
dists_A2i = abs(dists_A2i - dists_median)
ans = sum(dists_A2i)
print(int(ans))
# Judge status: Accepted
# ABC148D - Brick Break

import bisect

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

ans=0
for i in a:
    if ans+1==i:
        ans=i

#print(ans)
if ans:
    print(n-ans)
else:
    print(-1)
# Judge status: Accepted
c = input()

print(chr(ord(c) + 1))
# Judge status: Accepted
x, y, z = map(int, input().split())

print((x-z)//(y+z))
# Judge status: Accepted
def main():
    A, B, K = map(int, input().split())
    if 2*K > B - A:
        for j in range(A, B + 1):
            print(j)
    else:
        for i in range(A, A + K):
            print(i)
        for j in range(B-(K-1), B + 1):
            print(j)
main()
# Judge status: Wrong Answer

S=0
for i in range(3):
    a=list(map(int,input().split()))
    S+=sum(a)

if S%3==0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,m=map(int,input().split())

l=[]
t=""
w=0
ww=0
a=0
for i in range(m):
    p,s=input().split()
    if(p in l):continue
    if(s=="WA"):
        w+=1
        ww+=1
    if(s=="AC"):
        ww=0
        a+=1
        l.append(p)
print(a,w-ww)
# Judge status: Accepted
# coding: utf-8
# Your code here!
import bisect

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

A=list(map(int,input().split()))
B=list(map(int,input().split()))

sum_A=[0]
for i in range(N):
    sum_A.append(sum_A[-1]+A[i])


sum_B=[0]
for i in range(M):
    sum_B.append(sum_B[-1]+B[i])

ans=0
for i in range(N+1):
    target=K-sum_A[i]
    if target>=0:
        j=bisect.bisect(sum_B,target)
        ans=max(ans,i+j-1)

print(ans)
# Judge status: Accepted
no=int(input())
temp=no
th=0
f=0
if(temp>=500):
  th=temp//500
  temp=temp%500

if(temp>=5):
  f=temp//5
  temp=temp%5

print((th*1000)+(f*5))
# Judge status: Wrong Answer
K, X = input().split()
K = int(K)
X = int(X)
print("YES" if K * 500 >= X else "NO")
# Judge status: Accepted
import math

x = int(input())
n = 100
resp = 0
while n < x:
    n = int(n * 1.01)
    resp += 1
print(resp)
# Judge status: Accepted
import sys
readline = sys.stdin.readline
 
N,M = map(int,readline().split())
from collections import defaultdict
tasks = defaultdict(list)
for i in range(N):
  a,b = map(int,readline().split())
  tasks[a].append(b)
  
import heapq as hq
q = []
ans = 0
for i in range(1, M + 1):
  newtask = tasks[i]
  for t in newtask:
    hq.heappush(q,-t)
  if q:
    ans += -hq.heappop(q)
 
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
n = int(input())
pre = -float('inf')
ans = 0
x = [0] * n
for i in range(n):
    x[i] = tuple([int(x) for x in input().strip().split()])

x.sort()
for xx in x:
    if pre > xx[0] - xx[1]:
        continue
    ans += 1
    pre = xx[0] + xx[1]
print(ans)
# Judge status: Accepted
from fractions import gcd
from math import sqrt
from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush
from copy import deepcopy
from itertools import accumulate,permutations
from bisect import bisect_left,bisect_right

S = input()

flag = False
for sta in range(len(S)):
    for end in range(sta,len(S)):
        if S[:sta] + S[end:] == "keyence":
            flag = True

if flag:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
A=list(map(int,input().split()))
if (A[0]==A[1]==A[2]) or (A[0]!=A[1]!=A[2]):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
N=str(input())
if 'L' in N[0::2] or 'R' in N[1::2]:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if all(a[i]==b[i] for i in range(n)):
    print("Yes")
elif sum(a)==sum(b):
    print("No")
elif sum(b)<sum(a):
    print("No")
else:
    if (sum(b)-sum(a))%2==0:
        print("No")
    else:
        print("Yes")
# Judge status: Accepted
N = int(input())
total = [int(input()) for i in range(N)]
non = []
for i in range(N):
  if total[i] % 10 != 0:
    non.append(total[i])
if len(non):
  if sum(total) %10 != 0:
    ans = sum(total)
  else:
    ans = sum(total)-min(non)
else:
  ans = 0
print(ans)
# Judge status: Accepted
d,n=map(int,input().split())
if n<100:
    print(n*(100**d))
else:
    print(101*(100**d))
# Judge status: Wrong Answer
import numpy as np

n,W = map(int,input().split())
w,v = [0] * n, [0] * n
for i in range(n):
    w[i] , v[i] = map(int,input().split())
 

dp = np.zeros((W + 1))

for _w, _v in zip(w, v):
	np.maximum(dp[_w:], dp[:-_w] + _v, out=dp[_w:])
print(dp[-1])
# Judge status: Wrong Answer
N = int(input())
a= list(map(int,input().split()))
b= list(map(int,input().split()))
c = [a[i]-b[i] for i in range(N)]
d=sum(b)-sum(a)   #c回試行する
if d<0:
  print("No")
  exit()
  
must=0
cnt=0
for num in c:
  if num>0:
    must += abs(num)
  if num>=2:
    cnt += num//2
if must>d:
  print("No")
  exit()

#chokin = 2*must
nokori = d-must
if cnt<must:
  print("No")
else:
  print("Yes")
#print(chokin,nokori)
# Judge status: Accepted
n=int(input())
a=int(input())
if n%500<=a:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A, B, K = [int(i) for i in input().split()] 

ans = []
for i in range(1, 101):
    if A % i == 0 and B % i == 0:
        ans.append(i)
        
print(ans[-K])
# Judge status: Accepted
N = int(input())
a = [int(i) for i in input().split()]
sunuke = a[0]
arai = sum(a[1:])
if N == 2:
    print(abs(a[0] - a[1]))
else:
    ans = float('inf')
    for i in range(1, N-1):
        sunuke += a[i]
        arai -= a[i]
        ans = min(ans, abs(sunuke - arai))

    print(ans)
# Judge status: Accepted
x, y = map(int, input().split())
if y == 0 and x <= 0:
    print(abs(x-y))
elif x >= 0 and y == 0:
    print(abs(x-y)+1)
elif x >= 0 and y >= 0:
    if x <= y:
        print(abs(x-y))
    else:
        print(abs(x-y)+2)
elif x <= 0 and y >= 0:
    print(abs(y-abs(x))+1)
elif x >= 0 and y <= 0:
    print(abs(x-abs(y))+1)
elif x <= y:
    print(abs(x-y))
else:
    print(abs(x-y)+2)
# Judge status: Wrong Answer
N,M = map(int,input().split())
AB = []
for _ in range(N):
  a,b = map(int,input().split())
  AB.append([b,a])
AB.sort(reverse=True)
ans = 0
for b,a in AB:
  if a<=M:
    ans += b
    M -= 1
  if M == 0:break
print(ans)
# Judge status: Accepted
S = input()
while True:
  S = S[:-1]
  if len(S)%2==0 and S[:len(S)//2]*2==S:
    print(len(S))
    break
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))

idx = 0
for i in range(N):
  if A[i] == 1:
    idx = i
    break

ans = 0
# Left
if (N-idx-K) % (K-1) == 0:
  ans += (N-idx-K)//(K-1)+1
else:
  ans += (N-idx-K)//(K-1)+1+1
# Right
if ((idx+1)-K) % (K-1) == 0:
  ans += ((idx+1)-K)//(K-1)+1
else:
  ans += ((idx+1)-K)//(K-1)+1+1
print(ans)
# Judge status: Accepted
def main():
    a, b, c, d = map(int, input().split())
    if abs(a-c) <= d:
        print("Yes")
    elif abs(a-b) <= d and abs(b-c) <= d:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
X, Y = map(int, input().split())
print(-1 if Y % X == 0 else X)
# Judge status: Accepted
import math

def is_ok(A, x, K):
  cut_count = 0
  for number in A:
    cut_count += (math.ceil(number / x)) - 1
  return cut_count <= K

A = []
[N, K] = input().split()
N = int(N)
K = int(K)
A = input().split()
ans = 0

l = 0
r = 10 ** 9

for i in range(N):
  A[i] = int(A[i])

while r - l > 1:
  x = (r + l) // 2
  if is_ok(A, x, K):
    r = x
  else:
    l = x
      
print(r)
# Judge status: Accepted
import heapq

K = int(input())
q = [i for i in range(1, 10)]
ans = []
for i in range(K):
  n = heapq.heappop(q)
  ans += [n]
  stn = str(n)
  last = (stn[-1])
  cand1 = int(str(n) + last)
  heapq.heappush(q, cand1)
  if 0 < int(last):
    cand2 = int(str(n) + str(int(last)-1))
    heapq.heappush(q, cand2)
  if int(last) < 9:
    cand3 = int(str(n) + str(int(last)+1))
    heapq.heappush(q, cand3)

print(ans[-1])
# Judge status: Wrong Answer
N, L = map(int,input().split())
l = []
for i in range(N):
    l.append(input())

l.sort
result = ''.join(l)
print(result)
# Judge status: Accepted
S = [i for i in list(input())]
N = len(S)
k = [i for i in list('keyence')]

for d in range(N-6):
    for i in range(N-(d-1)):
        s = S[:i] + S[i+d:]
        if s==k:
            print('YES')
            quit()
print('NO')
# Judge status: Accepted


N, M = map(int, input().split())
tree = [[] for _ in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

for i in range(N):
    print(len(tree[i]))
# Judge status: Accepted
n=int(input())
if n%2==1:
    print(0)
    exit(0)

k=n//2

from math import floor

ans=0
deno=5
while deno<=k:
    ans+=k//deno
    deno*=5

print(ans)
# Judge status: Wrong Answer
n = int(input())
l = [input() for _ in range(n)]
s = set(l)
if(len(l) != len(s)):
    print('No')
    exit()
for i in range(1,n):
    if(l[i][0] != l[i][-1]):
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
n, m = list(map(int, input().split()))
a = set(list(int(input()) for _ in range(m)))
mod = 1000000007
 
memo = [0]*(n+1)
memo[0] = 1

for i in range(1, n+1):
    memo[i] = memo[i-1] + memo[i-2]
    if i in a:
        memo[i] = 0
print(memo[-1]%mod)
# Judge status: Wrong Answer
N, K = map(int, input().split())
work = list(map(int, input().split()))

for k in range(0, K):
    A = work
    work = [0] * N
    for i in range(0, N):
        for j in range(1, A[i] + 1):
            index = i - j
            if (index >= 0):
                work[index] += 1
        work[i] += 1
        for j in range(1, A[i] + 1):
            index = i + j
            if (index < N):
                work[i + j] += 1
print(work)
# Judge status: Accepted
d = int(input())

if d == 25:
    print('Christmas')
elif d == 24:
    print('Christmas Eve')
elif d == 23:
    print('Christmas Eve Eve')
else:
    print('Christmas Eve Eve Eve')
# Judge status: Accepted
import math

a, b = map(str, input().split())

ab = int(a + b)

if math.sqrt(ab).is_integer():
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,k = readInts()
    A = readInts()

    Alen = len(A)
    nokori = Alen - k
    print(1 + nokori // (k-1) + nokori % (k-1))




if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
x,y=map(int,input().split())
a=(2*x-y)/3
b=(-x+2*y)/3
if (2*x-y)%3!=0:
    print(0)
    exit()
a=int(a)
b=int(b)
if a<0 or b<0:
  print(0)
  exit()
mod=10**9+7
if a==0 or b==0:
  print((a+b)%mod)
  exit()
def comb(x,y):
    s=x
    t=1
    for i  in range(1,y):
        s=(s*(x-i))%mod
    for j  in range(1,y+1):
        t=(t*j)%mod
    return (s*pow(t,mod-2,mod))%mod
print(comb(a+b,min(a,b)))
# Judge status: Wrong Answer
N,K = map(int, input().split())
p = list(map(int, input().split()))

p.sort()
r = sum(p[0:3])

print(r)
# Judge status: Accepted
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
count = 0
ans = 0

X = int(input())

if X >= 400 and X < 600:
    print(8)
if X >= 600 and X < 800:
    print(7)
if X >= 800 and X < 1000:
    print(6)
if X >= 1000 and X < 1200:
    print(5)
if X >= 1200 and X < 1400:
    print(4)
if X >= 1400 and X < 1600:
    print(3)
if X >= 1600 and X < 1800:
    print(2)
if X >= 1800 and X < 2000:
    print(1)
# Judge status: Accepted
S = list(input())
S[3] = "8"
print("".join(S))
# Judge status: Wrong Answer
N, K = [int(x) for x in input().split(" ")]

placed = 0
for i in range(N):
  a, b = [int(n) for n in input().split(" ")]
  placed += b
  if placed >= K:
    print(a)
    break
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()



def main():
	n,x,t=MI()
	y=(n-1)//x+1
	print(y*t)







if __name__ == "__main__":
	main()
# Judge status: Wrong Answer
import bisect

N = int(input())
INF = (10**5)+1
A = []
for i in range(N):
    a = int(input())
    A.append(a)

B = [A[-1]]
for i in range(N-2,-1,-1):
    a = A[i]
    if B[-1] > a:
        del B[-1]
        bisect.insort_left(B,a)
    else:
        bisect.insort_left(B,a)



print(len(B))
# Judge status: Wrong Answer
S=input()
T=input()

Rs = {}

for s,t in zip(S,T):
    
    if s in Rs.keys() and Rs[s] != t:
        print("No")
        exit()
    if not s in Rs.keys():
        Rs[s] = t

res = [""] * len(S)
for i,s in enumerate(S):
    res[i] = Rs[s]

print("Yes" if "".join(res)==T else "No")
# Judge status: Accepted
N, M = map(int,input().split())
p = []
for i in range(M):
    s = list(map(int,input().split()))
    p.append(s + [i])
p.sort()
cur = p[0][0]
cnt = 1
for i in range(M):
    if p[i][0] > cur:
        cur = p[i][0]
        cnt = 1
    p[i][1] = cnt
    cnt += 1
p.sort(key=lambda x: x[2])
for i in range(M):
    print("0" * (6 - len(str(p[i][0]))) + str(p[i][0]) + "0" * (6 - len(str(p[i][1]))) + str(p[i][1]))
# Judge status: Accepted
import bisect

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

ans = 0
A.sort()
C.sort()
for b in B:
    ans += bisect.bisect_left(A, b)*(N-bisect.bisect_right(C, b))
print(ans)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int,input().split()))
ijk = 0
for i in range(N):
    for j in range(i,N):
        for k in range(j,N):
            if L[i] != L[j] and L[j] != L[k]:
                if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j]:
                    ijk+=1
print(ijk)
# Judge status: Wrong Answer
N, M = map(int, input().split())

if (M - N * 2) >= 0:
    print(N + (M - N * 2)//4)
else:
    print(0)
# Judge status: Accepted
H=int(input())
ans=0
tmp=1
#print("H:",H)
#while H<1:
while H>=1:
    H//=2
    ans+=tmp
    tmp*=2
    #print("H:",H)
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for _ in range(n)]

dp = [0] * n
dp[0] = a[0] // 2
for i in range(1, n):
    dp[i] = max(dp[i-1] + a[i]//2, min(a[i-1], a[i]))

print(dp[-1])
# Judge status: Accepted
n , m = map(int,input().split())
M =set(range(m+1))
for _ in range(n):
    table = list(map(int,input().split()))
    M &= set(table[1:])

answer = len(M)
print(answer)
# Judge status: Accepted
N = int(input())
ans = 0

for i in range(1,N+1):
    ans += i
    
print(ans)
# Judge status: Accepted
input1 = len(input())
print("x"*input1)
# Judge status: Wrong Answer
from fractions import gcd
from math import ceil,sqrt
a, b = map(int, input().split())

g = gcd(a,b)

s = set()
for i in range(2,ceil(sqrt(g))+1):
    while g % i == 0:
        g //= i
        s.add(i)
if len(s) == 0 and g != 1:
    s.add(g)
#print(g)
#print(s)
print(len(s)+1)
# Judge status: Accepted
import sys
n = int(input())
s = input()
d = int(n/2)
if(len(s)%2 == 1):
    print("No")
    sys.exit()
else:
    for i in range(d):
        if(s[i] != s[i + d]):
            print("No")
            sys.exit()

print("Yes")
# Judge status: Accepted
N = int(input())

def check():
    if N==3 or N==5 or N==7:
        return True
    return False
if check():
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import itertools
import math

N = int(input())
xy  = [[int(i) for i in input().split()] for j in range(N)]
distance = [[0 for j in range(N)] for i in range(N)]
for i in range(N):
    for j in range(N):
        xi = xy[i][0]
        yi = xy[i][1]
        xj = xy[j][0]
        yj = xy[j][1]
        d = math.sqrt((xi-xj)**2+(yi-yj)**2)
        distance[i][j] = d
        distance[j][i] = d

print(sum([sum(i) for i in distance])/N)
# Judge status: Accepted
h, n = map(int,input().split())
a = list(map(int,input().split()))

if h > sum(a):
    print("No")
else:
    print("Yes")
# Judge status: Accepted
N = int(input())
T, A = map(int,input().split())
H = list(map(int, input().split()))

n = 0
t_best = 100000
for i in range(N):
    if abs(A - (T-H[i]*0.006)) < t_best:
        t_best = abs(A - (T-H[i]*0.006))
        n = i+1
    
print("{}".format(n))
# Judge status: Wrong Answer
n,k=map(int,input().split())
ans=0
while n>k:
  n/=k
  n=int(n)
  ans+=1

print(ans+1)
# Judge status: Accepted
n,k = map(int,input().split())
A = list(map(int,input().split()))
L = [0] * n
ans = 0

for a in A:
  L[a-1] += 1
L = sorted(L)
for i in range(n-k):
  ans += L[i]

print(ans)
# Judge status: Wrong Answer
def ABC_113_A():
    X,Y = map(int, input().split())
    print(X+Y/2)
   

if __name__ == '__main__':

    ABC_113_A()
# Judge status: Accepted
import sys

N = int(input())
s = [int(input()) for _ in range(N)]
ss = sum(s)
s.sort()

if ss % 10 != 0:
    print(ss)
    sys.exit()

for p in s:
    if p % 10 != 0:
        print(ss - p)
        break
else:
    print(0)
# Judge status: Accepted
import fractions
import itertools
from functools import reduce

n = int(input())
a = [int(x) for x in input().split()]

l = [0]*(n+1)
r = [0]*(n+1)

for i in range(n):
    l[i+1] = fractions.gcd(l[i], a[i])
    r[n-i-1]= fractions.gcd(r[n-i], a[n-i-1])

ans = 0
for i in range(n):
    ans = max(fractions.gcd(l[i], r[i+1]), ans)

print(ans)
# Judge status: Accepted
N = int(input())
abc = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * 3 for _ in range(N + 1)]
dp[0][0] = 0
dp[0][1] = 0
dp[0][2] = 0
for i in range(1, N + 1):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i][j] = max(dp[i][j], dp[i - 1][k] + abc[i - 1][j])
print(max(dp[-1]))