peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math
a, b = map(int, input().split())

ans = -1
for i in range(1, 1251):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
        ans = i
        break
print(ans)
# Judge status: Accepted
n = int(input())
s = input()
w = []
e = []
cnt_w, cnt_e = 0, 0
for i in range(n):
    if s[i] == "W":
        cnt_w += 1
    else:
        cnt_e += 1
    w.append(cnt_w)
    e.append(cnt_e)

f_inf = float("inf")
res = f_inf
for i in range(n):
    if s[i] == "W":
        t = w[i] - w[0] + e[len(e) - 1] - e[i]
    else:
        t = w[i] + e[len(e) - 1] - e[i]
    res = min(res, t)
print(res)
# Judge status: Accepted
from sys import stdin
def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())

n = I()
s = S()

ans = 0
x = 0

for i in range(n):
    if s[i] == 'I':
        x += 1
        if ans < x:
            ans = x
    else:
        x -= 1

print(ans)
# Judge status: Wrong Answer
N = int(input())
arr = [list(map(int, input().split())) for i in range(N)]

ans = 0
for i in range(N - 1, -1, -1):
    a, b = arr[i]
    if b == 1:
        continue
    if a % b == 0:
        continue
    a += ans
    ans += b - (a % b)

print(ans)
# Judge status: Accepted
def main():

    N, X, T = map(int, input().split())
    if N % X == 0: return N // X * T
    else: return (N//X + 1) * T


if __name__ == '__main__':
    print(main())
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range (1,n-1):
  if p[i-1]<=p[i]<=p[i+1] or p[i+1]<=p[i]<=p[i-1]:
    ans+=1
print(ans)
# Judge status: Accepted
import sys
import heapq
input = sys.stdin.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = (-1)*A[i]

heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, int(a/2))

print(abs(sum(A)))
# Judge status: Accepted
n, x = [int(w) for w in input().split()]
a_li = [int(w) for w in input().split()]
a_li.sort()

ans = 0
for a in a_li:
    x -= a
    if x >= 0:
        ans += 1
    else:
        break

if x == 0:
    pass
else:
    if x > 0:
        ans = max(ans - 1, 0)

print(ans)
# Judge status: Wrong Answer
a, b = [int(x) for x in input().split()]
print((b - a) // (a - 1) + 1)
# Judge status: Accepted
# NはSの個数、MはCの個数
N, M = map(int, input().split())

# 既存のSを消費しきれない場合
if M < 2 * N:
    # Cの個数のみでSccの数が決まる
    print(M // 2)

# 既存のSを消費し切れる場合
else:
    ans_1 = N
    M = M - 2 * N
    ans_2 = M // 4
    print(ans_1 + ans_2)
# Judge status: Accepted
# --- coding: utf-8 ---

a, b = map(int, input().split())
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
# Judge status: Wrong Answer
n, m, k = list(map(int, input().split()))
for i in range(n+1):
    for j in range(m+1):
        if (n-j)*i + (m-i)*j == k:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
N,T=map(int,input().split())
li=[list(map(int,input().split())) for i in range(N)]
li2=[]
for i in range(N):
  if li[i][1]<=T:
    li2.append(li[i])
li2.sort()
if len(li2)==0:
  print('TLE')
  exit()
print(li2[0][0])
# Judge status: Accepted
import math
n = int(input())
a = [int(input()) for _ in range(5)]
print(math.ceil(n / min(a)) + 4)
# Judge status: Accepted
K, X = map(int, input().split())
if 500*K >= X:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math
N,K = map(int,input().split(' '))
A = map(int,input().split(' '))

# 最初
N = N - K

if N == 0:
    print(1)
else:
    print(math.ceil(N/(K-1))+1)
# Judge status: Accepted
s=input()
l=len(s)
ans=0
for i in range(l):
  for j in range(1,l-i+1):
    t=s[i:i+j]
    for k in range(j):
      if t[k]=='A' or t[k]=='C' or t[k]=='G' or t[k]=='T':
        continue
      else:
        break
    else:
      ans=max(ans,j)
print(ans)
# Judge status: Wrong Answer
a, b, k = map(int, input().split())
s = set(range(a, min(b + 1, a + k)))
s |= set(range(b, max(a - 1, b - k)))
s = sorted(s)
print('\n'.join(map(str, s)))
# Judge status: Wrong Answer
L = [int(i) for i in str(input())]
for i in range(2 ** 3):
    l = ['+'] * 3
    for j in range(3):
        if ((i >> j) & 1):
            l[j] = '-'
    s = L[0]
    for k in range(3):
        if l[k] == '+':
            s += L[k + 1]
        else:
            s -= L[k + 1]
    if s == 7:
        for m in range(3):
            print(str(L[m]) + str(l[m]), end='')
        print(str(L[3]) + '=7')
# Judge status: Accepted
n,m = map(int,input().split())
if n % 2 == 1:ans = [[1+i,n-i] for i in range(n//2)]
else:ans = [[1+i,n-i] for i in range(n//4)]+[[n//2+1+i,n//2-1-i] for i in range(n//2-n//4-1)]
for i in range(m):print(ans[i][0],ans[i][1])
# Judge status: Accepted
def test(length, cost):
    tmp = length.replace('()', '')
    if len(length) < 2 or len(tmp) == len(length):
        return length
    return test(tmp, len(length))

n = int(input())
s = input()
last = test(s, len(s))
print(last.count(')') * '(' + s + last.count('(') * ')')
# Judge status: Accepted
A, B, C = map(int, input().split())
print('Yes' if A<C<B or B<C<A else 'No')
# Judge status: Accepted
import fractions
a,b,c,d = map(int, input().split())

def lcm(a,b):
    return a * b // fractions.gcd(a, b)

def count(num, a, b):
    return int(num - num//a - num//b + num//lcm(a,b))

print(count(b,c,d)-count(a-1,c,d))
# Judge status: Accepted
n,x=map(int,input().split())
l=list(map(int,input().split()))

d=0
cnt=1

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

print(cnt)
# Judge status: Accepted
N, M = map(int, input().split())
print(int(N*(N-1)/2 + M*(M-1)/2))
# Judge status: Accepted
N = int(input())
S = input()
left_cnt = 0
right_cnt = 0
for c in S:
    if '(' == c:
        left_cnt += 1
    elif left_cnt == 0:
        right_cnt += 1
    else:
        left_cnt -= 1
#print(right_cnt, left_cnt)
print('(' * right_cnt + S + ')' * left_cnt)
# Judge status: Accepted
N = int(input())
A = [0]
for _ in range(N):
    A.append(int(input()))
S = set()
i = 1
cnt = 0
while i != 2 and not i in S:
    S.add(i)
    i = A[i]
    cnt += 1
if i == 2:
    print(cnt)
else:
    print(-1)
# Judge status: Wrong Answer
s=input()
if s[-1]==s:
    print(s+"s")
else:
    print(s+"es")
# Judge status: Wrong Answer
import collections

n = int(input())
s = [input() for i in range(n)]
w = ""

if n == 1:
    r = collections.Counter(s[0])
    for k, v in r.items():
        w += k * r[k]
    print(w)
    exit()
a = collections.Counter(s[0])
b = collections.Counter(s[1])
res = a & b
if n <= 2:
    for k in sorted(res):
        w += k * res[k]
    print(w)
else:
    for i in s[2:]:
        res = res & collections.Counter(i)
    if not res:
        print("")
    for k in sorted(res):
        w += k * res[k]
    print(w)
# Judge status: Accepted
N = int(input())
list = [0]*(N+1)
for i in range(1,100):  
    for j in range(1,100):
        a = i*i + j*j + i*j
        for k in range(1,100):
            a = i*i + j*j + k*k + i*j +j*k + i*k
            if a <= N:
                list[a] += 1
for i in range(1,N+1):
    print(list[i])
# Judge status: Wrong Answer
from bisect import bisect_right

def cal(X):
    S,T = [],[]
    for i in range(len(X)):
        if X[i] == "S":
            S.append(i)
        else:
            T.append(i)

    pt = bisect_right(S,T[len(T)-1])
    return 2*(len(S)-pt)

def main():
    X = input()
    print(cal(X))

if __name__ == "__main__":
    main()
# Judge status: Accepted
Q, H, S, D = map(int, input().split())
N = int(input())

D = min(8 * Q, 4 * H, 2 * S, D)
S = min(4 * Q, 2 * H, S)
ans = (N // 2) * D + (N % 2) * S
print(ans)
# Judge status: Wrong Answer
N,K = list(map(int, input().split()))
S = str(input())
s = [S[i] for i in range(len(S))]
ans = (s[K-1].lower)
print(ans)
# Judge status: Accepted
import collections

n, k = map(int, input().split())
ls = list(map(str, input().split()))

c = collections.Counter(ls)
ls_s = c.most_common()

l = len(ls_s)
ans = 0

if l <= k:
	print(0)
else:
	for i in range(l - k):
		ans += ls_s[-1][1]
		del ls_s[-1]
	print(ans)
# Judge status: Accepted
n=int(input())
print(n+n**2+n**3)
# Judge status: Wrong Answer
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
s = input()
t = input()

if s==t and len(s)>=n:
  print(len(s))
  exit()
if n>=len(s)+len(t):
  print(n)
  exit()

de = 0
for i in range(min(len(s),len(t))):
  if s[i*-1-1]==t[i]:
    de+=1
  else:
    break

print(len(s)+len(t)-de)
# Judge status: Accepted
a, b, c, x, y = map(int, input().split())
# print(a, b, c, x, y)

ans = 10000 * (10 **5) + 7
c_max = 0
if x > y:
  c_max = x * 2
else:
  c_max = y * 2

for cc in range(0, c_max+1, 2):
  ac = x - (cc // 2)
  bc = y - (cc // 2)
  
  if ac < 0:
    ac = 0
  if bc < 0:
    bc = 0
  price = ac * a + bc * b + cc * c
  # print('price: {}, ac: {}, bc: {}, cc: {}'.format(price, ac, bc, cc))
  ans = min(ans, price)

print(ans)
# Judge status: Accepted
import math
a, b, c = map(int, input().split())
ab = a * b
out = c - a - b
num = ((out))**2
if out < 0:
  num = -num 
if 4*ab < num:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
X, N = list(map(int, input().split()))
P = list(map(int, input().split()))

ans = float('inf')
cnt = 0
while ans == float('inf'):
  ans_plus = X + cnt
  ans_minus = X - cnt
  if not ans_plus in P:
    ans = ans_plus
  if not ans_minus in P:
    ans = min(ans, ans_minus)
  cnt += 1

print(ans)
# Judge status: Accepted

a,b,c=map(int,input().split())
if a<b:
  a,b=b,a
if b<c:
  b,c=c,b
if a<b:
  a,b=b,a
print(10*a+b+c)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
four = 0
two = 0

for e in A:
  if e % 4 == 0:
    four += 1
  elif e % 2 == 0:
    two += 1
if (four*2+two)>=(N-1):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
s=input()
s=s.replace("eraser","")
s=s.replace("erase","")
s=s.replace("dreamer","")
s=s.replace("drea,","")
if s:
    print("NO")
else:
    print("YES")
# Judge status: Wrong Answer
s = input()
a = [0]*3
for i in s:
    a[ord(i)-97] += 1
a = sorted(a)
A=a[2]-a[0]
B=a[1]-a[0]
#print(A,B)
if A == 1 and B == 0:
    print("YES")
elif A-B==1 and a[0]==0:
    print("NO")
elif A-B>1:
    print("NO")
else:
    print("YES")
# Judge status: Wrong Answer
N,A,B = list(map(int,input().split()))

cnt = 0
for n in range(1,N):
    val = 0
    tmp = n
    while tmp // 10 > 0:
        val += tmp % 10
        tmp = tmp // 10
    
    if val >= A and val <= B:
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = str(input())

i = 0
while len(T) > i+K:
  if T[i] == T[i+K]:
    if len(T) > i+K+1:
      T = T[:i+K] + T[i+K+1:]
    else:
      T = T[:i+K]
  i += 1

score = 0
for i in range(len(T)):
  if T[i] == 'r':
    score += P
  elif T[i] == 's':
    score += R
  else:
    score += S
    
print(score)
# Judge status: Accepted
a, b = map(int, input().split())
if 13 <= a:
    print(b)
elif 6 <= a <= 12:
    print(b // 2)
else:
    print(0)
# Judge status: Accepted
from collections import Counter
a = input()
b_list = list(map(int, input().split()))

counter = Counter(b_list)
ans = 0

for num, count in counter.most_common():
  if num == count:
    pass
  else:
    if num < count:
      ans += count - num
    elif num > count:
      ans += count
print(ans)
# Judge status: Wrong Answer
import sys
import math
from collections import deque
input = sys.stdin.readline
N, K = map(int,input().split())
H = deque(map(int,input().split()))
ans = 0
for i in range(N-K):
    ans += H[i]
print(ans)
# Judge status: Wrong Answer
input_str1 = input()
input_str2 = input()
sum([input_str1[i]!=input_str2[i] for i in range(len(input_str1))])
# Judge status: Accepted
import math
k, n = map(int,input().split())
a = list(map(int,input().split()))

ans = 10**9
for i in range(n):
  if i == 0:
    a1 = a[-1]-a[0]
    a2 = a[0]+(k-a[1])
    ans = min(ans,a1,a2)
  else:
    a1 = (k-a[i])+a[i-1]
    ans = min(ans,a1)
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a >= 13:
    print(b)
elif a >= 5:
    print(b//2)
else:
    print(0)
# Judge status: Wrong Answer
N,X=map(int,input().split())
*C,=map(int,input().split())

t=[c-X for c in C]

import math
from functools import reduce
print(reduce(math.gcd, t))
# Judge status: Wrong Answer
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
m = [[0]*3 for i in range(3)]
ans,l,r = 0,1,1
for _ in range(N):
  b = int(input())
  for i in range(3):
    if b in A[i]:
      m[i][A[i].index(b)]=1
                
for i in range(3):
  l *= m[i][i]
  t,y = 1,1
  for j in range(3):
    y *= m[j][i]
    t *= m[i][j]
    if i+j == 2:
      r *= m[i][j]
  if t or y or r or l:
    ans=1

print('Yes' if ans else 'No')
# Judge status: Accepted
W = list(input())

ans = []
a = 0
for i in W:
  if i == 'R':
    a += 1
  else:
    ans.append(a)
    a = 0

ans.append(a)
print(max(ans))
# Judge status: Accepted
N = int(input())
S = str(input())
T = S[0:N//2]
if S == (T+T):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
from sys import stdin
input = stdin.readline


def main():
  A, B = input().split()
  A = int(A)
  B = int(100*float(B))

  print((A*B)//100)


if(__name__ == '__main__'):
  main()
# Judge status: Accepted
n=input()
if int(n[-1]) in [2, 4, 5, 7, 9]:
  print("hon")
elif int(n[-1]) in [0, 1, 6, 8]:
  print("pon")
else:
  print("bon")
# Judge status: Accepted
# -*- coding: utf-8 -*-
a = input()
print(chr(ord(a)+1))
# Judge status: Wrong Answer
n = int(input())
d = list(map(int ,input().split()))

d.sort()
mod = 998244353
s = [0 for i in range(max(d)+1)]

for i in range(n):
  s[d[i]] += 1
ans = 1
for i in range(len(s)):
  if s[i] == 0:
    print (0)
    exit()
  if i == 0:
    if s[i] > 1:
      print (0)
      exit()
    continue
  ans *= s[i-1]**(s[i])
  ans %= mod
print (ans)
# Judge status: Wrong Answer
a,b,c = list(map(int,input().strip().split()))

if a*100 + b*10 +c %4 ==0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n, k, *aa = map(int, open(0).read().split())

imp_length = 0
psbl_length = max(aa)

while psbl_length - imp_length > 1:
    mid = (psbl_length + imp_length) // 2
    cost = sum(0 - -a // mid - 1 for a in aa)
    if cost <= k:
        psbl_length = mid
    else:
        imp_length = mid

print(psbl_length)
# Judge status: Accepted
from bisect import bisect
N = int(input())
dp = [1]*N
for _ in range(N):
  a=-int(input())
  n=bisect(dp,a)
  dp[n]=a
print(sum(1 for i in dp if i <= 0))
# Judge status: Wrong Answer
n, x, t = map(int, input().split())
yash = n / x

pattu = yash * t
print(int(pattu))
# Judge status: Accepted
A,B = map(int,input().split())
if A < 9 and B < 9:
    print('Yay!')
else:
    print(':(')
# Judge status: Wrong Answer
n,T= map(int,input().split())
min = 1000
for i in range(n):
    c,t = map(int,input().split())
    if T >= t and min > c:
        min = c
if min ==1000:
    print('TLE')
else:
    print(min)
# Judge status: Accepted
import sys
import itertools

input = sys.stdin.readline


def main():
    N = int(input())
    A = list(map(int, input().split()))
    A = A[::-1]
    B = list(itertools.accumulate(A))
    MOD = 10**9+7
    ans = 0
    for i in range(N - 2, -1, -1):
        ans = (ans + A[i + 1] * B[i]) % MOD
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import math
a,b,x=map(int,input().split())
if x==a*a*b:
  print(90)
elif x/2>=a*b/2:
  tangent=a**2 / ((a*b-x/a)*2)
  print(90-math.atan(tangent)*180/math.pi)
else:
  tangent=2*x/(a*(b**2))
  print(90-math.atan(tangent)*180/math.pi)
# Judge status: Accepted
n = int(input())

p = list(map(int,input().split(' ')))

c = 0

for i in range(1, len(p)-1):
  f = p[i-1]
  s = p[i]
  t = p[i+1]
  ma = max(f,t)
  mi = min(f,t)
  if s > mi and s < ma:
    c += 1

print(c)
# Judge status: Accepted
X=int(input())
if X==7 or X==5 or X==3:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n = int(input())
w = [int(s) for s in input().split()]

acc = [sum(w[:x]) for x in range(1, n + 1)]
center = acc[n - 1] / 2
index = 0

for i in range(n):
    if acc[i] >= center:
        if abs(center - acc[i]) < abs(center - acc[i - 1]):
            index = i
        else:
            index = i - 1
        break
print(abs((acc[n - 1] - acc[index]) - acc[index]))
# Judge status: Accepted
n = int(input())
s = input()
t = ''
for i in range(len(s)):
    num = ord(s[i]) + n
    if num > 90: t += chr(num-26)
    else: t += chr(num)

print(t)
# Judge status: Wrong Answer
n , m , k  = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
counter = 0

while k >= 0:
  if len(a) == 0 and len(b) == 0:
    break
  elif len(a) == 0:
    k -= b.pop(0)
  elif len(b) == 0:
    k -= a.pop(0)
  else:
    if  a[0] > b[0]:
      k -= b.pop(0)
    else:
      k -= a.pop(0)
  counter += 1
if k < 0:
  counter -= 1
print(counter)
# Judge status: Accepted
import itertools

n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
citys = [i for i in range(n)]
roots = list(itertools.permutations(citys))

sum = 0
for root in roots:
    for i in range(n-1):
        sum += ((xy[root[i]][0] - xy[root[i+1]][0])**2 + (xy[root[i]][1] - xy[root[i+1]][1])**2)**(0.5)


print(sum/len(roots))
# Judge status: Accepted
X,A,B=map(int,input().split())
date=A-B
if date>=0:
    ans="delicious"
elif abs(date)>X:
    ans="dangerous"
else:
    ans="safe"
print(ans)
# Judge status: Wrong Answer
from collections import Counter

s=input()
t=input()

c1=Counter(s)
c2=Counter(t)

k1=sorted(c1.keys())
k2=sorted(c2.keys())

if len(k1)==len(k2):
  for i in range(len(k1)):
    if c1[k1[i]]!=c2[k2[i]]:
      print('No')
      exit()
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
x,a,b = map(int, input().split())
if b - a <= x:
    print("safe")
elif b - a <= 0 :
    print("delicious")
else:
    print("dangerous")
# Judge status: Accepted
n,k = map(int,input().split())
p = list(map(int,input().split()))
p = sorted(p)
ans = 0
for i in range(k):
    ans += p[i]
print(ans)
# Judge status: Wrong Answer
N = int(input())
p = list(map(int,input().split()))
cnt = 0
for i in range(N):
    if p[0] == 1:
        value = p[i]
        p[i] = p[i+1]
        p[i+1] = value
        cnt += 1
    elif p[i] == i+1:
        value = p[i]
        p[i] = p[i-1]
        p[i-1] = value
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int, input().split()))
t=0
for i in range(len(a)):
  if i%2==0:
    t+=a[n-i-1]
  else:
    t-=a[n-i-1]
print(t)
# Judge status: Wrong Answer
H,W = (int(x) for x in input().split())
if (H*W)%2==1:
  print(int((H*W-1)//2 + 1))
else:
  print(int((H*W)//2))
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())

p = [int(x) for x in input().split()]
p.sort(reverse=True)
p = p[:x]

q = [int(x) for x in input().split()]
q.sort(reverse=True)
q = q[:y]
r = [int(x) for x in input().split()]
r.sort(reverse=True)

sub = p+q+r
sub.sort(reverse=True)
ans = sum(sub[:x+y])
print(ans)
# Judge status: Wrong Answer
a,b,c = list(map(int, input().strip().split()))
f=0
if a==b and b==c:
    f=-1
    print(f)
else:
    while a%2==0 and b%2==0 and c%2==0:
        A=a
        B=b
        C=c
        a=B//2+C//2
        b=A//2+C//2
        c=A//2+B//2
        f=f+1
    else:
        print(f)
# Judge status: Accepted
dish = list(int(input()) for _ in range(5))

res = 0
s = 0
for i in dish:
    i %= 10
    if i != 0:
        res = max(res, 10 - i)
        s += 10 - i

print(sum(dish) + s - res)
# Judge status: Wrong Answer
A,B,C = map(int, input().split())

def even(a):
	if a % 2 == 0:
		return True
	else:
		return False

cnt = 0
if A == B and B == C:
	cnt = -1

elif not (even(A) and even(B) and even(C)):
		cnt = 0

else:
	cnt = 0
	while even(A) and even(B) and even(C):
		tmp1, tmp2, tmp3 = A,B,C
		A = (tmp2+tmp3) // 2
		B = (tmp3+tmp1) // 2
		C = (tmp1+tmp2) // 2
		cnt += 1

print(cnt)
# Judge status: Accepted
# -*- coding: utf-8 -*-
# 整数の入力
lis = list(map(int,input().split()))
lists = []
inc = 0
# スペース区切りの整数の入力
for i in range(2):
    for j in range(2):
        lists.append(lis[i]*lis[j+2])
        inc += 1

    
# 出力
print("{}".format(max(lists)))
# Judge status: Accepted
n = int(input())
as_ = list(map(int, input().strip().split()))
as_ = sorted(as_, reverse=True)
total = sum([as_[i] for i in range(n * 2) if i % 2 == 1])
print(total)
# Judge status: Accepted
#144_C
import math

n = int(input())
m = math.floor(math.sqrt(n))

div = 1
for i in range(1,m+1):
    if n % i == 0:
        div = i
        
print(int(div + n/div -2))
# Judge status: Accepted
x = int(input())

jitubu = x//11
tiisai = x-(jitubu*11)

if x%11 == 0:
    print(jitubu*2)
elif tiisai>6:
    print((jitubu*2)+2)
else:
    print((jitubu*2)+1)
# Judge status: Accepted
a,v = map(int,input().split())
b,w = map(int,input().split())
t=int(input())

if abs(b - a) <= (v - w) * t:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())

count = 0
n_black = 0
list_mesh = [H, W]

while n_black < N:
    id_max = list_mesh.index(max(list_mesh))
    n_black += list_mesh[id_max]
    list_mesh[id_max] -= 1
    count += 1

print(count)
# Judge status: Accepted
a,b,h=[int(input()) for i in range(0,3)]
print((a+b)*h//2)
# Judge status: Accepted
# https://atcoder.jp/contests/abc056/tasks/abc056_b

W, a, b = map(int, input().split())

if a < b and a+W < b:
    ans = abs(a+W - b)
elif b < a and b+W < a:
    ans = abs(b+W - a)
else:
    ans = 0

print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
ans=0
for i in range(61):
    count0=0
    count1=0
    for j in a:
        if not (j>>i & 1):
            count0+=1
        if j>>i & 1:
            count1+=1
    ans+=((count0*count1)*(2**i))%mod
    print(count0,count1)
print(ans%mod)
# Judge status: Accepted
n,k = map(int,input().split())
if n%k:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
n = int(input())
li = list(map(int,input().split()))
lee = len(li)
sorted_li = sorted(li)
mid = sorted_li[lee//2]
mid_next = sorted_li[lee//2-1]
for l in li:
    if l != mid:
        print(mid)
    else:
        print(mid_next)
# Judge status: Accepted
a,b,c = map(int,(input().split()))
if a+b >= c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,c = map(int,input().split())
if(b+c >= a):
  print(b+c-a)
else:
  print(0)
# Judge status: Accepted
#D
#バケットnum[v]:=A1,A2,...,Anの中に値vが何個あるか　を作って考える
n = int(input())
a = list(map(int,input().split()))
q = int(input())
#合計を計算しておく
sum_a = sum(a)
#バケットの作成
v = [0 for _ in range(10**5)]
for i in range(n):
    v[a[i]-1] += 1
# main loop    
for i in range(q):
    b,c = map(int,input().split())
    sum_a += (c - b)* v[b-1]
    v[c-1] += v[b-1]
    v[b-1] = 0
    print(sum_a)
# Judge status: Wrong Answer
a,b,x= map(int,input().split())

import math

print(math.degrees(math.atan(a*b*b/(2*x))))
# Judge status: Accepted
def main():
    n,k=map(int,input().split(' '))
    s=input()
    print(s[0:k-1],end='')
    print(s[k-1].lower(),end='')
    print(s[k:n+1])

main()
# Judge status: Wrong Answer
s=input()
c=0
for i in range(0,3):
  if s[i]==1:
    c+=1
    
print(c)
# Judge status: Accepted
S = list(input())
T = list(input())
flag = True
for _ in range(len(S)):
    last = S.pop()
    S.insert(0, last)
    if S == T:
        print('Yes')
        flag = False
        break
if flag:
    print('No')
# Judge status: Wrong Answer
n, m = map(int,input().split())

a_list = list(map(int,input().split()))

r = n-sum(a_list)
print(r if r > 0 else -1)
# Judge status: Accepted
n, m = map(int, input().split())
ab = [0] * m
for i in range(m):
    ab[i] = list(map(int, input().split()))
roads = [0] * n
for a, b in ab:
    roads[a-1] += 1
    roads[b-1] += 1
for i in roads:
    print(i)
# Judge status: Wrong Answer
A, B, C, K = map(int, input().split())

if K % 2 == 0:
    ans = B - A
    if abs(ans) > 10**18:
        print("Unfair")
    else:
        print(ans)
else:
    ans = A - B
    if abs(ans) > 10**18:
        print("Unfair")
    else:
        print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
k-=1
a=list(map(int, input().split()))
i=n-1
print(-(-i//k)-(-(n-i-1)//k))#pythonで切り上げの書き方