peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math
m=10**9+7
n,a,b=map(int,input().split())
if(a>n//2):
  a = n-a
if(b>n//2):
  b = n-b
aa=min(a,b)
bb=max(a,b)
na=1
nb=1
da=1
db=1
for i in range(aa):
  na=na*(n-i)%m
  da=da*(1+i)%m
  nb=nb*(n-i)%m
  db=db*(1+i)%m
for i in range(aa,bb):
  nb=nb*(n-i)%m
  db=db*(1+i)%m
CA=(na*pow(da,m-2,m))%m
CB=(nb*pow(db,m-2,m))%m
c=pow(2,n,m)-CA-CB-1
print(c%m)
# Judge status: Accepted
N = input()
if N.count("7") > 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
result = 'No'
for i in range(1,10):
    if n / i in [1,2,3,4,5,6,7,8,9]:
        result = 'Yes'
print(result)
# Judge status: Wrong Answer
N = int(input())
W = list(map(int,input().split()))
s1 = 0;s2 = 0
min = 1001001001
for T in range(1,N-1):
  for i in range(T):
    s1 += W[i]
  for i in range(T,N):
    s2 += W[i]
  if abs(s1-s2) < min:
    min = abs(s1-s2)
  s1 = 0;s2 = 0
print(min)
# Judge status: Wrong Answer
A,B,N = list(map(int,input().split()))

print(min(N,B-1))
# Judge status: Wrong Answer
s=list(str(input()))

print('Yes' if len(list(set(s)))==len(s) else 'No')
# Judge status: Accepted
#!/usr/bin/env python3
n, d = map(int, input().split())
d = d**2
ans = 0
for _ in range(n):
    x, y = map(int, input().split())
    if x**2 + y**2 <= d:
        ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
arr = []
for i in range(2, int(-(-N**0.5//1))+1):
  if N == 1:
    break
  if N % i == 0:
    cnt = 0
    while N % i == 0:
      cnt += 1
      N = int(N / i)
    arr.append([i, cnt])

if N != 1:
  arr.append([N, 1])

n = 0
for p, e in arr:
  temp = e
  j = 0
  while temp > 0:
    j += 1
    temp = temp - j
    if temp < 0:
      break
    n += 1

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

if k % 2 == 0 or k % 5 == 0:
    print(-1)
    exit()

n = 7
for i in range(1,10**7):
    if n%k == 0:
        print(i)
        break
    else:
        n = (n%k +0.7) *10
# Judge status: Accepted
s = list(input())
t = list(input())


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

a = []
a.append(s)
a.append(t)

if a == sorted(a) and s != t:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math


def resolve():
    import sys
    input = sys.stdin.readline
    # row = [int(x) for x in input().rstrip().split(" ")]
    # n = int(input().rstrip())
    s = int(input().rstrip())
    opened = set()
    opened.add(s)
    prev = s
    m = 1
    while True:
        m += 1
        y = int(prev / 2) if prev % 2 == 0 else (3 * prev + 1)
        if y in opened:
            print(m)
            break
        prev = y
        opened.add(y)









if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
n = int(input())
a = list(input() for i in range(n))
M = max(a)

if a.count(M) > 1:
  for i in range(n):
    print(M)
else:
  M2 = sorted(set(a))[-2]
  for i in range(n):
    if a[i] == M:
      print(M2)
    else:
      print(M)
# Judge status: Wrong Answer
a, b = map( int, input().split())
 
c = max(a,b)-min(a,b)
if c % 2 == 0:
  print(c // 2)
else:
  print("IMPOSSIBLE")
# Judge status: Wrong Answer
N, K= map(int,input().split())
A = list(map(int,input().split()))
p=0
while p<41:
  B=[0]*(N+1)
  for i in range(N):
    l = max(i-A[i],0)
    r = min(i+A[i]+1,N)
    B[l] +=1
    B[r] -=1
  for i in range(N):
    A[i] = sum(B[0:i+1])
  p +=1        
  if min(A)==N:
    break
print(*A)
# Judge status: Accepted
n, m = [int(w) for w in input().split()]

lb = [False] * n
lb[0] = True
lbn = [1] * n

for i in range(m):
    x, y = [int(w)-1 for w in input().split()]
    if lb[x] and lbn[x] > 0:
        lb[y] = True
    lbn[x] -= 1
    lbn[y] += 1

    if lb[x] and lbn[x] == 0:
        lb[x] = False

print(len([_ for _ in lb if _]))
# Judge status: Accepted
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
ans = 0
for i in range(1, N+1):
    ans += i
print(ans)
# Judge status: Wrong Answer
x,y = map(int,input().split())
li = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11], [2]]
for i, l in enumerate(li):
    if x in l and y in l:
        print("YES")
        break
    if i == len(li) - 1:
        print("No")
# Judge status: Wrong Answer
x_max, y_max, N = map(int, input().split())
x_min, y_min = 0, 0
l = [input().split() for _ in range(N)]
for i in range(N):
  if l[i][2] == 1:
    x_min = max(x_min, l[i][0])
  elif l[i][2] == 2:
    x_max = min(x_max, l[i][0])
  elif l[i][2] == 3:
    y_min = max(y_min, l[i][1])
  elif l[i][2] == 4:
    y_max = min(y_max, l[i][1])
if x_max-x_min > 0 and y_max-y_min:
  print((x_max-x_min)*(y_max-y_min))
else:
  print(0)
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))

from itertools import accumulate
for i in range(min(k,100)):
  l=[0]*(n+2)
  for j in range(n):
    left=max(0,j-a[j])
    right=min(n,j+a[j])
    l[left]+=1
    l[right+1]-=1
  s=list(accumulate(l))
  # print(s)
  a=s[:n]
print(*a)
# Judge status: Accepted
a,sums= list(map(int,input().split()))
yuki = sums//10000
taishi = (sums%10000) //5000
noguchi = (sums%5000) //1000
while a>yuki+taishi+noguchi:
  if ((a-(yuki+taishi+noguchi))%4==0)&(taishi>0):
    taishi-=1
    noguchi+=5
  elif yuki>0:
    yuki-=1
    taishi+=2
  else:
    break
if a==yuki+taishi+noguchi:
  print(yuki,taishi,noguchi)
else:
  print("-1 -1 -1")
# Judge status: Wrong Answer
N, *A = map(int, open(0).read().split())

C = {}
for a in A:
    if a in C.keys():
        C[a] += 1
    else:
        C[a] = 1
B = list(C.items())
B.sort(key=lambda x: x[0])

ans = max(B[0][1], B[-1][1])
for i in range(1, len(B)-1):
    count = B[i][1]
    if B[i-1][0] == B[i][0]-1:
        count += B[i-1][1]
    if B[i+1][0] == B[i][0]+1:
        count += B[i+1][1]
    ans = max(ans, count)
print(ans)
# Judge status: Wrong Answer
import sys

x, y = map(int, input().split()) # x:頭数 y:足
for i in range(x):
    if i * 4 + (x - i) * 2 == y:
        print('Yes')
        sys.exit()

print('No')
# Judge status: Wrong Answer
import math
x,y = map(int,input().split())
n = math.log2(y/x)
if n - int(n) == 0:
    n = int(n)
else:
    n = int(n)+1
print(n)
# Judge status: Accepted
#!/usr/bin/python3
n = int(input())
if(n%1000==0):
	print("0")
else:
	ans = n%1000
	print(1000-ans)
# Judge status: Accepted
print(1 if input().strip() == "0" else 0)
# Judge status: Wrong Answer
N,M,Q = map(int,input().split())
num_list = []
for i in range(Q):
    num_list.append(list(map(int,input().split())))


A_list = [1]*N
# Judge status: Wrong Answer
print(eval((input()+"*0.5").replace(" ","+")))
# Judge status: Accepted
N,Q = map(int, input().split())
S = str(input())

before = ''
i = 0
num = 0
data_list = {}
for s in S:
    if before == 'A' and s == 'C':
        num += 1
    before = s
    data_list[i] = num
    i += 1

ans = ''
for q in range(Q):
    r,l = map(int, input().split())
    ans += str(data_list[l-1]-data_list[r-1])+'\n'

print(ans.rstrip())
# Judge status: Wrong Answer
A, B, C = map(int, input().split(' '))

print(max(C, B // A))
# Judge status: Accepted
n = int(input())
dis = [list(map(int,input().split())) for _ in range(n)]
ans = 0
num = 0
from itertools import permutations
for path in list(permutations(range(n))):
  num += 1
  path = list(path)
  distance = 0
  for i in range(1,n):
    xi = dis[path[i-1]][0]
    xj = dis[path[i]][0]
    yi = dis[path[i-1]][1]
    yj = dis[path[i]][1]
    distance += (pow(xi-xj,2)+pow(yi-yj,2))**0.5
  ans = ans + distance
ans = ans/num
print(ans)
# 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()))
    S = set(A)

    if len(S) == N:
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, M = map(int,input().split())
A_B = [list(map(int, input().split())) for i in range(N)]

day = 0
ans = 0
A_B = sorted(A_B, key=lambda x:(-x[1], -x[0]))
#print(A_B)
for i in range(N):
  #print(day)
  if day + A_B[i][0] <= M:
    ans += A_B[i][1]
  day += 1
print(ans)
# Judge status: Accepted
import fractions
from functools import reduce
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)



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

N = int(input())
a = [int(input()) for i in range(N)]

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

result = 0
if len(str(N)) % 2 == 0:
    loop = ((len(str(N)) - 1) -1) //2 + 1
    print(loop)
    for i in range(loop):
        result += 9 * pow(10,2*i)
else:
    for i in range(len(str(N)) - 2):
        result += 9 * pow(10,i)
    result += N - pow(10,len(str(N)) - 1) + 1

print(result)
# Judge status: Wrong Answer
N, Y = map(int, input().split())

res = False

a = 0
b = 0
c = 0

for i in range(N + 1):
    for q in range(N + 1):
        c = N - (i + q)
        total = 10000*i + 5000*q + 1000*c
        if total == Y:
            res = True
            a = i
            b = q
            d = c

if res:
    print('{} {} {}'.format(a, b, d))
else:
    print('-1 -1 -1')
# Judge status: Accepted
import math
n = int(input())
ten = [list(map(int,input().split())) for i in range(n)]
a = 0

for i, j in ten:
  for k, u in ten:
    a += math.sqrt((i - k)**2 + (j - u)**2)

print(a/n)
# Judge status: Accepted
n=int(input())
ans=(n//11)*2
n%=11
if n>=7:ans+=2
elif n:ans+=1
print(ans)
# Judge status: Accepted
icase=0
if icase==0:
    n=int(input())
    w=list(map(int,input().split()))
    ws=[0]*n
    ws[0]=w[0]
    for i in range(1,n):
        ws[i]=ws[i-1]+w[i]
    wdmin=100000
    for i in range(n):
        wd=abs(ws[-1]-2*ws[i])
        wdmin=min(wdmin,wd)
    print(wdmin)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = 0
while all(A%2 == 0 for A in a):
	a = [i/2 for i in a ]
	ans += 1
print(ans)
# Judge status: Wrong Answer
H,A=map(int,input().split())

print(H//A+1)
# Judge status: Wrong Answer
N = int(input())
A = [int(input()) for i in range(N)]
sorted_A = sorted(A)

pre = sorted_A[0]
ans = 0
if len(sorted_A) == 1:
    print(1)
else:
    count = 1
    for i in range(1, len(sorted_A)):
        if sorted_A[i] == pre:
            count += 1
        else:
            if count % 2 == 1:
                ans += 1
            pre = sorted_A[i]
            count = 1
    print(ans)
# Judge status: Accepted
x,a,b = map(int,input().split())
if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")
# Judge status: Wrong Answer
a,b,t = map(int, input().split())
if a > t:
    print(0)
else:
    total = int(t/a + 0.5)
    print(total * b)
# Judge status: Accepted
n=int(input())
from collections import defaultdict
d=defaultdict(int)

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

sm=0
for i in range(1,10):
  for j in range(1,10):
    sm+=d[str(i)+str(j)]*d[str(j)+str(i)]
print(sm)
# Judge status: Accepted
s = input()
cond = False
key = "keyence"

for i in range(len(s)+1):
    for j in range(i, len(s)+1):
        mod_s = s[:i]+s[j:]
        if mod_s == key:
            cond = True


print("YES" if cond else "NO")
# Judge status: Accepted
import statistics

N = int(input())
A = []
B = []
for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

A_med = statistics.median(A)
B_med = statistics.median(B)

if N % 2 == 0:
    ans = int((B_med - A_med) * 2 + 1)
else:
    ans = int((B_med - A_med) + 1)

print(ans)
# Judge status: Wrong Answer
w, h, x, y = map(int, input().split())
h_y = abs(y - h/2)
w_x = abs(x - w/2)
yoko = h_y*w
tate = w_x*h
ans = w*h/2 - min(tate, yoko)
flag = 0
if tate == yoko:
    flag = 1
print(ans, flag)
# Judge status: Accepted
x = int(input())
num = (x - 1) // 11 * 2 + 1
if x % 11 > 6 or x % 11 == 0:
    num += 1
print(num)
# Judge status: Accepted
n = int(input())
s = ''
while n != 0:
    r = n % 2
    if r < 0:
        r += 2
    n = (n - r) // (-2)
    s += str(0 + r)
if s == '':
    print(0)
else:
    print(s[::-1])
# Judge status: Wrong Answer
x,a,b=map(int,input().split())
print(min([abs(x-a),abs(x-b)]))
# Judge status: Accepted
#!/usr/bin/env python3


def main():
    N, K = map(int,input().split())
    p = list(map(int,input().split()))
    p.sort()
    print(sum(p[:K]))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
L=[int(input()) for _ in range(5)]
k=int(input())
if sum(L)<k*5:
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
n,m = map(int,input().split())
x = [0]*m
y = [0]*m
for i in range(m): 
    x[i],y[i] = map(int,input().split())
    x[i] -= 1
    y[i] -= 1
cnt = [1]*n
flag = [False]*n
flag[0] = True
for i in range(m):
    if flag[x[i]]: 
        flag[y[i]] = True
        if cnt[x[i]] == 1: 
            flag[x[i]] = False
    cnt[x[i]] -= 1
    cnt[y[i]] += 1
    
print(flag.count(True))
# Judge status: Accepted
X, K, D = map(int,input().split())
XX = abs(X)
if K > XX // D:
    if (K - (XX // D)) % 2 == 0:
        ans = XX - (XX // D) * D
        print(abs(ans))
    else:
        ans = (XX - (XX // D) * D) - D
        print(abs(ans))
else:
    ans = XX - D * K
    print(abs(ans))
# Judge status: Accepted
x,a,b = map(int,input().split())
print('A' if abs(x-a) < abs(x-b) else 'B')
# Judge status: Accepted
import sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(input())
    a = list(map(int, input().split()))
    for i in range(n):
        if (i+1)%2==1 and a[i]%2==1:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
k,n=map(int,input().split())
ans=""
for i in range(n-k+1,n+k-1):
  ans+=str(i)+" "
print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
start = [0]*200001
goal = [0]*200001

for i in range(m):
  a,b = map(int,input().split())
  if a == 1:
    if goal[b] == 1:
      print("POSSIBLE")
      exit()
    start[b] = 1
    a
  elif b == n:
    if start[a] == 1:
      print("POSSIBLE")
      exit()
    goal[a] = 1
print("IMPOSSIBLE")
# Judge status: Accepted
from numpy import *
N = int(input())
A = list(map(int,input().split()))
B = array(sorted([A[n]-(n+1) for n in range(N)]))
print(sum(abs(B-int(median(B)))))
# Judge status: Accepted
n = int(input())

for i in range(n, 1000):
    nstr = str(i)
    if nstr[0] == nstr[1] and nstr[1] == nstr[2]:
        print(i)
        break
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(n-1):
  if a[i] == a[i+1]:
    print('NO')
    exit(0)
print('YES')
# Judge status: Wrong Answer
import math

dp = [float('inf') for _ in range(200000)]
withdraw = []

N = int(input())

#引き出し可能な金額の配列にする
withdraw.append(1)

for i in range( math.floor(math.log(N,6)) + 1):
    withdraw.append(6**i)

for i in range( math.floor(math.log(N,9)) + 1):
    withdraw.append(9**i)

withdraw = sorted(list(set(withdraw)))

dp[0] = 0

for i in range(N+1):
    for j in withdraw:
        dp[i+j] = min(dp[i+j],dp[i]+1)
        
print(dp[N])
# Judge status: Wrong Answer
import math
mod=10**9+7

def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def comb(n, r, mod = 10**9 + 7):
    return ( framod(n,mod) * pow(framod(n-r,mod),mod-2,mod ) * pow(framod(r,mod),mod-2,mod))
X,Y=map(int,input().split())
if X % 3 == 0 and Y % 3 ==0:
  s,t= ( 2*X - Y ) // 3 , (2*Y - X) // 3
  print(comb(s+t,s) % mod)
else:
  print(0)
# Judge status: Accepted
from collections import defaultdict

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

bool_list = [True] * (10 ** 6 + 1)

duplicate_dic = defaultdict(int)
for a in A:
    duplicate_dic[a] += 1
    if duplicate_dic[a] > 1:
        bool_list[a] = False

for a in A_sort:
    for i in range(2*a, 10 ** 6 + 1, a):
        bool_list[i] = False

print(sum([1 for a in A_sort if bool_list[a]]))
# Judge status: Accepted
# 入力
n = int(input())

# 出力
answer = 0
for i in range(1, n + 1):
    if not i % 3 == 0 and not i % 5 == 0:
        answer += i

print(answer)
# Judge status: Wrong Answer
n,m=map(int,input().split())
num=m//n
while num!=0:
    if m%num==0:print(num);break
    else:
        num **=0.5
        num=int(num)
# Judge status: Accepted
s = input()
k = int(input())
n = len(s)
le = [""]*n
ne = []

for i in range(n):
    le[i] = s[i]
    if s[i] == "a":
        ne.append(0)
    else:
        ne.append(123-ord(s[i]))
        
rem = k
for i in range(n):
    if rem >= ne[i]:
        rem -= ne[i]
        le[i] = 'a'
        
saigo = ord(le[n-1]) - 97
ssm = (rem+saigo) % 26
le[n-1] = chr(97+ssm)

print(*le,sep = "")
# Judge status: Accepted
x=int(input())
ans=0
for i in range(2,10):
    for j in range(1,1001):
        tmp=j**i
        if tmp<=x:
            ans=max(tmp,ans)
print(ans)
# Judge status: Accepted
S=input()
ans=0
kouho=0
for i in range(len(S)):
  if S[i]=="R":
    kouho+=1
    ans=max(ans,kouho)
  else:
    kouho=0
print(ans)
# Judge status: Accepted
import sys
n, a, b, c, d = map(int, input().split())
s = input()
for i in range(a+1, c-1):
    if s[i-1]==s[i]=='#':
        print('No')
        sys.exit()
for i in range(b+1, d-1):
    if s[i-1]==s[i]=='#':
        print('No')
        sys.exit()
if c<d:
    print('Yes')
else:
    for i in range(b-1, d):
        if s[i-1]==s[i]==s[i+1]=='.':
            print('Yes')
            sys.exit()
    print('No')
# Judge status: Accepted
L, R, d = map(int, input().split())

count = 0
for i in range(L, R + 1):
    if i % d == 0:
        count += 1

print(count)
# Judge status: Wrong Answer
s = input()
t = input()
a_1 = len(s)
a_2 = len(t)
if a_1+1 == a_2:
    for i in range(a_1):
        if s[i] != t[i]:
            ans = "No"
        else:
            ans = "Yes"
else :
    ans = "No"
print(ans)
# Judge status: Accepted
r, g, b = map(int, input().split())
    
number = 100*r + 10*g + b

if number%4 == 0:
    ans = 'YES'
else:
    ans = 'NO'

print(ans)
# Judge status: Accepted
N,M = [int(i) for i in input().split()]
if N%2 == 1:
    for i in range(1,M+1):
        print(i, end=" ")
        print(N+1-i)
    exit()
L = min(M,N//4)
for i in range(1,L+1):
    print(i,end=" ")
    print(N+1-i)
if L < M:
    for i in range(L+1,M+1):
        print(i,end=" ")
        print(N-i)
# Judge status: Accepted
s = input()
partition = s.replace('><','>|<').split('|')
ans=0
for sub in partition:
    left = sub.count('<')
    right = sub.count('>')
    ans += sum(range(1, max(left, right)+1))+sum(range(1, min(left, right)))
    
print(ans)
# Judge status: Wrong Answer
H,W=map(int,input().split())
P=H*W
if P % 2==0:
  print(int(P/2))
else:
  print(int(P/2+1))
# Judge status: Accepted
K = int(input())
S = input()
if len(S) <= K:
  print(S)
else:
  print(S[:K] + '...')
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
coins = [1,5,10,50,100,500]
if a in coins and b in coins:
    if a+b >= c:
        print("Yes")
    else: print("No")
else: print("No")
# Judge status: Accepted
import math


def main():
    s = int(input())
    quo = int(s/3)
    count = 0

    for i in range(1, quo+1):
        a = math.factorial((s-3*i)+(i-1))
        b = math.factorial(s-3*i)
        c = math.factorial(i-1)
        add = a//(b*c)
        count += add

    return count % (10**9+7)


if __name__ == "__main__":
    print(main())
# Judge status: Accepted
a, b, c = map(int, input().split())

a -= b

if a > c:
    print(0)
else:
    print(c-a)
# Judge status: Wrong Answer
a, b, x = [int(x) for x in input().split()]

cnt_a = a // x
cnt_b = b // x

print(cnt_b-cnt_a)
# Judge status: Wrong Answer
import math
a=input().split()
A,B=int(a[0]),int(a[1])
p=int(A/0.08)
if(math.floor(p*0.1)==B):
  print(p)
else:
  print(-1)
# Judge status: Wrong Answer
import math

A, B = list(input().split())
A = int(A)
B = '{:.2f}'.format(float(B)).replace('.', '')
B = int(B)

# A *= 100
# B = int(B * 100)


AB = A * B / 100
floored = int(math.floor(AB))
print(floored)

# AB = A * B
# AB = str(AB)
# AB = AB[0:-2]
# AB = 0 if AB == '' else AB
# print(AB)
# Judge status: Accepted
n=int(input())
lst=map(int,input().split())
od=0
fo=0

for a in lst:
    if (a%4)%2==1:
        od+=1
    elif a%4==0:
        fo+=1
if fo>=od:
    print("Yes")
elif 2*fo+1==n:
    print("Yes")
else:
    print("No")
# Judge status: Accepted

def main():
    
    kinds = list(map(int,input().split()))
    prices = list(map(int,input().split()))
    
    minPrice = 0
    
    for item in range(kinds[1]):
        minPrice += min(prices)
        prices.remove(min(prices))

    print(minPrice)         
    
  

if __name__ == "__main__":
    main()
# Judge status: Accepted
A, B = input().split()
print(int(A) * round(float(B) * 100) // 100)
# Judge status: Accepted
import math
n = int(input())
ans = math.pi * 2 * n
print(ans)
# Judge status: Accepted
S=input()

def No():
    print("No")
    exit()
def Yes():
    print("Yes")
    exit()
if len(S)%2!=0:
    No()
if len(S)==0:
    No()
    
if all([S[2*i:2*i+2]=="hi" for i in range(int(len(S)/2))]):
    Yes()
else:
    No()
# Judge status: Accepted
a,b,c=map(int,input().split())

l=[a,b,c]
l.sort(reverse=True)
x_max=l[0]
x_mid=l[1]
x_min=l[2]
count=0
count+=l[0]-l[1]
dif=l[0]-(l[2]+count)
if dif%2==0:
    count+=dif//2
else:
    count+=dif//2+2
print(count)
# Judge status: Accepted
# coding: utf-8
# Your code here!

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

if sum(A) <= N:
    print(N - sum(A))
else:
    print(-1)
# Judge status: Accepted
x=int(input())
large_approach=x//11
short_approach=x%11

if short_approach==0:
  print(large_approach*2)
elif short_approach<=6:
  print(large_approach*2+1)
else:
  print(large_approach*2+2)
# Judge status: Accepted
icase=48        
if icase==48:
    a,b,c=input().split()
    print("A"+b[0]+"C")
# Judge status: Accepted
n=int(input())
a = list(map(int,input().split()))
_sum =sum(a) / n
s  = round(_sum)
ans = 0
#print(s)
for i in range(n):
    v =(a[i]-s)**2
    ans += v
print(ans)
# Judge status: Accepted
s = input()
data = len(s)
s = list(s)
j = 0
for i in s:
  if j%2 == 0:
    if i != "h":
      break
  if j%2 == 1:
    if i != "i":
      break
  j += 1

      
if j == data and data%2 == 0:
  print("Yes")
else:
    print("No")
# Judge status: Accepted
import bisect
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
A = A[::-1]
S = [A[0]]
c = 1
for i in range(1, N):
    t = A[i]
    if t >= S[-1]:
        S.append(t)
        c += 1
    else:
        p = bisect.bisect_right(S, t)
        S[p] = t
print(c)
# Judge status: Wrong Answer
import itertools
import math
N=int(input())
P=tuple(map(int,input().split()))
Q=tuple(map(int,input().split()))

l=[ i+1 for i in range(N) ]
Per=itertools.permutations(l,N)
Per=list(Per)
num=[-1,-1]
for i in range(math.factorial(N)):
  if Per[i]==P:
    num[0]=i
  elif Per[i]==Q:
    num[1]=i
print(abs(num[0]-num[1]))
# Judge status: Wrong Answer
import itertools

N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for i in range(Q)]

answer = 0

nums=[]
for i in range(1, M+1):
    nums.append(i)

for balls in itertools.combinations_with_replacement(nums, N):
    score = 0
    for i in range(Q):
        test = list(balls)
        print(test)
        if test[abcd[i][0]-1] + abcd[i][2] == test[abcd[i][1]-1]:
            score += abcd[i][3]
    if score > answer:
        answer = score

print(answer)
# Judge status: Accepted
a,b,c = map(int, input().split())

A = b - a
B = c - b

if A==B:
    print("YES")
else :
    print("NO")
# Judge status: Accepted
N  =int(input())
a = list(map(int,input().split()))
ans = (10**9)
for av in range(min(a),max(a)+1):
    Sum = 0
    for i in range(N):
        Sum += (a[i]-av)**2
    if Sum < ans:
        ans = Sum
print(ans)
# Judge status: Accepted
arr = input()
cnt = 0
for a in arr:
    if a == 'A':
        cnt += 1

if cnt == 0 or cnt == len(arr):
    print("No")
else:
    print("Yes")
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

print((min(N,K)*X) + (max(0,(N-K))*Y))
# Judge status: Accepted
from math import ceil
n = int(input())
print(ceil(n/2))
# Judge status: Accepted
n = int(input())
import fractions
A = list(map(int,input().split()))
g = 0
for i in range(n):
    g = fractions.gcd(g,A[i])
print(g)