peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
temp = [[0] * M] * N

result = 0
count = 0
for i in range(0, len(A)):
    temp[i][0] = A[i]
    if temp[i][0] <= K:
        result = max(result, temp[i][0])
        count = i + 1
    for j in range(1, len(B)):
        temp[i][j] = temp[i][j-1] + B[j]
        if temp[i][j] <= K:
            result = max(result, temp[i][j])
            count = i + j + 2
print(count)
# Judge status: Accepted
S = input()
N = len(S)

if S == "keyence":
    print("YES")
    exit()

for i in range(N):
    for j in range(i, N):
        s = S[:i] + S[j + 1:]
        # print(s)
        if s == "keyence":
            print("YES")
            exit()

print("NO")
# Judge status: Accepted
N = input()
d = len(N)
A = int(N[0])-1 + (d-1)*9
B = 0
for i in N:
    B += int(i)
print(max(A,B))
# Judge status: Accepted
x = int(input())

d, m = divmod(x, 11)
d *= 2

if m >= 7:
    d += 2
elif m >= 1:
    d += 1
print(d)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for i in range(a+1):
	for j in range(b+1):
		for k in range(c+1):
			ans = (i * 500) + (j * 100) + (k * 50) 
			if ans == x:
				count = count + 1
print(count)
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

res1 = a * c
res2 = a * d
res3 = b * c
res4 = b * d
ans = max(res1, res2, res3, res4)
print(ans)
# Judge status: Wrong Answer
nn = input()

carry = []
ans = 0
cnt = 0
for i in range(len(nn))[::-1]:
    n = int(nn[i])
    tmp = n
    if tmp <= 10 - tmp:
        ans += tmp
#        ans -= carry
        carry.append(0)
    else:
        ans += 10 - tmp
        carry.append(1)
    # print(ans, tmp, carry)
print(ans + sum(carry[-2:]))
# Judge status: Wrong Answer
c, a, b = map(int, input().split())
print(a*c/2)
# Judge status: Accepted
n, b, r = map(int, input().split())

if b == 0:
    print(0)
elif r == 0:
    print(n)
else:
    k = n // (b + r)
    q = n % (b + r)
    print(b * k + min(q, b))
# Judge status: Wrong Answer
n = int(input())
n1 = list(map(int,input().strip().split(' ')))
n2 = list(map(int,input().strip().split(' ')))

path = []
path.append(n1)
path.append(n2)

sum_list = []

for i in range(n):
    sum = 0
    for j in range(i+1):
        sum += path[0][j]

    for k in range(i,n):
        sum += path[1][k]
    
    sum_list.append(sum)
    
print(sum_list)
print(max(sum_list))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
colors = [0]*9
for ai in a:
  if ai >= 3200:
    colors[8] += 1
  else:
    colors[ai//400] = 1
    
cmin = max(1, sum(colors[0:8]))
cmax = sum(colors)

print(cmin, cmax)
# Judge status: Accepted
n, k, q = map(int, input().split())
#a = [int(input()) for _ in range(q)]
ans = [k - q] * n

for i in range(q):
    ans[int(input()) - 1] += 1

for t in ans:
    if t > 0:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if (A-B) * (B-C) < 0:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
s = input()
s = input()
x = 0
l_x = []
for c in s:
  x += 1 if c == 'I' else -1
  l_x.append(x)
    
print(max(l_x))
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
x = Counter(a)
cnt = sorted(x.items(), key=lambda x: x[0], reverse=True)
ans = 0
for i in range(len(cnt)):
    x = cnt[i][1]
    print(x)
    if i != 0:
        if cnt[i][0] == cnt[i-1][0] - 1:
            x += cnt[i-1][1]
    if i != len(cnt) - 1:
        if cnt[i][0] == cnt[i+1][0] + 1:
            x += cnt[i+1][1]
    ans = max(ans, x)
print(ans)
# Judge status: Wrong Answer
N = int(input())
c = N - 1
for i in range(2,N):
    if N %i != 0:
        for j in range(1,N):
            if i * j >= N:
                break
            else:
                c += 1
print(c)
# Judge status: Accepted
r, g, b = map(int, input().split())

result = int("{}{}{}".format(r,g,b))
if result % 4 == 0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
N, M = map(int, input().split())
D = [[] for _ in range(N)]
for i in range(M):
    P, Y = map(int, input().split())
    D[P - 1].append((Y, i))
ans = [None] * M
for i, d in enumerate(D):
    d.sort()
    for k, (Y, j) in enumerate(d):
        ans[j] = "%06d%06d" % (i + 1, k + 1)
print(*ans, sep='\n')
# Judge status: Accepted
N=int(input())
M=int(pow(N, 1/2))
ans=[0]*(N+1)
for x in range(1, M+1):
  for y in range(1, M+1):
    for z in range(1, M+1):
      tmp=x**2+y**2+z**2+x*y+y*z+z*x
      if tmp<=N:
        ans[tmp]+=1
print(*ans[1:], sep='\n')
# Judge status: Wrong Answer
from collections import deque

N,M,K=map(int,input().split())
A_list=list(map(int,input().split()))
B_list=list(map(int,input().split()))
A=deque(A_list)
B=deque(B_list)
time = 0
cnt = 0
while time <= K:
  if len(A) == 0 and len(B) == 0:
    break
  elif len(A) == 0:
    tmp = B.popleft()
  elif len(B) == 0:
    tmp = A.popleft()
  elif A[0]<B[0]:
    tmp = A.popleft()
  else:
    tmp = B.popleft()
  time += tmp
  if time > K:
    break
  cnt += 1
#  print(time,A,B)
print(cnt)
# Judge status: Accepted
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = min(a) + min(b)

for _ in range(M):
  x, y, c = map(int, input().split())
  ans = min(ans, a[x-1] + b[y-1] - c)

print(ans)
# Judge status: Wrong Answer
N=int(input())
a=list(map(int, input().split()))
ans = 0
for i in range(N):
  d = 0
  while (a[i] %2 == 0):
    d += 1
    a[i] //= 2
  ans = min(d,ans)
print(ans)
# Judge status: Accepted
A,B,K = map(int, input().split())

ans = []

if A <= B:
    for i in range(1,B+1):
        if A % i == 0 and B % i ==0:
            ans.append(i)
else:
    for j in range(1,A+1):
        if A % j == 0 and B % j ==0:
            ans.append(j)

print(ans[-K])
# Judge status: Accepted
N = int(input())
if N%2 == 1:
    print(0)
else:
    c = 0
    k = 10
    while k <= N:
        c += (N // k) 
        k *= 5
    print(c)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)

ans = 0
for i in range(1,N):
    ans += A[i//2]
print(ans)
# Judge status: Accepted
n,k=map(int,input().split(" "))
a=[int(i)-1 for i in input().split(" ")]
was=[False]*n
pos=0
while k>0 and not was[pos]:
    was[pos]=True
    pos=a[pos]
    k-=1
if k>0:
    was=[False]*n
    cyc=0
    while not was[pos]:
        was[pos]=True
        pos=a[pos]
        cyc+=1
    k%=cyc
while k>0:
    pos=a[pos]
    k-=1
print(pos+1)
# Judge status: Accepted
li=sorted(list(map(int,input().split())))
a=li.pop(-1)
k=int(input())
a=a*(2**k)
for i in li:
  a+=i
print(a)
# Judge status: Accepted
def main():
    import sys
    from collections import defaultdict

    def input(): return sys.stdin.readline().rstrip()

    s = input()
    n = len(s)
    k = int(input())
    for i in range(n):
        tmp = (ord('a')-ord(s[i]))%26
        if tmp > k:
            continue
        k -= tmp
        s = s[:i]+'a'+s[i+1:]
    s = s[:-1]+chr((ord(s[-1])+k%26-ord('a'))%26+ord('a'))
    print(s)

    
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n,m,q=map(int,input().split())
lis=[]
for i in range(q):
    a,b,c,d=map(int,input().split())
    lis.append((a,b,c,d))
    
from itertools import combinations_with_replacement

co=list(combinations_with_replacement(range(1,11),10))

ans=0
for status in co:
    tmp_score=0
    for a,b,c,d in lis:
        if status[b-1]-status[a-1]==c:
            tmp_score+=d
    ans=max(ans,tmp_score)
print(ans)
# Judge status: Accepted
a = int(input())
b = [1,2,3,5,6,9,10,13,17]
if a in b:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
a,b = map(int,input().split())
s = input()

n = len(s)

if s[a] == "-" and s.count("-") == 1:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for _ in range(n)]

count = 1
i = 0

while count < n:
  i = a[i] - 1
  if i == 1:
    print(count)
    break
  count += 1
print(-1)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i + 100*j + 50*k == x:
        ans += 1
print(ans)
# Judge status: Wrong Answer
A=int(input())
Sum= A*(A+1)/2
B=(A//3)
C=(A//5)
D=(A//15)

E=B*(6+(B-1)*3)/2
F=C*(10+(C-1)*5)/2
G=D*(30+(D-1)*15)/2

print(Sum-E-F+G)
# Judge status: Accepted
a,b,c=map(int,input().split())
x=0
for i in range(1,b+1):
    if i*a%b==c:
        x+=1
if x==0:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
s = input()
t = input()

res = 1000
for i in range(len(s)-len(t)+1):
  tmp = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      tmp += 1
  res = min(res, tmp)

print(res)
# Judge status: Accepted
def main():
    n = int(input())
    x = list(map(int,input().split()))
    s = sorted(x)
    m1 = s[n//2-1]
    m2 = s[n//2]

    for i in x:
        if i<=m1:
            print(m2)
        else:
            print(m1)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
x=int(input())

if x>=30:
    print("yes")
else:
    print("No")
# Judge status: Accepted
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

def main():
    n = int(input())
    a = list(map(int, input().split()))
    r = sum(a)
    l = 0
    ans = r
    for i in a:
        l += i
        r -= i
        ans = min(ans, abs(r - l))
        if l >= r:
            break
    print(ans)

main()
# Judge status: Wrong Answer
N=int(input())
s=0
A=list(map(int,input().split()))
li=[0]*(2*(10**5)+1)
for i in range(N):
    li[A[i]]+=1
for j in range(N):
    s+=li[j]*(li[j]-1)//2
for k in range(N):
    print(s-(li[A[k]]*(li[A[k]]-1))//2+((li[A[k]]-1)*(li[A[k]]-2))//2)
# Judge status: Wrong Answer
A,B = map(int,input().split())
print(max(A,B)+max(A-1,B-1))
# Judge status: Wrong Answer
S=list(input())
count=0
hp=round(len(S)/2)
S1,S2=S[0:hp-1],S[:hp-1:-1]

for i in range(hp-1):
  if S1[i]!=S2[i]:
    count+=1

print(count)
# Judge status: Accepted
import math
n,a,b,c,d,e = map(int, open(0).read().split())
print(math.ceil(n/min(a,b,c,d,e))+4)
# Judge status: Accepted
N = int(input())

if (N % 10 == 9 or N // 10 == 9):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
X=int(input())

def is_prime(n):
    if n==1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

for i in range(X,1000000):
    if is_prime(i):
        print(i)
        break
# Judge status: Accepted
A = input()
B = input()
C = input()
abc = [0,0,0]
now = 0
ABC = [A,B,C]
ans = 'ABC'
while True:
    if abc[now] == len(ABC[now]):
        print(ans[now])
        break
    if ABC[now][abc[now]] == 'a':
        abc[now] += 1
        now = 0
    elif ABC[now][abc[now]] == 'b':
        abc[now] += 1
        now = 1
    else:
        abc[now] += 1
        now = 2
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = sorted(map(int, input().split()), reverse=True)

var = sum(A) // (4*M) 
if A[M-1] >= var:
        print('Yes')
else:
        print('No')
# Judge status: Wrong Answer
C = str(input())

if C[0] == C[1] and C[1] == C[1] and C[1] == C[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math
X = int(input())
Y = X
x = 1
y = 0
K = 1
while x != 0 or y != 0:
    x = round(x + math.cos(math.radians(X)),6)
    y = round(y + math.sin(math.radians(X)),6)
    X = X + Y 
    K += 1
print(K)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

x = sum(B)-sum(A)

one = 0
two = 0

for i in range(N):
    if A[i] > B[i]:
        one += A[i]-B[i]
    if A[i] < B[i]:
        two += (B[i]-A[i])//2
        if (B[i]-A[i])%2 == 1:
            one += 1

if one<=x and two<=x:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
ans=1
tmp=0
for i in range(1,n):
  if (a[i]-a[i-1])*tmp<0:
    ans+=1
    tmp=0
  elif not a[i]-a[i-1]==0:
    tmp=a[i]-a[i-1]
print(ans)
# Judge status: Accepted
N = int(input())
ans = 0
for i in range(1, N+1):
    k = N//i
    ans += (i + k*i)*k//2
print(ans)
# Judge status: Wrong Answer
n=int(input())
Aseq=input().split()
A=[]
for i in range(n):
    A.append(int(Aseq[i]))
A.sort()
AA=A[0::2]
AB=A[1::2]
print(sum(AA)-sum(AB))
# Judge status: Accepted
N, M = map(int, input().split())
def mod_factorial(a, mod):
    ans = 1
    while a != 1:
        ans *= a
        ans = ans % mod
        a -= 1
    return ans

mod = 10**9 + 7
if abs(N - M) > 1:
    print(0)
elif abs(N - M) == 0:
    ans = mod_factorial(N, mod) * mod_factorial(M, mod) * 2
    print(ans % mod)
else:
    ans = mod_factorial(N, mod) * mod_factorial(M, mod)
    print(ans % mod)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
print("No" if (a<c and c<b) or (b<c and c<a) else "Yes")
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split()))
M = 1000000007
sm = 0
for i in l:
	sm = (sm + i)
sms = pow(sm,2,M)
ss = 0
for i in range(n):	
	ss = (ss + (l[i] * l[i]))
print(((sms - ss)//2)%M)
# Judge status: Accepted
s = list(input())
s1 = s.copy()
s2 = s.copy()
c1 = 0
c2 = 0
for i in range(len(s1)-1):
    if s1[i] == s1[i+1]:
        c1 += 1
        s1[i+1] = '0' if s1[i] == '1' else '1'
for j in range(len(s2)-1, 0, -1):
    if s2[j] == s2[j-1]:
        c2 += 1
        s2[j-1] = '0' if s2[j] == '1' else '1'
print(min(c1, c2))
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**6)
A,B = map(int,input().split())
cnt = 1
while True:
    if (B - (A + (A - 1) * cnt) <= 0):
        break
    else:
        cnt += 1

if A >= B:
    print(1)
else:
    print(cnt + 1)
# Judge status: Accepted
def main():
    n = int(input())
    As = sorted(list(map(int, input().split())))
    edeges = []
    i = 0
    while i < n-1:
        if As[i] == As[i+1]:
            edeges.append(As[i])
            i += 1
        i += 1
    if len(edeges) < 2:
        ans = 0
    else:
        ans = edeges[-1] * edeges[-2]
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
from math import log
n = int(input())


def make_list(n, x):
    return [x ** i for i in range(1, int(log(n, x))+1)]


sixes = make_list(n, 6)
nines = make_list(n, 9)
nums = [1] + sixes + nines

dp = [float('inf')] * (n+1)
for num in nums:
    for i in range(n+1):
        if i <= num and i % num == 0:
            dp[i] = min(dp[i], i // num)
        else:
            dp[i] = min(dp[i], dp[i-num]+1)
print(dp[n])
# Judge status: Wrong Answer
N = list(map(int, input().split()))
A = list(map(int, input().split()))

isApprove = True

for x in A:
    if x % 2 == 0:
        if (x % 3 != 0) or (x % 5 != 0):
            isApprove = False
            break
        
if isApprove:
    print ('APPROVED')
else:
    print('DENIED')
# Judge status: Wrong Answer
N = int(input())
i = 1
while i <= N:
    i *= 2
print(N//2)
# Judge status: Accepted
from collections import deque
N = int(input())

alphabet = "abcdefghij"
visited = 1
st = deque([["a", visited]])

while len(st) > 0:
    str, visited = st.popleft()

    if len(str) == N:
        print(str)
    else:
        # すでに使った文字を使う
        for x in alphabet[0 : visited]:
            st.append([str + x, visited])
        # まだ使っていない文字を使う
        # len(str) < Nだから、visited < N
        st.append([str + alphabet[visited], visited + 1])
# Judge status: Accepted
a = True
n = int(input())
p = input()
s = {p}
for i in range(n-1):
    c = input()
    if p[-1] != c[0] or c in s:
        a = False
    else:
        p = c
        s.add(p)
if a:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
from collections import deque

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    alpahbet = [chr(ord("a") + i) for i in range(26)]

    ans = []
    while N:
        N -= 1
        ans.append(alpahbet[N % 26])
        N //= 26

    print(*ans[::-1], sep="")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
from math import gcd
a, b = map(int, input().split())

gcd = gcd(a, b)
ans = 1
for i in range(2, int(gcd**0.5) + 2):
    if gcd%i == 0:
        ans += 1
        while gcd%i == 0:
            gcd //= i
    if gcd < i:
        break
if ans == 1 and gcd != 1:
    ans = 2
print(ans)
# Judge status: Wrong Answer
N = int(input())

Ans = [2 * i for i in range(N+1)]
Ans[0] = 0
Ans[1] = 1
ans = 0
for i in range(2, N):
    if i * 2 > N:
        break
    for j in range(2 * i, N+1, i):
        Ans[j] += j
        ans += j

print(ans)
# Judge status: Wrong Answer
s = input()
count = 0
for i in range(len(s)):
    for j in range(len(s)):
        if j-i >= 3:
            ss = s[i:j+1]
            if int(ss) % 2 == 0:
                break
            if int(ss) % 2019 == 0:
                count += 1
print(count)
# Judge status: Accepted
N = int(input())
L = list(map(int, input().split()))

cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        for k in range(j + 1, N):
            if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
                if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[i] + L[k] > L[j]:
                    cnt += 1

print(cnt)
# Judge status: Accepted
N, K, S = map(int, input().split())

A = [0]*N

for i in range(K):
    A[i] = S
    
for j in range(K, N):
    if(S+j+1 >= 10**9):
        A[j] = 1    
    else:
        A[j] = S+j+1
    
print(*A)
# Judge status: Accepted
def main():
    a, b, c, x, y = map(int, input().split())

    total_min = a * x + b * y

    for i in range(1, max(x, y)+1):
        total = a * max(x - i, 0) + b * max(y - i, 0) + c * i * 2
        total_min = min(total, total_min)
    print(total_min)

if __name__ == "__main__":
    main()
# Judge status: Accepted
def five_dishes(li):

    ans = 0
    count = 10
    for i in li:
        ans += -(-i//10)*10
        if i%10 != 0:
            count = min(count, i%10)
    return ans-(10-count) if count != 10 else ans

def main():
    li = [int(input())for i in range(5)]
    print(five_dishes(li))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import math
def D():
    X = int(input())
    for x in range(X):
        A = math.pow(x, 5)
        B = A-X
        ans = math.log(abs(B), 5)
        if B == 0 or ans.is_integer():
            print(int(x), int(ans))

D()
# Judge status: Accepted
h,m,hh,mm,k = map(int,input().split())
x = hh*60-h*60+mm-m
print(x-k)
# Judge status: Accepted
x, a, b = map(int, input().split())

if b <= a:
    print('delicious')
elif b - a <= x:
    print('safe')
else:
    print('dangerous')
# Judge status: Accepted
N = int(input())
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
        if ans > 10**18:
            ans = -1
            break
    print(ans)
# Judge status: Accepted
n, m = map(int,input().split())

ab = []
for i in range(n):
    ab.append(list(map(int, input().split())))
    
cd = []
for i in range(m):
    cd.append(list(map(int, input().split())))

ans = [0] * m
for i in range(n):
    a, b = ab[i][0], ab[i][1]
    dist = [0] * m
    for j in range(m):
        dist[j] = abs(a - cd[j][0]) + abs(b - cd[j][1])
    dm = min(dist)
    for j in range(m):
        if dist[j] == dm:
            print(j+1)
            break
# Judge status: Accepted
h=int(input())
#n,k=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

import math
ans=1
count=1
while h!=1:
    count*=2
    ans+=count
    h=math.floor(h/2)
    
print(ans)
# Judge status: Wrong Answer
import math
N = int(input()) #1行目のNを取得する
list = [input() for i in range(N)] #複数行の数値の入力を取得

result = 1
for i in range(len(list)):
  for j in range(i+1,len(list)):
    if (i == j):
      continue
    else:
      if(list[i] != list[j]):
        result = result +1

print(math.ceil(result/2))
# Judge status: Accepted
import math
H=int(input())
W=int(input())
N=int(input())
print(math.ceil(N/max(H,W)))
# Judge status: Accepted
def factorial_power(n):
    power = 1
    
    for i in range(1, n+1):
        power *= i
        power = power % divisor
    return power

divisor = (10 ** 9) + 7

N = int(input())

print(factorial_power(N))
# Judge status: Wrong Answer
N = int(input())

print(N/500*1000+N%500/5*5)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

d = int(input())

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

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

if h == 1 or w == 1:
    print(1)
else:
    print(math.ceil((h*w)/2))
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
print(C - (A-B) if A-B >= C else 0)
# Judge status: Wrong Answer
import os, sys, re, math

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

N = int(input())
A = [int(n) for n in input().split()]

gcds = set()
for i in range(N - 1):
    for j in range(i + 1, N):
        gcds.add(gcd(A[i], A[j]))

gcds = sorted(gcds)
print(gcds[1] if len(gcds) >= 2 else gcds[0])
# Judge status: Accepted
x=int(input())
m=100
ans=0
while m<x:
    m=int(m*1.01)
    ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ba = 0
bb = 0
for i in range(N):
    if a[i] > b[i]:
        ba += a[i] - b[i]
    if b[i] > a[i]:
        bb += (b[i] - a[i])//2

if bb >= ba:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())

if n <= 9:
    print('Yes')
elif n >=82:
    print('No')
else:
    if any(n%i == 0 for i in range(2, 9)):
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
N = int(input())
A =list(map(int, input().split()))
minus = [i for i in A if i < 0]
if len(minus) % 2 == 0:
  max_num = [abs(i) for i in A]
  print(sum(max_num))
else:
  max_num = [abs(i) for i in A]
  if min(max_num) in A:
    print(sum(max_num) - 2*min(max_num))
  else:
    print(sum(max_num) + min(max_num))
# Judge status: Wrong Answer
n, k = map(int, input().split())
l = [int(input()) for _ in range(n)]

from itertools import combinations
x = list(combinations(l, 3))

y = []
for i in range(len(x)):
    y.append(max(x[i]) - min(x[i]))

print(min(y))
# Judge status: Accepted
import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    D, T, S = read_values()
    print("Yes" if D <= T * S else "No")


if __name__ == "__main__":
    main()
# Judge status: Accepted
#numpy使ってみる
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split( ))))

ans = 10**10

for i in range(-100,101):
    tmp = ((a-i)**2).sum()
    ans = min(tmp,ans)
print(ans)
# Judge status: Accepted
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)

s = ''.join(s)
t = ''.join(t)

if t > s:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, b = input().split()

a = int(a)
b = int(b[0] + b[2:])

ans = (a * b) // 100
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = [int(i) for i in input().split()]

def main():
    money = 1000
    n = 0
    
    x = a[0]
    for i in range(1, len(a)):
        if (x < a[i]):   # 買う
            n = money // a[i-1]
            money += (a[i] - a[i-1]) * n
            x = a[i]

    print(money)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
now = (0,0,0)
for i in range(N):
    t,x,y = map(int,input().split())
    diff_dist = abs(x-now[1]) + abs(y-now[2])
    diff_time = t - now[0]
    if diff_time % diff_dist == 0 and diff_time >= diff_dist:
        pass
    else:
        print("No")
        exit()
    now = (t,x,y)
print("Yes")