peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())
ps = sorted(list(map(int, input().split())), reverse=True)
qs = sorted(list(map(int, input().split())), reverse=True)
rs = sorted(list(map(int, input().split())), reverse=True)

choice_apples = sorted(ps[:x] + qs[:y])
total = 0
j = 0

for i in choice_apples:
    if rs and i < rs[0]:
        total += rs[0]
        del rs[0]
    else:
        total += i

print(total)
# Judge status: Accepted
import fractions
a,b,c,d=map(int,input().split())
before=(a-1)//c+(a-1)//d-(a-1)//(c*d//fractions.gcd(c,d))
after=b//c+b//d-b//(c*d//fractions.gcd(c,d))
print(before-after-a+b+1)
# Judge status: Accepted
n = int(input())


ans = 1
for i in range(1, n):
  if i**2 > n:
    ans = (i-1)**2
    break


print(ans)
# Judge status: Accepted
S = input()
l_s = len(S)

cnt = 0

for i in range(0,l_s//2):
  if S[i] != S[-i-1]:
    cnt += 1

print(cnt)
# Judge status: Accepted
n = int(input())
a = ['pon', 'pon', 'hon', 'bon', 'hon', 'hon', 'pon', 'hon', 'pon', 'hon']
print(a[n%10])
# Judge status: Accepted
n = int(input())
res = 0
res += n // 11
n %= 11
res *= 2
if n == 0:
    pass
elif n < 7:
    res += 1
else:
    res += 2
print(res)
# Judge status: Accepted
X, N = map(int, input().split())
P = list(map(int, input().split()))

best = float('inf')
ans = -1
for a in range(102):
    if a in P:
        continue
    if best > abs(X - a):
        best = abs(X - a)
        ans = a
print(ans)
# Judge status: Accepted
N,K = map(int,(input().split()))
A = list(map(int,(input().split())))
for _ in range(min(K,100)):
    s = [0]*(N+1)
    for i in range(N):
        l = max(i - A[i],0)
        r = min(i + A[i] + 1,N)
        s[l] += 1
        s[r] -= 1
    for i in range(1,N):
        s[i] += s[i-1]
    for i in range(N):
        A[i] = s[i]
print(*A)
# Judge status: Accepted
A,B=map(int,input().split())
ans=-1
for i in range(1500):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans=i
        break
print(ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
prime = [True] * (10 ** 6 + 10)

b = sorted(set(a))

for i in b:
    num = i * 2
    while True:
        if num >= 10 ** 6 + 1:
            break
        prime[num] = False
        num += i

ans = 0
for s in a:
    if prime[s] == True and c[s] == 1:
        ans += 1

print(ans)
# Judge status: Wrong Answer
"""
10**15なので，ループで割ることを考える
1 + (6, 5)
"""

x = int(input())
count = 0
if x == 1:
    print(count)
    exit()
else:
    x -= 1
    count += 1

count += (x // 11) * 2
x = x % 11

# if x == 1 or x == 8 or x == 9:
#     count += 2
# elif x == 7 or x == 10:
#     count += 3
# elif x == 0:
#     print(count)
#     exit()
# else:
#     count += 1

print(count)
# Judge status: Wrong Answer
n = int(input())
a = []
for _ in range(2):
    a.append(list(map(int, input().split(" "))))

res = 0
for i in range(n):
    res += a[0][i]

    sum_row_1 = sum(a[0][i + 1:n])
    sum_row_2 = sum(a[1][i + 1:n])
    if sum_row_1 < sum_row_2:
        res += sum(a[1][i:n])
        break
    elif sum_row_1 == sum_row_2 == 0:
        res += a[1][i]
# Judge status: Wrong Answer
import sys

L, R = map(int, input().split())
m = 10*100
for i in range(L, R):
    for j in range(i+1, R+1):
        tmp = (i*j)%2019
        if tmp == 0:
            print(0)
            sys.exit()
        else:
            m = min(m, tmp)

print(m)
# Judge status: Accepted
n=int(input())
A=set(map(int,input().split()))
if len(A)==n:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    S=input()
    for i in range(-(-len(S)//2)-1,0,-1):
        if S[:i]*2==S[:i*2]:
            print(i*2)
            exit()

if __name__ == '__main__':
    main()
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())
ans = 'R'*(tx-sx)+'U'*(ty-sy)+'L'*(tx-sx)+'D'*(ty-sy)
ans += 'D'+'R'*(tx-sx+1)+'U'*(ty-sy+1)+'LU'+'L'*(tx-sx+1)+'D'*(ty-sy+1)+'R'
print(ans)
# Judge status: Accepted
n = input()
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
# from collections import Counter
# n = int(input())
# li = list(map(int, input().split()))
a, b = map(int, input().split())

# n = int(input())

print(a*b if a<10 and b<10 else -1)
# Judge status: Wrong Answer
n, x, t = [int(i) for i in input().split()]
print(n // x * t)
# Judge status: Accepted
# クッキー枚数（A,B）を整数で入力
A,B = map(int,input().split())
# AかBかA+Bのどれかを3匹に分けれればPossible、できなければImpossible
if A%3==0 or B%3==0 or (A+B)%3==0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Wrong Answer
N = int(input())
min = 10000000000000
for i in range(1, N//2):
  A = str(i)
  B = str(N - i)
  ref = 0
  for a in A:
    ref += int(a)
  for b in B:
    ref += int(b)
  if ref < min:
    min = ref
print(min)
# Judge status: Wrong Answer
a,b = map(int, input().split())
s = input()

if ("-" not in s[:a])&("-" not in s[b:])&(s[a]=="-"):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,M=map(int, input().split())
A=list(map(int, input().split()))
B = {}
C = {}
for i in range(M):
    B[i],C[i]=map(int, input().split())

high_scores = sorted(C.items(), key=lambda x:x[1], reverse=True)

sum_b = 0
for score in high_scores:
    sum_b += B[score[0]]
    if N < sum_b:
        A += [score[1]] *  (B[score[0]]-sum_b+N)
        break
    else:
        A += [score[1]] *  B[score[0]]

A.sort(reverse=True)
A = A[:N]

print(sum(A))
# Judge status: Accepted
n = int(input())
a = n // 500; b = n % 500 // 5
print(a * 1000 + b * 5)
# Judge status: Wrong Answer
p,q,r=map(int,input().split())
if p+q<q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
if q+r<p+r and q+r<p+q:
    print(q+r)
if p+r==q+r and p+r<p+q:
    print(p+r)
if p+q==q+r and p+q<p+r:
    print(p+q)
if p+q==p+r and p+q<p+q:
    print(r+q)
if p==q==r:
    print(p+q)
# Judge status: Accepted
k = int(input())
s = input()

if len(s) > k:
    s = s[:k] + '...'

print(s)
# Judge status: Wrong Answer
n = int(input())
csf = [list(map(int, input().split())) for _ in range(n-1)]

for i in range(n):
    ans = 0
    for j in range(i, n-1):
        if csf[j][1] >= ans:
            ans = csf[j][0] + csf[j][1]
        else:
            ans += csf[j][0] + (ans - csf[j][1]) % csf[j][2]
    print(ans)
# Judge status: Wrong Answer
k=int(input())
flag=True
seq=7
"""
これは階乗を含むのでO(klogk)で重い
for i in range(1,k):
  if (7*(10**i-1)//9) % k==0:
    print(i)
    flag=False
    break
"""
for i in range(1,k):
  if seq%k==0:
    print(i)
    flag=False
    break
  seq=(seq*10+7)%k  # %k(modの考え方)がなければ10**6ではO(k)は重すぎた
  
if flag:
  print(-1)
# Judge status: Wrong Answer
n = int(input())
A = []
B = []
ans = 0

for _ in range(n):
  a,b = map(int,input().split())
  A.append(a)
  B.append(b)
  
for _ in range(n):
  a = A.pop(-1)
  b = B.pop(-1)
  a += ans
  ans += a%b
print(ans)
# Judge status: Wrong Answer
n,m = map(int,input().rstrip().split(' '))
G = [[]]*n
for i in range(m):
  a,b = map(int,input().rstrip().split(' '))
  a-=1
  b-=1
  G[a].append(b)
  G[b].append(a)

for i in range(n):
  print(len(G[i]))
# Judge status: Accepted
n,k,*a = map(int,open(0).read().split())
def func(b):
  c = k
  for i in a:
    c -= (i-1)//b
    if c < 0:
      return False
  return True
l = 1
r = max(a)
while(r>l):
  lr = (l+r)//2
  if func(lr):
    r = lr
  else:
    l = lr + 1
print(r)
# Judge status: Accepted
n=input()
l=[]
for i in range(len(n)-2):
    l.append(int(n[i:i+3]))
l2=list(map(lambda x: abs(753-x),l))
print(min(l2))
# Judge status: Accepted
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())

if V<=W:
	print('NO')
else:
	if abs(A-B)<=abs(V-W)*T:
		print('YES')
	else:
		print('NO')
# Judge status: Accepted

A, B = map(str, input().split())
A = int(A)
B = int(B.replace(".",""))
ans = A * B // 100

print(ans)
# Judge status: Wrong Answer
from math import log2
from heapq import heappop, heapify, heappush
def main():
    n, m = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A = [-log2(a) for a in A]
    heapify(A)
    for _ in range(m):
        a = heappop(A)
        a += 1
        heappush(A, a)
    print(sum([int(pow(2, -a)) for a in A]))

if __name__ == '__main__':
    main()
# Judge status: Accepted
import collections
n=int(input())
l=[]
for i in range(n):
  l.append(input())
c=collections.Counter(l)
for k in ['AC','WA','TLE','RE']:
  if k in c.keys():
    print(k+' x '+str(c[k]))
  else: print(k+' x '+str(0))
# Judge status: Accepted
A,B=map(int,input().split())
cnt=0
for i in range(A,B+1):
    if str(i)==str(i)[::-1]:
        cnt+=1
print(cnt)
# Judge status: Accepted
n,k=map(int,input().split())
s=input()
ans=0
for i in range(n-1):
  ans+=1 if s[i]==s[i+1] else 0
print(min(ans+2*k,n-1))
# Judge status: Wrong Answer
#import sys
#import numpy as np
import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect

Mod=998244353

n=int(input())
d=list(map(int,input().split()))
c=Counter(d)
ans=1
for i in c:
  if i==0:
    if c[i]!=1:
      print(0)
      exit()
  else:
    if i-1 not in c:
      print(0)
      exit()
    else:
      ans*=pow(c[i-1],c[i],Mod)
      ans%=Mod
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
n=[a,b,c]
m=len([i for i in n if i==5])
p=len([i for i in n if i==7])
if m==2 and p==1:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
from collections import Counter
from copy import deepcopy

n = int(input())
c = Counter([])
dic = Counter([])
for ch in str(input()):
    c[ch] += 1
    dic[ch] += 1

for _ in range(n-1):
    tmp = deepcopy(c)
    for ch in str(input()):
        if tmp[ch] > 0:
            tmp[ch] -= 1
            dic[ch] += 1
l = []
for s, i in Counter(dic).items():
    for _ in range(i//n):
        l.append(s)

l.sort()
print(''.join(l))
# Judge status: Accepted
from math import sqrt
c = 0
N ,D = map(int,input().split())
for i in range(N):
    x, y = map(int, input().split())
    T = sqrt(x**2 + y**2)
    if T <= round(D):
        c = c+1
print(c)
# Judge status: Wrong Answer
N,A,B,C,D=map(int,input().split())
S=input()

if C<D:
    for i in range(N-1):
        if S[i]==S[i+1] and S[i]=='#':
            print('No')
            exit()
    print('Yes')
else:
    cnt=0
    for i in range(B,D):
        if S[i]=='.':
            cnt+=1
        else:
            cnt=0
        if cnt==3:
            print('Yes')
            exit()
    print('No')
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())
dx=tx-sx
dy=ty-sy
u="U"
d="D"
r="R"
l="L"
print(u*dy+r*dx+d*dy+l*dx+l+u*(dy+1)+r*(dx+1)+d+r+d*(dy+1)+l*(dx+1)+u)
# Judge status: Wrong Answer
import itertools


n = int(input())
geo = [list(map(int, input().split())) for i in range(n)]

sum_dist = 0
num_pattern = 0

for pattern in itertools.permutations([i for i in range(n)], n):
    print(pattern)
    for i in range(1, n):
        x, y = geo[pattern[i]]
        x_prev, y_prev = geo[pattern[i-1]]
        d = ((x-x_prev) ** 2 + (y-y_prev) ** 2) ** 0.5
        sum_dist += d
    num_pattern += 1

print(sum_dist / num_pattern)
# Judge status: Accepted
import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))
ai = a.max()

v, aj = 0, 0
for i in a:
    tmp = i * (ai - i)
    if v < tmp:
        v = tmp
        aj = i
# print(v, aj)
print(*(ai, aj))
# Judge status: Accepted
X = int(input())
ans = int(X/1.08)
if int(ans*1.08) == X:
  print(ans)
elif int((ans+1)*1.08) == X:
  print(ans+1)
else:
  print(':(')
# Judge status: Wrong Answer

#!/usr/bin/python
# -*- coding: utf-8 -*-

import numpy as np
import collections

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)

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

ans = []
x1 = 10**9
ans.append(x1)

for i in range(1,N):
    ans.append(a[0]^a[i]^x1)

print(' '.join(map(str, ans)))
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
A=[0]+A
B=[]
for i in range(N):
  k=N-i 
  c=0
  for i in range(k,N+1,k):
    c+=A[i]
    c%=2
  if A[k]!=(c-A[k])%2:
    B.append(k)
print(len(B))
for i in B:
  print(i)
# Judge status: Accepted
N=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]

can = sum(b)-sum(a)
actA,actB = 0,0
for i in range(N):
    diff = b[i]-a[i]
    if diff==0:continue
    if diff>0:
        actA+=(diff+1)//2
        actB+=diff%2
    else:
        actB+=(-diff)
leftA = can-actA
leftB = can-actB
print("Yes" if leftA>=0 and leftA*2==leftB else "No")
# Judge status: Accepted
num = int(input())

hun = num // 100
ten = (num % 100) // 10
one = num % 10

print(hun+ten+one)
# Judge status: Wrong Answer
n, l = map(int, input().split())
ll = []

for i in range(1, n+1):
    ll.append(i + l - 1)

if ll[0]>= 0:
    ans = sum(ll) - ll[0]
elif ll[n-1]<=0:
    ans = sum(ll) - ll[n-1]
else:
    if n != 3:
        for i in range(1, n-1):
            if abs(ll[i-1]) < abs(ll[i]) < abs(ll[i+1]):
                ans = sum(ll) - ll[i]
    else:
        ans = sum(ll) - ll[1]

print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
As = list(mapint())

ans = 0
for i in range(N):
    a = As[i]
    if a%2==1 and (i+1)%2==1:
        ans += 1

print(ans)
# Judge status: Accepted
N = int(input())
l,r=1,N
while r-l>1:
  m=(l+r)//2
  s=m*(m+1)//2
  if s>=N:
    r=m
  else:
    l=m
for i in range(1,r+1):
  if i!=r*(r+1)//2-N:
    print(i)
# Judge status: Accepted
a, b = map(int, input().split())

if a < 10 and b < 10:
  print(a*b)
else:
  print(-1)
# Judge status: Accepted
n, a, b = map(int, input().split())

num_lists = list(range(1, n+1, 1))
sum_lists = []
for i in num_lists:
  count = 0
  j = i
  while j >0:
    ans = j%10
    count += ans
    j = j//10
  if a <= count and count <= b:
    sum_lists.append(i)

answer = 0
for i in sum_lists:
  answer += i

print(answer)
# Judge status: Accepted
N,M = map(int,input().split())
SC = []
for i in range(M):
    SC.append(list(map(int,input().split())))
for i in range(0,1000):
    si = str(i)
    if len(si) != N:
        continue
    flag = False
    for s,c in SC:
        s = s-1
        if si[s] != str(c):
            flag = True
    if not flag:
        print(i)
        exit()
print(-1)
# Judge status: Accepted
A,B,C,D=map(int,input().split())

s=min(B,D)-max(A,C)
print(max(0,s))
# Judge status: Accepted
import fractions
n=int(input())
t=[]
for _ in range(n):
    T=int(input())
    t.append(T)
ans=t[0]
for i in range(1, len(t)):
    ans = ans * t[i] // fractions.gcd(ans, t[i])
print(ans)
# Judge status: Accepted
_, s, _ = input().split()
print("A" + s[0] + "C")
# Judge status: Wrong Answer
a = input().split()
q = int(a[0]) * 4
h = int(a[1]) * 2
s = int(a[2])
d = int(a[3]) / 2
b = int(input())

if min([q,h,s,d]) != d:
  print(b * min([q,h,s,d]))
else:
  if b % 2 == 0:
    print(int(b * d))
  elif b != 1:
    print(int((b-1) * d) + min([q,h,s]))
  else:
    print(min([q,h,s]))
# Judge status: Accepted
n,m = map(int,input().split())
xy = [[int(i) for i in input().split()] for _ in range(m)]
num = [1]*n
red = [False]*n
red[0] = True
flag = True
for i in range(m):
    p = xy[i][0]
    q = xy[i][1]
    num[p-1] -= 1
    num[q-1] += 1
    if red[p-1]==True:
        red[q-1] = True
    
    if num[p-1]==0:
        red[p-1] = False
        

count = 0
for i in range(n):
    if num[i]>0 and red[i]:
        count += 1
print(count)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
s = input()
print(len(s))
b_cnt = 0
a_cnt = 0
for i in range(n):
    if s[i] == "a" and (a_cnt+b_cnt) < a+b:
        a_cnt += 1
        print("Yes")
    elif s[i] == "b" and (a_cnt+b_cnt) < a+b and b_cnt < b:
        #print(b_cnt)
        b_cnt += 1
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N=int(input())
k=(N-1)//11
ans=2*k
if N-k*11<=6:
  ans+=1
else:
  ans+=2
print(ans)
# Judge status: Wrong Answer
x = int(input())

cnt = x // 11
x -= 11 * cnt
cnt = cnt * 2 + 1
if x > 6:
   cnt += 1
print(cnt)
# Judge status: Wrong Answer
A,B,C,K=map(int,input().split())
print(A,B,C,K)
if A+B>=K:
    print(A)
else:
    print(A-C)
# Judge status: Accepted
s=input()
t=input()
if s==t:
    print("No")
    exit()

s1=[s[i] for i in range(len(s))]
t1=[t[i] for i in range(len(t))]
s1.sort()
t1.sort(reverse=True)
S="".join(s1)
T="".join(t1)
#print(S,T)
l=[S,T]
l.sort()
if l[0]==S:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
    n = int(input())

    chars = 'zabcdefghijklmnopqrstuvwxy'

    st = ''
    while True:
        a = n % 26
        st += chars[a]
        n = n // 26
        if n == 0 or (a == 0 and n == 1):
            break
        elif a == 0:
            n -= 1


    res = ''.join(list(reversed(st)))
    print(res)


main()
# Judge status: Wrong Answer
import heapq

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

nums = [n * -1 for n in nums]
heapq.heapify(nums)

while M > 0:
    curr = heapq.heappop(nums)
    heapq.heappush(nums,curr//2)
    M -=1

print(-sum(nums))
# Judge status: Wrong Answer
a = list(map(int,input().split()))
max = -10 ** 11
for i in range(2):
  for j in range(2,4):
    p = a[i] * a[j]
    #print(p)
    if abs(max) < abs(p) and 0 < p:
      max = p
    elif abs(p) < abs(max) and 0 > p:
      max = p
print(max)
# Judge status: Accepted
d8 = [105, 135, 165, 189, 195]
n = int(input())
print(sum([1 for i in d8 if i <= n]))
# Judge status: Wrong Answer
s = [input() for i in range(2)] 
s0 = int(s[0])
l0 = len(s[1])
if s0 >= l0:
    print(s[1])
if s0 < l0:
    print(s[1][:s0],'...')
# Judge status: Accepted
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)
mod = 10**9+7

x = i()
num = (x//11)*11
r = x-num
if r == 0:
    print((x//11)*2)
elif r <= 6:
    print((x//11)*2+1)
else:
    print(((x//11)+1)*2)
# Judge status: Wrong Answer
n, m = map(int, input().split())

A = [input() for _ in range(n)]
B = [input() for _ in range(m)]

def issubset(l, u, r, d):
    for i, y in enumerate(range(u, d)):
        for j, x in enumerate(range(l, r)):
            res = A[y][x] == B[i][j]
            if not res:
                return False
    return True

for y in range(n - m):
    for x in range(n - m):
        if issubset(x, y, x+m, y+m):
            print("Yes")
            exit()

print("No")
# Judge status: Accepted
#!/usr/bin/env python3
A = [[int(str) for str in input().strip().split()] for _ in range(3)]
N = int(input().strip())
b = [int(input().strip()) for _ in range(N)]


ans = False
for i in range(3):
    ans |= all([A[i][j] in b for j in range(3)])

for j in range(3):
    ans |= all([A[i][j] in b for i in range(3)])

ans |= all([A[i][i] in b for i in range(3)])
ans |= all([A[i][2 - i] in b for i in range(3)])

print('Yes' if ans else 'No')
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))

if n == 2:
    print(max(sum(A), -sum(A)))
    exit()

for i in range(n-2):
    if A[i] < 0:
        A[i] *= (-1)
        A[i+1] *= (-1)
s = sum(A[0:(n-2)])
ans = max(s+A[n-2]+A[n-1], s-A[n-2]-A[n-1])
print(ans)
# Judge status: Wrong Answer
N,M=map(int,input().split())
p=[list(input().split()) for _ in range(M)]
AC_count=0
WA_count=0
AC_flag=0
if M==0:
  print(0,0)
  exit()
if p[0][1]=="WA" and AC_flag==0:
  WA_count+=1
else:
  AC_count+=1
  AC_flag=1

for i in range(1,M):
  if p[i-1][0]!=p[i][0]:
    AC_flag=0
  if p[i][1]=="WA" and AC_flag==0:
    WA_count+=1
  elif p[i][1]=="AC" and AC_flag==0:
    AC_count+=1
    AC_flag=1
print(AC_count,WA_count)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
for i in range(1, n + 1):
  if i <= k:
    sum += x
  else:
    sum += y
print(sum)
# Judge status: Accepted
import math
A,B,H,M=list(map(int,input().split()))
move = 60*H+M
a_move = math.radians(move/720*360)
b_move = math.radians(M/60*360)

ax = A*math.cos(a_move)
ay = A*math.sin(a_move)
bx = B*math.cos(b_move)
by = B*math.sin(b_move)

ans = math.sqrt(math.pow(ax-bx,2) + math.pow(ay-by,2))
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())

if N < K:
    print(K - N)
else:
    print(N - (N // K) * K)
# Judge status: Accepted
num = list(map(int, input().split()))
a = list(map(int, input().split()))
tmp = num[0]-sum(a)
if tmp<0:
    print(-1)
else:
    print(tmp)
# Judge status: Accepted
def check_my(string):
    if 1 <= int(string) <= 12:
        return 'YorM'
    else:
        return 'Y'

s = input()
my_set = (check_my(s[0:2]), check_my(s[2:4]))
if my_set == ('YorM', 'YorM'):
    print('AMBIGUOUS')
elif my_set == ('YorM', 'Y'):
    print('MMYY')
elif my_set == ('Y', 'YorM'):
    print('YYMM')
else:
    print('NA')
# Judge status: Wrong Answer
n = int(input())
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o','p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
ans = ""
for i in range(11, -1, -1):
    if i==0: res=n
    else: res = n//(26**i)
    if res%26 == 0: continue
    else:
        ans += a[res%26-1]
print(ans)
# Judge status: Accepted
def main():
    N,K,Q=map(int,input().split())
    A=[int(input()) for i in range(Q)]
    n=[K-Q]*N
    for a in A:
        n[a-1]+=1
    for i in n:
        print('Yes' if i>0 else 'No')

main()
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
x=(sum(a)-a[n-1])*(sum(a)-a[0])
print(x%(10**9+7))
# Judge status: Wrong Answer
c = str(input())
boin = ['a', 'b', 'c', 'd', 'e']
if c in boin:
    ans = 'vowel'
else:
    ans = 'consonant'
print(ans)
# Judge status: Accepted
from decimal import Decimal
import math
'''
a=10**15
b=9.99
'''
a,b=map(Decimal,input().split())

num=a*b
#print(num)

num=math.floor(num)
print(num)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans = 1000
for i in range(N - 1):
    a = A[i]
    if a < A[i + 1]:
        units = ans // a
        ans = (ans - units * a) + units * A[i + 1]
    # print(i, ans)

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)
point_sum = 0

for i in range(1, n+1):
    point_sum += a[i*2 - 1]

print(point_sum)
# Judge status: Wrong Answer
A, B = map(int, input().split())
if 13 <= A:
    print(B)
elif 6 <= A <= 12:
    print(B / 2)
elif 0 <= A <= 5:
    print(0)
# Judge status: Accepted
def decomposition_prime(n):
    i = 2
    li = []
    while i*i <= n:
        while n%i == 0:
            li.append(i)
            n /= i
        i += 1
    if n > 1:
        li.append(int(n))
    return li

a, b = map(int, input().split())
ap = decomposition_prime(a)
bp = decomposition_prime(b)

print(len(set(ap) & set(bp))+1)
# Judge status: Wrong Answer
from collections import defaultdict 
import sys
import math 

def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

n = int(input())

start = 0
for i in range(1,n+1):
	start = (start*10+7)%n
	if start==0:
		print(i)
		break
else:
	print(-1)
# Judge status: Accepted
n=int(input())
ans=[1]
i=2

while n>sum(ans):
  ans.append(i)
  i+=1
if n!=sum(ans):
  ans.remove(sum(ans)-n)
[print(i) for i in ans]