peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

A,B = I()
if A == B:
    print('Draw')
elif A == 0:
    print('Alice')
elif B == 0:
    print('Bob')
elif A > B:
    print('Alice')
else:
    print('Bob')
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

d={}
for i in range(N):
    if i-A[i]>0:
        if str(i-A[i]) in d:
            d[str(i-A[i])]+=1
        else:
            d[str(i-A[i])]=1

ans=0
for j in range(N):
    if str(j+A[j]) in d:
        ans+=d[str(j+A[j])]
print(ans)
# Judge status: Accepted
A = []
for i in range(3):
    A += list(map(int,input().split()))
N = int(input())
B = []
for i in range(N):
    B.append(int(input()))
B = set(B)

c = [[0,0,0],[0,0,0],[0,0,0]]
P = [{0,3,6},{1,4,7},{2,5,8},{0,1,2},{3,4,5},{6,7,8},{0,4,8},{2,4,6}]

r = []
for i,a in enumerate(A):
    if a in B:
        r.append(i)
r = set(r)

for p in P:
    if p.issubset(r):
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
import itertools
N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))
answer_list=list(itertools.permutations(range(1,N+1)))
P_num=answer_list.index(tuple(P))
Q_num=answer_list.index(tuple(Q))
print(abs(P_num-Q_num))
# Judge status: Accepted
N=int(input())
a=list(map(int, input().split()))
q=0
b=0
for i in a:
  if i%4==0:
    q += 1
  elif i%2==0:
    b += 1

s = "No"
if N//2 <= q or N <= 2*q+b:
  s = "Yes"
print(s)
# Judge status: Accepted
import numpy as np
N = int(input())
X = list(map(int, input().split()))

def calc_energy(i, X):
    X = np.array(X)
    return sum((X-i)**2)

min_energy = 1000000000
min_ind = min(X)
max_ind = max(X)
for i in range(min_ind, max_ind+1):
   energy = calc_energy(i, X) 
   if energy < min_energy:
       min_energy = energy
print(min_energy)
# Judge status: Wrong Answer
from bisect import bisect_right
from numpy import cumsum

N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
B_ = [0]*N
ans = 0
start = 0
for i, b in enumerate(B):
    j = bisect_right(A, b, start)
    B_[i] = j
    start = j
B_ = cumsum(B_)
start = 0
for c in C:
    i = bisect_right(B, c, start)
    start = i
    if i != 0:
        ans += B_[i-1]
print(ans)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
print(max(a*c, a*d, b*c, b*d))
# Judge status: Accepted
S = input()
l = ["Sunny", "Cloudy", "Rainy"]
if S == l[0]:
    print(l[1])
elif S == l[1]:
    print(l[2])
else:
    print(l[0])
# Judge status: Accepted
n=int(input())
d=0
while d*7<=n:
    if (n-d*7)%4==0:
        print('Yes')
        break
    d+= 1
else:
    print('No')
# Judge status: Accepted
n=input()
if n.count('9')==0:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
from math import factorial

def comb(n, r):
    return factorial(n) // (factorial(n-r) * factorial(r))

n, p = map(int, input().split())
arr = list(map(int, input().split()))

odd = 0
even = 0
for a in arr:
    if a % 2 == 1:
        odd += 1
    else:
        even += 1

ans = 2 ** even
tmp = 0
for i in range(p, odd+1, 2):
    tmp += comb(odd, i)
ans *= tmp

print(ans)
# Judge status: Accepted
N,K=map(int, input().split())
S=input().strip()
c=S[K-1].lower()
print(S[:K-1]+c+S[K:])
# Judge status: Wrong Answer
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

m = (n) // (k-1)
print(m)
# Judge status: Accepted
_=int(input())
a=list(map(int,input().split()))

x,y,z=0,0,0
for i in a:
    if i%4 == 0:
        z+=1
    elif i%2 == 0:
        y+=1
    else:
        x+=1
if y:
    if x <= z:
        print('Yes')
    else:
        print('No')
else:
    if x <= z+1:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M = lr()
AB = [lr() for _ in range(N)]
AB.sort()
drink = 0
answer = 0
for i in range(N):
    cost = AB[i][0]
    limit = AB[i][1]
    if drink + limit < M:
        answer += cost * limit
        drink += limit
    else:
        x = M - drink
        answer += cost * x
        break

print(answer)
# Judge status: Accepted
l = sorted(list(map(int, input().split())))
ans = 0
if l[0]%2!=0 and l[1]%2!=0 and l[2]%2!=0:
    ans += l[0]*l[1]
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
ab = [list(map(int,input().split())) for i in range(N)]
cd = [list(map(int,input().split())) for i in range(M)]

for i in range(N):
    check = 10**5
    index = 0
    for j in range(M):
        if abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]) < check:
            index = j+1
            check = min(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]), check)
    print(index)
# Judge status: Accepted
H1, M1, H2, M2, K = map(int, input().split())

H = H2 - H1
M = M2 - M1

answer = H*60 + M - K
print(answer)
# Judge status: Accepted
n = int(input())
s = input()
stack_len = 0
ans = ""
streak = 0
for i in s:
    if i == ")":
        if stack_len:
            stack_len -= 1
            ans += ")"
        else:
            ans = "(" + ans + ")"
    else:
        ans += "("
        stack_len += 1
ans += ")" * stack_len
print(ans)
# Judge status: Accepted
from functools import reduce
from fractions import gcd

N = int(input())
T = list(int(input()) for _ in range(N))

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

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(T))
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n+1, 2):
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
print(ans)
# Judge status: Accepted
c = input()
if c in 'aeiou':
    print('vowel')
else:
    print('consonant')
# Judge status: Wrong Answer
n = input()
num = list(map(int,input().split()))
print(num)
# mul = int(input().split())
cnt = 0
for i in range(len(num)):
    if(i % 2 != 0 and num[i] %2 != 0):
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
#!/usr/bin/env python3

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

S = ''
for i in range(N-1):
    if A[i] < A[i+1]:
        S += 'p'
    else:
        S += 'm'

i = 0
ans = 0
while i < len(S)-1:
    if S[i] == S[i+1]:
        i += 1
    elif S[i:i+2] == 'pm':
        ans += 1
        i += 2
    elif S[i:i+2] == 'mp':
        ans += 1
        i += 2
print(ans+1)
# Judge status: Accepted
s = input()[::-1]
t = input()[::-1]

if len(s) < len(t):
  print('UNRESTORABLE')
  exit(0)

ans = ''
for i in range(len(s) - len(t) + 1):
  for j in range(len(t)):
    if s[i+j] in ('?',t[j]):
      continue
    else:
      break
  else:
    ans = s[:i] + t + s[i+len(t):]
    break
else:
  print('UNRESTORABLE')
  
for c in ans[::-1]:
  print('a' if c=='?' else c,end= '')
print()
# Judge status: Accepted
n, m = map(int, input().split())
req = [list(map(int, input().split())) for i in range(m)]
for i in range(10000):
	st = str(i)
	if len(st) != n:
		continue
	ok = True
	for s, c in req:
		if int(st[s-1]) != int(c):
			ok = False
	if ok:
		print(st)
		exit(0)

print(-1)
# Judge status: Accepted
T = input()
nt = ''
for i in T:
    if i =='?':
        i = 'D'
    nt+= i
    
print(nt)
# Judge status: Wrong Answer
n=int(input())
l=[0]*9
for i in map(int,input().split()):
  i//=400
  if i<8: l[i]=1
  else: l[8]+=1
print(sum(l[:8]),sum(l))
# Judge status: Accepted
from itertools import accumulate
N, K, *A = map(int, open(0).read().split())
for _ in range(min(K, 41)):
    next_A = [0] * (N + 1)
    for i, a in enumerate(A):
        next_A[max(0, i - a)] += 1
        next_A[min(N, i + a + 1)] -= 1
    A = list(accumulate(next_A))
A.pop()
print(*A)
# Judge status: Accepted
n=input()
if 1<=int(n[:2])<=12 and 1<=int(n[2:])<=12:
  print("AMBIGUOUS")
elif 1<=int(n[:2])<=12:
  print("MMYY")
elif 1<=int(n[2:])<=12:
  print("YYMM")
else:
  print("NA")
# Judge status: Accepted
def mi():
    return map(int, input().split())

def main():
    S = input()
    T = input()
    ds = {}
    dt = {}
    for i in range(len(S)):
        if not S[i] in ds:
            ds[S[i]] = 0
        if not T[i] in dt:
            dt[T[i]] = 0

        ds[S[i]] += 1
        dt[T[i]] += 1
    ls = sorted(list(ds.values()))
    lt = sorted(list(dt.values()))
    
    print('Yes' if ls == lt else 'No')


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
print(N/2 if N%2==0 else (N+1)/2)
# Judge status: Wrong Answer
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.extend(b)
ab = sorted(a)

book = 0
time = 0
for i in ab:
    time += i
    if time > k:
        print(book)
        exit()
    elif time == k:
        book += 1
        print(book)
        exit()
    else:
        book += 1
# Judge status: Wrong Answer
import numpy as np

n = int(input())
s = n * n * np.pi

print(s)
# Judge status: Wrong Answer
T = input()
T = T.replace("?","D")
print(T.count("PD") + T.count("D"))
# Judge status: Accepted
# import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
# import sys
# sys.setrecursionlimit(10**9)

def resolve():
    N = int(input())
    A = [int(input()) for i in range(5)]

    print(4 + -(-N // min(A)))


resolve()
# Judge status: Accepted
N, D = map(int, input().split())
print((N-1)//(2*D+1)+1)
# Judge status: Accepted
s=list(input())
t=list(set(s))
if len(t)==2:
    if s.count(t[0])==2 and s.count(t[1])==2:print("Yes")
    else:print("No")
else:print("No")
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
l = [0] * n
t = 0

for i in reversed(range(0, len(h))):
    if i > 0:
        if h[i] <= h[i-1]:
            t+=1
            l[i-1] = t
        else:
            t = 0
print(max(l))
# Judge status: Wrong Answer
s = input()
cnt = 0

for i in s:
  if i == "R":
    cnt += 1
    
print(cnt)
# Judge status: Accepted
# KEYENCE Programming Contest 2019 / キーエンス プログラミング コンテスト 2019: B – KEYENCE String
S = input()

is_keyence = 'NO'

for i in range(0, 8):
    if S[:i] + S[i - 7:] == 'keyence':
        is_keyence = 'YES'
        break

print(is_keyence)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
import sys
prev = -999
for i in range(N):
    if prev <= H[i] - 1:
        prev = H[i] - 1
    elif prev == H[i]:
        prev = H[i]
    else:
        print('No')
        sys.exit(0)
print('Yes')
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
if (b-a)%2==0:
  print(int((b-a)//2))
else:
  print(min(n-a,b-1))
# Judge status: Accepted
from collections import defaultdict


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, x = Input()
    l = Input()
    d = defaultdict(int)
    d[0] = 0
    ans = 0

    for i in range(1, n+1):
        d[i] = d[i-1] + l[i-1]

    for i in d.values():
        if i <= x: ans += 1

    print(ans)

main()
# Judge status: Accepted
a,b,c = map(int,input().split())
if a <= c <= a+b:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
N, M = map(int, input().split())

questions = {i:[False, 0] for i in range(1, N + 1)}
count_AC = 0
count_WA = 0

for _ in range(M):
    p, S = input().split()
    if not questions[int(p)][0]:
        if S == "WA":
            questions[int(p)][1] += 1
        elif S == "AC":
            questions[int(p)][0] = True

for v in questions.values():
    if v[0]:
        count_AC += 1
        count_WA += v[1]
        
print(count_AC, count_WA)
# Judge status: Accepted
n,d=map(int,input().split())
D=2*d+1
print((n+D-1)//D)
# Judge status: Accepted
N, K = [int(INPUT) for INPUT in input().strip().split(' ')]

total_num = 0

for k in range(K, N + 2):
    # Min = sum(range(k))
    # Max = sum(range(N - (k - 1), N + 1))
    # # print("%s~%s" % (Min, Max))
    # num = Max - Min + 1
    num = (N - (k - 1)) * k + 1
    total_num += num

print(int(total_num % (1e9+7)))
# Judge status: Accepted
A, B, C = map(int, input().split())
if (A-C) * (C-B) > 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a, b, c, d = map(int, input().split())
print("Yes" if abs(c-a) <= d or abs(b-a) <= d and abs(c-b) <= d else "No")
# Judge status: Accepted
n, m = map(int, input().split())
x = list(map(int, input().split()))
if n >= m:
    print(0)
else:
    x.sort()
    ku = []
    for i in range(len(x)-1):
        ku.append(abs(x[i]-x[i+1]))
    ku.sort()
    sum = 0
    for i in range(m-n):
        sum += ku[i]
    print(sum)
# Judge status: Wrong Answer
H, N = map(int, raw_input() .split())
A = map(int, raw_input() .split())
if sum(A) > H:
    print "Yes"
else:
    print "No"
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    a = list(map(int, readline().split()))

    a.sort()

    print(sum(a[n::2]))


if __name__ == '__main__':
    main()
# Judge status: Accepted
import fractions
A,B=map(int,input().split())

gcd=fractions.gcd(A,B)
count=1

for i in range(2,int(pow(gcd,1/2))+1):
    if gcd==1:
        break
    else:
        if gcd%i==0:
            count+=1
            while gcd%i==0:
                gcd//=i
if gcd!=1:
    count+=1
print(count)
# Judge status: Wrong Answer
import sys
N = int(sys.stdin.readline().rstrip())
A = list(map(int, sys.stdin.readline().rstrip().split()))
S= 0
for n in range(N):
  S = S^A[n]
  print(S)
  
ans = ''
for n in range(N):
  m = S^A[n]
  ans += str(m) + ' '

print(ans)
# Judge status: Wrong Answer
s = list(input())
ans = [0]
for c in s:
    if c == ">":
        ans.append(ans[-1]-1)
    if c == "<":
        ans.append(ans[-1]+1)

print(ans)
print(sum(ans))
m = min(ans)
if min(ans) >= 0:
    print(sum(ans))
else:
    print(sum(ans)-m*(len(ans)-1))
# Judge status: Accepted
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
N = int(input())
a = list(map(int,input().split()))
ave = Decimal(str(sum(a)/N)).quantize(Decimal("0"),rounding=ROUND_HALF_UP)
cost = 0
for i in a:
    cost += (i-ave)**2
print(cost)
# Judge status: Accepted
X, Y = map(int, input().split())

x = X
ans = 0
while x < Y:
    x *= 2
    ans += 1
print(ans if x > Y else ans + 1)
# Judge status: Accepted
a,b,c=map(int,input().split())
if (a+b+c==17):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
from bisect import bisect_right
N, X = map(int, input().split())
L = list(map(int, input().split()))
s = [0] * (N+1)
for i in range(N):
	s[i+1] = s[i] + L[i]
pos = bisect_right(s, X)
print(pos)
# Judge status: Accepted

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

from collections import Counter
c=Counter(d)

mod=998244353
ans=1
key=set(c.keys())
if d[0]==0 and c[0]==1 and set(range(len(key))) == key:
    for i in range(len(key)):
        #print(i,c[i],c[i+1],c[i]**c[i+1])
        ans=ans*c[i]**c[i+1] %mod
else:
    ans=0
print(ans)
# Judge status: Wrong Answer
A, B = input().split()

a01 = int(A[0:2])
a34 = int(A[3:5])
if a01 < a34:
  amin = int(A[1:3]) + 1
else:
  amin = int(A[1:3])

b01 = int(B[0:2])
b34 = int(B[3:5])
if b01 <= b34:
  bmin = 100 - int(B[1:3]) - 1
else:
  bmin = 100 - int(B[1:3])

n0 = int(B[0]) - int(A[0]) + 1

print(n0 * 100 - amin - bmin)
# Judge status: Accepted
k, x = map(int, input().split())
print(' '.join(map(str, range(x - k + 1, x + k))))
# Judge status: Accepted
n=input()
l=list(n)
val=0
for i in l:
    if i=="7":
        val=1
        break
if val==1:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s=list(input())
if s.count('N')==s.count('S') and s.count('E')==s.count('W'):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
# 054a

A, B = map(int, input().split())    # カードの数字を入力

if A == B:
    print("Draw")
elif A == 1:
    print("Alice")
elif B == 1:
    print("Bob")
elif A < B:
    print("Bob")
else:
    print("Alice")
# Judge status: Accepted
n,m = map(int,input().split())
ans = []
for i in range(m):
    a,b = map(int,input().split())
    ans.append(a)
    ans.append(b)

for j in range(1,n+1):
    print(ans.count(j))
# Judge status: Wrong Answer
n, x = map(int, input().split())
a = [int(i) for i in input().split()]
op = 0
for i in range(1, n):
    s = a[i-1] + a[i]
    if s > x:
        op += s - x
        if a[i] >= a[i-1]:
            a[i] -= s - x
        else:
            a[i-1] -= s - x
print(op)
# Judge status: Accepted
a, b, c, x, y = map(int, input().split())
price = float("inf")
max_iter = max(x, y)*2

for i in range(max_iter):
    a_num = max(x-i, 0)
    b_num = max(y-i, 0)
    price = min(price, a_num*a + b_num*b + 2*i*c)

print(price)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n,k = (int(x) for x in input().split())
r,s,p = (int(x) for x in input().split())
#つまりs,p,rを出されたときに得る点数
mydict = {"s":r, "p":s, "r":p}
t = input()

ans = 0

for i in range(n):
	if i<k:
		ans += mydict[t[i]]
	elif t[i-k]!=t[i]:
		ans += mydict[t[i]]
	elif t[i-k]==t[i]:
		t = t[:i] + 'z' + t[i+1:]

print(ans)
# Judge status: Accepted
n = int(input())

dp = [float('inf')] * (n+1)

for i in range(n+1):
  dp[i] = min(dp[i], i)
  j = 6
  while i+j<=n:
    dp[i+j] = min(dp[i+j], dp[i]+1)
    j *= 6
  k = 9
  while i+k<=n:
    dp[i+k] = min(dp[i+k], dp[i]+1)
    k *= 9
    
print(dp[n])
# Judge status: Accepted
s = input()
a = -1
z = 0
for i in range(len(s)):
  if s[i] == "A" and a == -1:
    a = i
  if s[-(i + 1)] == "Z" and z == 0:
    z = len(s) - (i + 1)
print(z - a + 1)
# Judge status: Accepted
X=int(input())
print(10-(X//200))
# Judge status: Accepted
A, B, X = map(int, input().split())

if A > X or A + B < X:
    print('NO')
else:
    print('YES')
# Judge status: Wrong Answer
N, M, *cnt = open(0).readline().split()
from collections import Counter
cnt = Counter(cnt)
for i in range(1,int(N)+1):
    print(cnt[str(i)])
# Judge status: Wrong Answer
import numpy as np
mod = 10**9+7
n = int(input())
a = np.fromstring(input(), dtype = np.int64, sep = ' ')

result = 0
for i in range(60):
    count_one = (a&1).sum()
    result += count_one*(n-count_one)*(2**i)
    a >>= 1
print(result%mod)
# Judge status: Wrong Answer
a,b = map(int, input().split())      

c = a*b

if c%2 == 1:
    print("Even")
else:
    print("Odd")
# Judge status: Wrong Answer
s=input()
score=0

for i in range(0,int(len(s)/2)):
  if s[i]!=s[len(s)-1-i]:
    score+=1

print(score)
# Judge status: Accepted
n,y = [int(e) for e in input().split()]
for i in range(n+1):
    for j in range(n-i+1):
        if 10000*i + 5000*j + 1000*(n-i-j) == y:
            print(i,j,n-i-j)
            break
    else:
        continue
    break
else:
    print("-1 -1 -1")
# Judge status: Accepted
Q, H, S, D = list(map(int, input().split()))
N = int(input())
res = 0
if N >= 2:
    res += min(D, S * 2, H * 4, Q * 8) * (N // 2)
    N %= 2
if N >= 1:
    res += min(S, H * 2, Q * 4)
print(res)
# Judge status: Wrong Answer
import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=a.index(min(a))
print(math.ceil(b/(k-1))+math.ceil((n-b-1)/(k-1)))
# Judge status: Accepted
DAY = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
print(7-DAY.index((input())))
# Judge status: Wrong Answer
def resolve():
    N, K = map(int, input().split())
    A = tuple(map(int, input().split()))
    path = [1]
    for i in range(2*N):
        cur = A[path[-1]-1]
        path.append(cur)

    if K < N:
        print(path[K])
        exit()

    end = path[N]
    si = N-1
    while path[si] != end:
        si -= 1
    dist = end - si +1
    K = K % dist
    while K < N:
        K += dist

    print(path[K])

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
a = int(input())
b = round(a**0.5) + 1
x = []
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            l = i**2 + j**2 + k**2 + i*j + j*k + k*i
            x.append(l)

t = [0] * a
for i in range(0,len(x)):
    if x[i] <= a:
        t[x[i]-1] = t[x[i]-1] + 1

for i in t:
    print(i)
# Judge status: Wrong Answer
n = int(input())
l = []
for _ in range(n):
    l.append(int(input()))

l.sort()
ans = sum(l)
if ans%10 != 0:
    print (ans)
    exit ()
else:
    for i in l:
        ans -= i
        if ans%10 != 0:
            print (ans)
            exit ()
print (ans)
# Judge status: Accepted
X = int(raw_input())

def check_prime(X):
    import math
    s = int(math.ceil(math.sqrt(X)))
    for a in range(2, s):
        if X % a == 0: 
            return False
    return True

while True:
    if check_prime(X): break
    X += 1

print X
# Judge status: Accepted
s = input()
li = ['Sunny', 'Cloudy', 'Rainy']
for i in range(3):
    if s==li[i]:
        print(li[(i+1)%3])
# Judge status: Accepted
S_p=input()
T=input()

k=[]
for i in range(len(S_p)-len(T)+1):
	S_sub = S_p[i:i+len(T)]
	if all(s in (t, "?") for s, t in zip(S_sub, T)):
		k.append(i)


if k:
	S=S_p[:k[-1]]+T+S_p[k[-1]+len(T):]
	print(S.replace("?", "a"))
else:
	print("UNRESTORABLE")
# Judge status: Accepted
n=int(input())
p=[int(x) for x in input().rstrip().split()]
l=[i+1 for i in range(n)]
cnt=0
for i in range(n):
  if l[i]!=p[i]:
    cnt+=1
if cnt==2 or cnt==0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n = int(input())
list = list(map(int, input().split()))
list.sort()
list.reverse()

a = 0
b = 0

for i in range(len(list)):
  if i % 2 == 0:
    a += list[i]
  else:
    b += list[i]

print(a - b)
# Judge status: Accepted

import math

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

res = math.ceil(1. * n / x) * t

print(res)
# Judge status: Accepted
import sys
N=input()
A=map(int, sys.stdin.readline().split())
B=map(int, sys.stdin.readline().split())
before=sum(B)

for i in range(N):
    if B[i]!=0:
        k=min(A[i],B[i])
        A[i]-=k
        B[i]-=k
    if B[i]!=0:
        k=min(A[i+1],B[i])
        A[i+1]-=k
        B[i]-=k
after=sum(B)
print before-after
# Judge status: Accepted
# n, k = map(int, input().split())
# n = int(input())
# li = list(map(int, input().split()))
s = input()
from collections import Counter
d = Counter(s)
if len(d.keys()) == 2 and all(i == 2 for i in d.values()):
	print("Yes")
else:
	print("No")
# Judge status: Accepted
x = int(input())
print(1 - x)
# Judge status: Accepted
import math
h,w = map(int,input().split())
if h == 1 or w == 1:
  result = 1
elif h % 2 == 0:
  result = math.floor(h / 2 * w)
elif w % 2 ==0:
  result = math.floor((h // 2 + 1)) * math.floor(w//2) + math.floor((h//2)) * math.floor(w//2)
else:
  result = math.floor((h//2 + 1)) * math.floor((w//2 + 1)) +  math.floor((h//2)) * math.floor(w//2)
  
print(result)
# Judge status: Accepted
from collections import Counter
w = list(input())
c = Counter(w)
for i in range(len(w)):
    if int(c[w[i]]) % 2 == 1:
        print('No')
        break
else:
    print('Yes')
# Judge status: Wrong Answer
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

S=a,b,c,d,e

if (max(S)-min(S))<15:
	print("Yay!")
else:
	print(":(")
# Judge status: Accepted
X, Y, A, B, C = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
 
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
 
p.append(float("inf"))
q.append(float("inf")) 

Z = 0
while Z < C:
  if min(p[X - 1], q[Y - 1]) < r[Z]:
    if p[X - 1] < q[Y - 1]:
      X -= 1
      Z += 1
    else:
      Y -= 1
      Z += 1
    continue
  break
 
print(sum(p[:X]) + sum(q[:Y]) + sum(r[:Z]))
# Judge status: Accepted
n, k, q = map(int,input().split())
di = {i:0 for i in range(1,n+1)}

for i in range(q):
  di[int(input())]+=1
  
giri_ans = q-k
  
for i in range(1,n+1):
  if di[i]>giri_ans:
    print('Yes')
  else:
    print('No')