peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
#from functools import lru_cache   #use @lru_cache(None)
if os.path.exists('in.txt'): sys.stdin=open('in.txt','r')
if os.path.exists('out.txt'): sys.stdout=open('out.txt', 'w')
#
def input(): return sys.stdin.readline()
def mapi(arg=0): return map(int if arg==0 else str,input().split())
#------------------------------------------------------------------

h1,m1,h2,m2,k = mapi()
delta =m2+h2*60-(m1+h1*60)-k
print(delta)
# Judge status: Accepted
# D - RGB Triplets
from collections import defaultdict


def main():
    _, S = open(0).read().split()
    indices, doubled_indices = defaultdict(list), defaultdict(set)
    for i, c in enumerate(S):
        indices[c].append(i)
        doubled_indices[c].add(2 * i)
    cnt = S.count("R") * S.count("G") * S.count("B")
    for x, y, z in ["RGB", "GBR", "BRG"]:
        cnt -= sum(i + j in doubled_indices[z] for i in indices[x] for j in indices[y])
    print(cnt)


if __name__ == "__main__":
    main()
# Judge status: Accepted
x,y,z=map(int,input().split())
i=(x-(y+2*z))//(y+z)
print(i+1)
# Judge status: Accepted
a = int(input())
k = 0
t = 1
count = 0
while t == 1 :
     k = k + a
     count = count + 1
     if k % 360 == 0 :
         break

print(count)
# Judge status: Wrong Answer
N = int(input())
num = N/2
if N%2==0:
    print(num)
else:
    print(round(num+0.5))
# Judge status: Accepted
s=input().split()[1][0]

print("A"+s+"C")
# Judge status: Accepted
# -*- coding: utf-8 -*-
import numpy as np

def pair(N):
    b=int(N)%10
    a=int(N)
    k=a//10
    while k!=0:
        a=k%10
        k=k//10
    return a,b
N=int(input())
P=np.zeros((10,10),dtype=np.int32)
ans=0
for i in range(1,N+1,1):
    a,b=pair(i)
    P[a][b]+=1
for i in range(1,10,1):
    for j in range(1,10,1):
        ans+=P[i][j]*P[j][i]
print(ans)
# Judge status: Wrong Answer
import sys
s=int(input())
dp=[0]*1000001
dp[1]=s
cnt=1
for i in range(1000001):
  if s%2==1:
    s=3*s+1
  else:
    s//=2
  cnt+=1
  if dp[s]==1:
    print(cnt)
    sys.exit()
  else:
    dp[s]=1
# Judge status: Accepted
n = int(input())
a, b, c = 0, 0, 0
cnt = 0

for a in range(1, n):
    b = n // a
    if a*b == n:
        cnt += b - 1
    else:
        cnt += b

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

A = [0] * N
for i in range(Q):
    a = int(input())
    A[a-1] += 1

print('\n'.join(['No' if K-Q+e <= 0 else 'Yes' for e in A]))
# Judge status: Accepted
k, s = map(int, input().split())

ans = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if 0 <= z <= k:
            ans += 1

print(ans)
# Judge status: Accepted
import math
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
pp = sorted(p)
qq = sorted(q)

x = 0
y = 0
l = 1
m = 1
for i in p[:n-1]:
    x += math.factorial(n-l)*pp.index(i)
    l += 1
    pp.remove(i)
    del p[0]
    
for j in q[:n]:
    y += math.factorial(n-m)*qq.index(j)
    m += 1
    qq.remove(j)
    del q[0]

print(abs((x+1)-(y+1)))
# Judge status: Wrong Answer
A,B,C,D=map(int,input().split())
if C<=A and B<=D:
  print(B-A)
elif C<=A and D<=B:
  print(D-A)
elif B-C>=0 and B<=D:
  print(B-C)
elif B-C>=0 and B>=D:
  print(D-C)
elif C>B:
  print(0)
# Judge status: Accepted
def resolve():
    import math
    a, b, n = map(int, input().split())
    if b<= n:
        x = b-1
    else:
        x = n
    print(math.floor(a*x/b) - a*math.floor(x/b))
resolve()
# Judge status: Wrong Answer
import heapq
pqr = list(map(int,input().split()))
sum(heapq.nlargest(2,pqr))
# Judge status: Accepted
# https://atcoder.jp/contests/abc131/tasks/abc131_d

n=int(input())
ab=sorted([tuple(map(int,input().split())) for _ in range(n)],key=lambda x: x[1])

time=0
for a,b in ab:
    if time+a>b:
        print('No')
        exit()
    time+=a
else:
    print('Yes')
# Judge status: Accepted
def check(s,t):
    for i in range(s,s+M):
        for j in range(t,t+M):
            if A[i][j] != B[i-s][j-t]:
                return False
    return True


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

A = [list(input()) for _ in range(N)]
B = [list(input()) for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        if check(i,j):
            print("Yes")
            exit()

print("No")
# Judge status: Accepted
N=int(input())
pn=list(map(int,input().split()))
check=[0]*N
for i in range(0,N):
  if pn[i]!=(i+1):
    check[i]=1 #ok
i=0
count=0
while i<N-1:
  if check[i]==0:#if ng
    pn[i],pn[i+1]=pn[i+1],pn[i]
    count+=1
    check[i],check[i+1]=1,1
  i+=1
  pass
if check[i]==0:count+=1
print(count)
# Judge status: Wrong Answer
n,k = map(int,input().split())
r,s,p = map(int,input().split())
t = list(input())

win = {"r":"p","s":"r","p":"s"}
point = {"r":r,"s":s,"p":p}

ans = []
sum = 0

for i in range(k):
    ans.append(win[t[i]])
    sum+=point[win[t[i]]]

for i in range(k,n):
    if win[t[i]] == ans[i - k]:
        ans.append(t[i])
    else:
        ans.append(win[t[i]])
        sum+=point[win[t[i]]]
print(sum)
# Judge status: Wrong Answer
import sys 

input = sys.stdin.readline()

print(input)
# Judge status: Wrong Answer
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = n//k + (n%k)
print(ans)
# Judge status: Wrong Answer
from collections import Counter

S = input()
T = input()

alphabet = 'abcdefghijklmnopqrstuvwxyz'

S_counter = Counter(S)
T_counter = Counter(T)

flag = True

for i in alphabet:
    S_cnt = S_counter[i]
    T_cnt = T_counter[i]
    if S_cnt != T_cnt and S_cnt != 0 and T_cnt != 0:
        flag = False

print('Yes' if flag else 'No')
# Judge status: Accepted
K, X = map(int, input().split())
print(*[i for i in range(X-K+1, X+K)])
# Judge status: Accepted
import numpy as np
n = int(input())
a = 10
b = 0
x = np.zeros((10, 10, ))
for i in range(1,n+1):
  while (i // a != 0):
    a = a * 10
  c = (i * 10) // a
  d = i % 10
  x[c][d] += 1

for i in range(0,10):
  for j in range(0,10):
    b += int(x[i][j] * x[j][i])
print(b)
# Judge status: Accepted
n, k = map(int, input().split())
ans = 0

for i in range(k,n+2):
    su = (n+n-i+1)*i//2-i*(i-1)//2+1
    ans += su

print(int(ans%(10**9+7)))
# Judge status: Accepted
a = 0

li = input().split()
li = [int(i) for i in li]

while 0 < li[0]:
    a += 1
    li[0] -= li[1]

print(a)
# Judge status: Accepted
from bisect import bisect_right
from numpy import cumsum

n, m, k = map(int, input().split())
alst = list(map(int, input().split()))
blst = list(map(int, input().split()))
a_cum = cumsum(alst)
b_cum = cumsum(blst)
ans = bisect_right(b_cum, k)
for i, num in enumerate(a_cum, start = 1):
    if num > k:
        break
    tmp = k - num
    ans = max(ans, bisect_right(b_cum, tmp) + i)
print(ans)
# Judge status: Accepted
import sys
import numpy as np

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

dp = np.zeros(N, dtype=int)
h = np.array(h)

for i in range(1, N):
  start = max(0, i-K)
  dp[i] = min(dp[start:i] + np.abs(h[start:i]-h[i]))
print(dp[N-1])
# Judge status: Accepted
import sys
input = sys.stdin.readline
# int(input()) # 入力が1つ
x, y = map(int, input().split()) # 入力が複数
ans = 0
while x <= y:
    x *= 2
    ans += 1
print(ans)
# Judge status: Wrong Answer
import numpy as np

N=int(input())
M=10**9+7
A=[int(x) for x in input().split()]
A=np.array(A)

ans=0
for i in range(60):
  #one=sum([a>>i&1 for a in A])
  one=np.sum(A>>i&1)
  zero=N-one
  ans+=(one*zero)*pow(2,i)
  ans%=M
  #print(one,zero)
print(ans)
# Judge status: Wrong Answer
x,y,a,b,c=map(int,input().split())
red=sorted(list(map(int,input().split())),reverse=True)
green=sorted(list(map(int,input().split())),reverse=True)
white=sorted(list(map(int,input().split())),reverse=True)
eat_list=sorted(red[:x]+green[:y])
for i in range(min(len(eat_list),len(white))):
  if eat_list[i]<white[i]:
    eat_list[i]=white[i]
  else:
    break
print(eat_list)
print(sum(eat_list))
# Judge status: Wrong Answer
R=0
S=input()
c=len(S)
for i in range(c//2+1):
  if S[i]!=S[c-i-1]:
    R=R+1
print(R)
# Judge status: Accepted
A, B, C, X, Y = map(int, input().split())

ans = 10 ** 18
for i in range(0, 2 * max(X, Y) + 1, 2):
    tmpx = X - (i // 2)
    if tmpx <= 0:
        tmpx = 0
    tmpy = Y - (i // 2)
    if tmpy <= 0:
        tmpy = 0
    ans = min(ans, (i * C) + (tmpx * A) + (tmpy * B))

print(ans)
# Judge status: Accepted
x=int(input())
c=100
time=0
while c<x:
  c+=c//100
  time+=1
print(time)
# Judge status: Wrong Answer
list = list(map(int,input().split( )))
if list[0] % list[1] == 0:
  time = list[2]*list[0]/list[1]
else :
  time = list[2]*(list[0]/list[1]+1)
print (time)
# Judge status: Wrong Answer
s=input()
for i in range(len(s)):
    if s[i]=="A":
        x=i#"A"のインデックス番号
        break
for i in range(len(s)):
    if s[-i]=="Z":
        y=len(s)-i#"Z"のインデックス番号
        break
ans=y-x+1
print(ans)
# Judge status: Accepted
s=input()
q=int(input())
order=1
header=''
footer=''
for _ in range(q):
  tmp=input()
  if tmp=='1':
    order*=-1
  else:
    t, f, c=tmp.split()
    if (int(f)*order)%3==1:
      header=c+header
    else:
      footer=footer+c
s=header+s+footer
print(s) if order==1 else print(s[::-1])
# Judge status: Accepted
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)
# Judge status: Accepted
import numpy as np

D = int(input())
c = np.array( list(map(int, input().split())) )
#
s = [[] for i in range(D)]
for i in range(D):
  s[i] = np.array( list(map(int, input().split())) )
#
v = 0
cc =  np.array( [0]*26 )
last = np.array( [-1]*26 )
for d in range(D):
  cc += c
  av = s[d] - sum( cc ) + cc
  m = max(av)
  for t in range(26):
    if av[t] == m:
      cc[t] = 0
      v += av[t]
      print(t+1)
      break
#
#print( v )
# Judge status: Accepted
n=int(input())+1
table0=[0]*10001
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      r=x*x+y*y+z*z+x*y+y*z+x*z
      if r<n:
        table0[r]+=1
for i in range(1,n):
  print(table0[i])
# Judge status: Wrong Answer
num = int(input())

arr = {}
for i in input().split(" "):
	i = int(i)
	if arr.get(i, False):
		arr[i] += 1
	else:
		arr[i] = 1

arr = dict(sorted(arr.items(), key=lambda d: d[0], reverse=True))

side = []

for key in arr:
	if arr[key] >= 2:
		side.append((key, arr[key]))

if len(side) >= 2:
	if side[0][1] >= 4:
		print(side[0][0] * side[0][0])
	else:
		print(side[0][0] * side[1][0])
elif len(side) == 1 and side[0][1] >= 4:
	print(side[0][0] * side[0][0])
else:
	print(0)
# Judge status: Accepted
#A
a, b = map(int, input().split())
l = [i for i in range(2, 14)] + [1]
if l.index(a) < l.index(b):
    print('Bob')
elif l.index(a) == l.index(b):
    print('Draw')
else:
    print('Alice')
# Judge status: Wrong Answer
n,*a=map(int,open(0).read().split());k=10**9+7
c=(1<<n)%k-1
for l in a:
	X=Y=j=Z=1;d=k-2
	for i in range(l):X=X*(n-i)%k
	while j<=l:Y=Y*j%k;j+=1
	while d>0:Z=Z*Y%k if d&1==1 else Z;Y=Y*Y%k;d>>=1
	c-=X*Z%k
print(c%k)
# Judge status: Wrong Answer
#import collections
# c = collections.Counter()
#import itertools as it
#import math
#import numpy as np
#import sys 
#sys.exit()
 
#  = input()
#k  = int(input())
n,m,q  = map(int, input().split())
'''
#  = list(map(int, input().split()))
'''
'''
n = input()
a = [int(input()) for i in range(n)]
'''

#n,m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(q)]

print(n,m,q)
print(a)
#-------------------------------#
A=[]
for i in range(1,m+1):
    A.append(i)
print(A)
# Judge status: Accepted
def n_pow(a, n):
    if n <= 0:
        return 0
    return pow(a, n)


def main():
    bags, remainder = map(int, input().split())
    biscuits = list(map(int, input().split()))
    count = [0, 0]
    for b in biscuits:
        count[b % 2] += 1
    if remainder == 1 and count[1] == 0:
        print(0)
    elif count[1] == 0:
        print(pow(2, bags))
    else:
        print(n_pow(2, bags - 1))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b = map( int, input().split())
i = 0
while True:
  i += 1
  if  ( a - 1 ) * i + 1 >= b:
    break
print( i )
# Judge status: Accepted
w = input()
w_set = set(w)
for i in w_set:
  if w.count(i) % 2 == 1:
    print("No")
    break
else:
  print("Yes")
# Judge status: Wrong Answer
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]

if m == 1:
  print("IMPOSSIBLE")

else:
  root = [[] for i in range(n)]
  for a, b in ab:
    root[a-1].append(b-1)
  
  flag = False
  for i in range(len(root)):
    for j in root[i]:
      if n-1 in root[j]:
        flag = True
        break

  print("POSSIBLE" if flag else "IMPOSSIBLE")
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

a = [0]* n
b = [0]* n
for i in range(n):
    a[i], b[i] = map(int, input().split())

amax = max(a)
ans = 0

b.sort(reverse=True)

for attack in b:

    if attack < amax: break
    h -= attack
    ans += 1
    if h <= 0:
        print(ans)
        exit()

ans += -(-h//amax)

print(ans)
# Judge status: Accepted
l=input().rstrip().lstrip().split(" ")
print(max(int(l[0]), int(l[1])) + max(min(int(l[0]), int(l[1])), max(int(l[0]), int(l[1])) - 1))
# Judge status: Accepted
# https://atcoder.jp/contests/abc159/tasks/abc159_b

S = input()
N = len(S)
S_2 = S[: int((N - 1) / 2)]
S_3 = S[int(((N + 3) / 2)) - 1: ]

if S == S[:: -1] and S_2 == S_2[:: -1] and S_3 == S_3[:: -1]:
    print('Yes')

else:
    print('No')
# Judge status: Wrong Answer
m=[]
cnt=0
for i in range(5):
    x=int(input())
    m.append(x)
m10=[i % 10 for i in m if i %10 >=1]
if m10:
    t=min(m10)
    for i in m:
        if i %10==0:
            cnt += i
        else:
            cnt += ((i//10)+1)*10
    print(cnt-10+t)
else:
    print(0)
# Judge status: Wrong Answer
from collections import deque
N,M,K = map(int,input().split())
A = deque(map(int,input().split()))
B = deque(map(int,input().split()))
ans = 0
time = 0

while len(A) > 0 or len(B) > 0:
    if len(A) == 0:
        time += B.popleft()
    elif len(B) == 0:
        time += A.popleft()
    elif A[0] < B[0]:
        time += A.popleft()
    else:
        time += B.popleft()
    if time > K:
        break
    ans += 1

print(ans)
# Judge status: Accepted
import sys

input = sys.stdin.readline
MOD = 1000000007

N = int(input())

num = [0]*(200)

S = {}

cnt = 0
for i in range(N):
    x = input()[:-1]
    if x not in S:
        S[x] = cnt
        num[cnt] = 1
        cnt+=1
    else:
        num[S[x]]+=1

M = int(input())
for i in range(M):
    x = input()[:-1]
    if x not in S:
        pass
    else:
        num[S[x]] -=1


res = 0
for i in num:
    if i > 0:
        res+= i

print(max(num))
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))

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

print(ans)
# Judge status: Wrong Answer
s = open(0).readlines()[0]

if len(s)%2:
    s = s[:-1]
else:
    s = s[:-2]

while s[:len(s)//2] != s[len(s)//2:]:
    s = s[:-2]

print(len(s))
# Judge status: Accepted
import fractions


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


N = int(input())
A = list(map(int, input().split()))
l = A[0]
mod = 10**9+7
ans = 0
for i in range(1, N):
    l = lcm(l, A[i])
for i in range(N):
    ans += l // A[i]
print(ans % mod)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n, W = map(int, input().split())
dp = [[0 for i in range(W + 1)] for j in range(n + 1)]
wv = [[int(x) for x in input().split()] for _ in range(n)]

for i in range(n):
    for j in range(W + 1):
        if j - wv[i][0] >= 0:
            dp[i + 1][j] = max(dp[i][j - wv[i][0]] + wv[i][1], dp[i + 1][j])
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
print(max(dp[-1]))
# Judge status: Accepted
n,m = map(int,input().split())
py = [list(map(int,input().split())) for i in range(m)]
c = [0]*n
sort_py = sorted(py,key=lambda x:x[1])
ans = dict()
for p,y in sort_py:
    c[p-1] += 1
    ans[p,y] = str(p).zfill(6)+str(c[p-1]).zfill(6)

for p,y in py:
    print(ans[p,y])
# Judge status: Accepted
s=input()
month=int(s[5:7])
if month <= 4:
    print('Heisei')
else:
    print('TBD')
# Judge status: Accepted
import sys

X,Y=(int(x) for x in input().split())
#print(X,Y)
if Y%2==1:
  print('No')
  sys.exit()
if Y<2*X:
  print('No')
  sys.exit()
  

check=int((Y-2*X)/2)
#print(check)
if check<=X:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n_list = list(map(int,input().split()))
n_list.sort()
num = 2 * n_list[2]
dummy = num - (n_list[0] + n_list[1])
a,b = divmod(dummy,2)
if b == 0:
  print(a)
else:
  print(a+2)
# Judge status: Accepted
n = int(input())

if n % 1000 == 0:
  print(0)
else:
  print(1000 - (n % 1000))
# Judge status: Accepted
s = input()

k = int(input())

ichi = 0
for i in s:
    if int(i) == 1:
        ichi = ichi +1
    else:
        break


if ichi >= k:
    print(1)
else:
    print(s[ichi])
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())

ans = False
for x in range(k + 1):
    for y in range(k - x + 1):
        for z in range(k - x - y + 1):
            if a * (2 ** x) < b * (2 ** y) < c * (2 ** z):
                ans = True
                break

print('Yes') if ans else print('No')
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**9)

n=int(input())
maxn=110000
memo=[-1 for i in range(maxn)]
def rec(n):
    if n==0:
        return 0
    if memo[n]!=-1:
        return memo[n]
    res=n
    i=1
    while i<=n:
        res=min(res,rec(n-i)+1)
        i*=6
    j=1
    while j<=n:
        res=min(res,rec(n-j)+1)
        j*=9
    memo[n]=res
    return memo[n]
print(rec(n))
#print(memo)
# Judge status: Accepted
n = int(input())
x = sorted(list(map(int,input().split())))
li = []
cost = 0
for i in range(x[0],x[-1]+1,1):
    cost = 0
    for b in x:
        cost += (b-i)**2
    li.append(cost)
print(min(li))
# Judge status: Accepted
N = int(input())
V = list(map(int, input().split()))

V.sort()

ans = V[0]
for i in range(1, N):
    ans = (ans+V[i])/2
print(ans)
# Judge status: Accepted
n=int(input())
ans=1
for i in range(n):
    ans*=i+1
    ans=ans%1000000007
print(ans)
# Judge status: Accepted
w,a,b = map(int,input().split())
print((a+w<b)*(b-a-w) or (b+w<a)*(a-b-w) or 0)
# Judge status: Accepted
n=int(input())
print((n-1)//2+1)
# Judge status: Accepted
import sys
from math import ceil
from itertools import permutations
def input(): return sys.stdin.readline().strip()

def main():
    T = [int(input()) for _ in range(5)]
    ans = 10**10
    for way in list(permutations(T, 5)):
        time = 0
        for i in range(4):
            time += ceil(way[i] / 10) * 10
        time += way[-1]
        #if ans > time: print("way={}, time={}".format(way, time))
        ans = min(ans, time)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b=map(int,input().split())
if a>9 or b>9:
    print(-1)
else:
    print(a*b)
# Judge status: Wrong Answer
s = input()

length = 0
if len(s) % 2 == 0:
  length = len(s) // 2 - 1
else:
  length = len(s) // 2

top = -1

for i in range(length):
  flag = True
  for j in range(i):
    if s[i - j] != s[i + j + 1]:
      flag = False
  if flag :
    top = (i+1) * 2

print(top)
# Judge status: Accepted
x = int(input())

if (x-1)%11<6:
    print(2*((x-1)//11)+1)
else:
    print(2*((x-1)//11) +2)
# Judge status: Wrong Answer
S=input()
Q=int(input())
rev=1
for i in range(Q):
    t=input()
    if t=='1':
        rev+=1
        rev=rev%2
    else:
        _,F,C=t.split(" ")
        if (int(F)+rev)%2==1:
            S=C+S
        else:
            S=S+C

if rev==1:
    print(S[::-1])
else:
    print(S)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n <= k:
  print(n*x)
else:
  print(k*x+(n-k)*y)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num / max(gcd(res, num), 1)

print(int(res))
# Judge status: Accepted
idade = int(input())

if(idade == 7 or idade == 5 or idade == 3):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
from decimal import Decimal
a, b = map(Decimal, input().split())

print(int(a*b))
# Judge status: Accepted
import sys
from functools import reduce
read = sys.stdin.read

n, *lst = map(int, read().split())
lst_xor = reduce(lambda x, y: x ^ y, lst)
print(*[lst_xor ^ i for i in lst])
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    robo = []
    for i in range(N):
        x, l = [int(x) for x in input().split()]
        robo.append((x-l, x+l))
    robo.sort()
    robo.sort(key=lambda x: x[1])

    ans = N
    l, r = robo[0]
    for i in range(1, N):
        if robo[i][0] < r:
            ans -= 1
        else:
            l, r = robo[1]
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N, M = map(int,input().split())
left = 1
right = N
for _ in range(M):
    L, R = map(int,input().split())
    if L > left:
        left = L
    if R < right:
        right = R
a = right - left
print(max(0, a + 1))
# Judge status: Accepted
from bisect import bisect_left, bisect_right

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

A.sort()
C.sort()

ans = 0
for b in B:
    a = bisect_left(A, b)
    c = N - bisect_right(C, b)
    ans += a * c

print(ans)
# Judge status: Wrong Answer
A, B = map(int,input().split())
if A <=8 and B <=8:
  print('Yey')
else:
  print(':(')
# Judge status: Accepted
X = int(input())
if X == 7 or X == 5 or X == 3:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
a, b, n = map(int, input().split())

x = min(b-1, n)

print((a*x)//b)
# Judge status: Accepted
n = int(input())
d = list(map(int, input().split()))
d.sort()
a = n//2
if d[a] == d[a-1]:
    print(0)
    exit()
print(d[a] - d[a-1])
# Judge status: Wrong Answer
h = int(input())
print(h**2-1)
# Judge status: Accepted
N=int(input())
ans=0
for i in range(1,N+1):
  for j in range(i,N+1,i):
    ans=ans+j
print(ans)
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
A_tupple = [(idx+1, value) for idx, value in enumerate(A)]
A_tupple.sort(key=lambda x:x[1])
for a in A_tupple:
  print(a[0], end=" ")
# Judge status: Accepted
n, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]


curr = 0
arr = []
visited = [False]*n
while(not visited[curr]):
    visited[curr] = True
    arr.append(curr)
    curr = a[curr]-1

visited = [False]*n
cycleSize = 0
while(not visited[curr]):
    visited[curr] = True
    cycleSize+=1
    curr = a[curr]-1

pathSize = len(arr) - cycleSize

if(pathSize>=k):
    print(arr[k]+1)
else:
    print(arr[(k-pathSize)%cycleSize+pathSize]+1)
# Judge status: Accepted
A, B, M = map(int, input().split())

A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))

# 割引券使わない
ans = min(A_list) + min(B_list)

# 割引券読み込み
for i in range(1, M + 1):
    x, y, c = map(int, input().split())
    price = A_list[x - 1] + B_list[y - 1] - c
    ans = min(ans, price)

print(ans)
# Judge status: Accepted
S, T = input().split()
A, B = map(int, input().split())
U = input()

Balls = {}
Balls[S] = A
Balls[T] = B
Balls[U] -= 1

print(Balls[S], Balls[T])
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
INF = 10**8
dp = [INF]*n
dp[0] = 0
for i in range(n-1):
    if i == 0:
        dp[i+1] = abs(h[i+1]-h[i])
    else:
        dp[i+1] = min(dp[i]+abs(h[i+1]-h[i]), dp[i-1]+abs(h[i+1]-h[i-1]))
print(dp[n-1])
# Judge status: Accepted
a,b,c=sorted(map(int,input().split(' ')))
print(c*10+b+a)
# Judge status: Wrong Answer
from collections import deque
n=int(input())
A=deque()
B=deque()
ans=0
for i in range(n):
    a,b=map(int,input().split())
    A.appendleft(a)
    B.appendleft(b)
for i in range(n):
    k=B[i]-(A[i]%B[i])
    ans+=k
    for j in range(i,n):
        A[j]+=k
print(ans)