peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def solve(A,N):
    A.sort(reverse = True)
    ans = A[0]
    if N % 2 == 0:
        pt = N // 2 - 1
        for i in range(1,pt+1):
            ans += (2 * A[i])
    else:
        pt = (N-1) // 2
        for i in range(1,pt):
            ans += (2 * A[i])
        ans += A[pt]
    return ans

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

    print(solve(A,N))

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import string
Al = string.ascii_lowercase
N = int(input())
S = 0
for i in range(1,16):
    S += 26**i
    if N < S:
        maxi = i
        break
Answer = []
for i in range(maxi):
    j = maxi - (i+1)
    mo = N//(26**j)
    Answer.append(mo)
    N = N-(26**j)*mo
A = str()
for k in range(len(Answer)):
    A = A + (Al[Answer[k]-1])
print(A)
# Judge status: Wrong Answer
a,b = map(int, input().split())

if a > 0 and b > 0: ans = "Positive"
elif a < 0 and b < 0:
  if (b-a+1)%2 != 0: ans = "Negative"
  else: ans = "Positive"
else: ans = "zero"
print(ans)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N, P = map(int, input().split())
    A = list(map(int, input().split()))
    even=0
    odd=0
    for i in range(N):
        if A[i] % 2==0:
            even+=1
    odd=N-even

    if odd==0:
        print(2**N if P==0 else 0)
    else:
        print(2**(N-1))

resolve()
# Judge status: Accepted
N = int(input())
S = input()

oder = N
l = [0 for _ in range(N)]
r = [0 for i in range(N)]

for i in range(1, N):
  l[i] = l[i-1] + (S[i-1] == 'W')
  r[-i-1] = r[-i] + (S[-i] == 'E')

for i in range(N):
  oder = min(oder, l[i]+r[i])

print(oder)
# Judge status: Accepted
#!/usr/bin/env python3

s = str(input())


ans = 999
for i in range(len(s)-2):
    num = int(s[i:i+3])
    ans = min(ans, abs(num-753))
print(ans)
# Judge status: Accepted
num = 0
counter = 1
N = int(input())
while num < N:
    num += counter
    counter += 1
diff = num - N
for i in range(1, counter):
    if i != diff:
        print(i)
# Judge status: Wrong Answer
x = int(input())

if x >= 400 and x <= 599:
    s = 8
elif x >= 600 and x <= 799:
    s = 7
elif x >= 800 and x <= 999:
    s = 6
elif x >= 1000 and x <= 1199:
    s = 5
elif x >= 1200 and x <= 1399:
    s = 4
elif x >= 1400 and x <= 1599:
    s = 3
elif x >= 1600 and x <= 1799:
    s = 2
else:
    s = 1
# Judge status: Accepted
N = int(input())
ans = 0
for n in range(1,N):
  ans += int((N-1)/n)
print(ans)
# Judge status: Accepted
# A - Good Integer
# https://atcoder.jp/contests/abc079/tasks/abc079_a

s = input()

if len(set(s[:3])) == 1 or len(set(s[1:])) == 1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
ls = list(map(int,input().split()))
ls2 = [0 for i in range(n)]
for j in range(n):
    a = ls[j]
#aは出席番号j+1番目の順位
    ls2[a - 1] = j + 1
for k in range(n):
    print(ls2[k], end = " ")
# Judge status: Accepted
x=int(input())
a=x//500
b=x%500
c=b//5
print(1000*a+5*c)
# Judge status: Wrong Answer
import heapq

N, M = map(int, input().split())
A = [int(a) * (-1) for a in input().split()]

for _ in range(M):
    B, C = map(int, input().split())
    tmp = [C * (-1)] * B
    A.extend(tmp)

print(A)
heapq.heapify(A)

ans = 0
for _ in range(N):
    ans += heapq.heappop(A)
            
print(ans * (-1))
# Judge status: Accepted
x = int(input())
print(int((1+x)*x/2))
# Judge status: Wrong Answer
a=int(input())
b=[input() for i in range(a)]
c=b.count("AC")
d=b.count("WA")
e=b.count("TLE")
f=b.count("RE")
print("AC × {}".format(c))
print("WA × {}".format(d))
print("TLE × {}".format(e))
print("RE × {}".format(f))
# Judge status: Accepted
s = input()
a = b = ''
ans = 0
for i in s:
  b += i
  if a != b:
    ans += 1
    a = b
    b = ''
print(ans)
# Judge status: Wrong Answer
import math

K = int(input())
s = 0


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


for i in range(1, K+1):
    for j in range(i, K+1):
        for k in range(j, K+1):
            a, b, c = sorted([i, j, k])
            s += gcd(a, gcd(b, c))

print(s)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    S = input()
    L = len(S)
    pre = ''
    s = ''
    ans = 0
    for i in range(L):
        s += S[i]
        if s!=pre:
            ans += 1
            pre = s
            s = ''
    print(ans)




if __name__ == '__main__':
    main()
# Judge status: Accepted
s = list(map(int, input().split(" ")))

a = s[0]
b = s[1]
m = s[2]

a_l = list(map(int, input().split(" ")))
b_l = list(map(int, input().split(" ")))

ans = min(a_l) + min(b_l)

for i in range(m):
    x = list(map(int, input().split(" ")))
    if ans > (a_l[x[0] - 1] + b_l[x[1] -1] - x[2]):
        ans = a_l[x[0] -1] + b_l[x[1] -1] - x[2]


print(ans)
# Judge status: Accepted
n,s,sj=int(input()),input(),''.join
l=sum([1 if c==')' else 0 for c in s])
r=n-l
t=s[:]
while True:
    for i in range(len(t)-1):
        if t[i:i+2]=='()':
            t,l,r=t[:i]+t[i+2:],l-1,r-1
            break
    else:break
print(sj(['(']*l)+s+sj([')']*r))
# Judge status: Accepted
import itertools
N,D=map(int,input().split())
X=[list(map(int,input().split())) for i in range(N)]
cmb=list(itertools.combinations(range(N),2))
ans=int(0)
for j in range(len(cmb)):
  xdis=0
  for k in range(D):
    xdis+=(X[cmb[j][0]][k]-X[cmb[j][1]][k])**2
  xdis=xdis**0.5
  if xdis-int(xdis)==0:
    ans+=1 
  else:
    ans+=0
print(ans)
# Judge status: Accepted
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
for i in range(N):
  H[i] = abs(T - H[i] * 0.006 - A)
print(H.index(min(H))+1)
# Judge status: Accepted
S=list(input())
k=int(input())
for i in range(len(S)):
    s=S[i]
    if s=="a":continue
    x=123-ord(s)
    #print(s,x,ord("z"))
    if k>=x:
        k-=x
        S[i]="a"

    else:continue
k%=26
for i in range(len(S)):
    if S[-1-i]!="a":
        S[-1-i]=chr((ord(S[-1-i])-97+k%26)+97)
        print("".join(S));break
else:
    S[-1]=chr((ord(S[-1])-97+k%26)+97)
    print("".join(S))
# Judge status: Accepted
s=input()

cnt=0

for i in range(3):
    if(s[i]=='R'):
        cnt+=1

if(cnt!=2):
    print(cnt)
elif(s=="RSR"):
    print(1)
else:
    print(2)
# Judge status: Accepted
n = int(input())
pointx = []
pointy = []
for i in range(n):
    x, y = map(int, input().split())
    pointx.append(x-y)
    pointy.append(x+y)

print(max(max(pointx)-min(pointx),(max(pointy)-min(pointy))))
# Judge status: Accepted
n, m = map(int, input().split())

if m >= 2*n:
    ans = n
    ans += (m-2*n)//4
else:
    ans = m//2
print(ans)
# Judge status: Accepted
import collections
n = int(input())
*a, = map(int, input().split())
a.sort()
a = collections.deque(a)
ans = 0
while n:
    a.popleft()
    a.pop()
    ans += a.pop()
    n -= 1
print(ans)
# Judge status: Wrong Answer
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = sorted(h)
# print(h[:-1], h)
if k > len(h):
    print(0)
else:
    if k != 0:
        del h[-k]
    print(sum(h))
# Judge status: Accepted
N, K, Q = map(int, input().split())
count = [0] * N
for _ in range(Q):
  count[int(input())-1] += 1
for c in count:
  if K - (Q - c) > 0:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
x,y,z=map(int,input().split())
print(z,y,x)
# Judge status: Wrong Answer
n = int(input())
for _ in range(n):
    t,x,y = map(int,input().split())
    if (t%2 != (x + y)%2) or (t%2 != (x + y)%2):
        print("No")
        exit()
    elif t < (x + y):
        print("No")
        exit()
    else:
        continue
print("Yes")
# Judge status: Accepted
N = int(input())
a = [int(input()) for _ in range(N)]
num = 1
cnt = 0
for i in range(200000):
    num = a[num-1]
    cnt += 1
    if num == 2:
        print(cnt)
        exit()
print(-1)
# Judge status: Accepted
A,B = map(int,input().split())
L = B // 2
if A >= 13:
  print(B)
elif A <= 12 and A >= 6:
  print(L)
elif A <= 6:
  print(0)
# Judge status: Wrong Answer
from math import ceil

h1, m1, h2, m2, k = map(int, input().split())

diff = int((h2-h1)*60 + (m2-m1))

print(max(0, int(k*(ceil(diff/k)-1))))
# Judge status: Wrong Answer
A,B,C,K=map(int,input().split())
n=0
if K>=A :
  K=K-A
  n+=A
  if K>=B :
    K=K-B
    if K>=C :
      K=K-C
      n-=C
    else :
      K=C-K
      n-=C-K
  else :
    K=B-K
else :
  K=A-K
  n+=K

print(n)
# Judge status: Accepted
X='abcdefghijklmnopqrstuvwxyz'*2
S=input()
k=int(input())
N=[]
for s in S:
    if s=='a':
        N.append(0)
    else:
        N.append(26-X.index(s))
ans=''
for i in range(len(S)):
    if N[i]<=k :
        k-=N[i]
        ans+='a'
    else:
        ans+=S[i]
ans=ans[:-1]+X[X.index(ans[-1])+k%26]

print(ans)
# Judge status: Accepted
n = int(input())
px = py = pt = 0
for i in range(n):
	t,x,y = map(int,input().split())
	d = abs(x - px) + abs(y - py)
	nt = t - pt
	if nt < d or d%2 != nt%2:
		print("No")
		exit()
	px = x
	py = y
	pt = t
print("Yes")
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]
q = int(input())
num = [0] * 100010
b = [0] * q
c = [0] * q
for i in range(q):
    b[i], c[i] = map(int, input().split())

for i in a:
    num[i] += 1

s = sum(a)

for i in range(q):
    s += (c[i]-b[i])*num[b[i]]
    num[c[i]] += num[b[i]]
    num[b[i]] = 0
    print(s)
# Judge status: Wrong Answer
a,b = map(int,input().split())
s = input()

if s[a:a+1] == '-' and s[0:a].isdecimal() and s[a+1:a+b+1]:
    print('Yes')
else:
    print('No')
#print(s[0:a])
#print(s[a+1:a+b+1])
# Judge status: Accepted
from fractions import gcd
N = int(input())
A = list(map(int, input().split()))

L = [0]*(N+2)
R = [0]*(N+2)
for i in range(N):
  L[i+1] = gcd(L[i], A[i])
for i in range(N, 0, -1):
  R[i] = gcd(R[i+1], A[i-1])
ans = 1
for i in range(1, N+1):
  ans = max(ans, gcd(L[i-1], R[i+1]))
print(ans)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
ans = []
for i in range(10000):
  for j in range(a):
    ans.append('b')
  for k in range(b):
    ans.append('r')
hints = ans[0:n]
count = 0
for l in hints:
  if l == 'b':
    count += 1
print(count)
# Judge status: Wrong Answer
import sys

def main():
    S  = list(map(int, input()))
    o = S.count(0)
    l = S.count(1)
    print(o,l)

    print(min(o, l) * 2)

main()
# Judge status: Wrong Answer
P, Q, R = map(int, input().split())

list_m = [P + Q,R + Q,P + R,Q + R,R + P,Q + P]

min = 100
for i in range(len(list_m)):
    if min > int(list_m[i]):
        min = list_m[i]

print(min)
# Judge status: Wrong Answer
W, H, x, y = map(int, input().split())

ans = 0
count = 0
if x == y:
    ans = min(x*H, (W-x)*H)
    count = 1
elif x < y:
    ans = min(x*H, (W-x)*H)
else:
    ans = min(y*W, (H-y)*W)

print(ans, count)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
box=a-b
c-=box
ans=min(box,0)
print(ans)
# Judge status: Wrong Answer
'''N, K = map(int, input().split())
H = list(map(int, input().split()))

for i in range(K):
    if len(H)!=0:
        H.remove(max(H))
        #print(H)
    else:
        #print(0)
        break
print(sum(H))'''

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

print(sum(H[K+1:]))
# Judge status: Accepted
n=int(input())
s=v=w=0
for _ in range(n):
  t,x,y=map(int,input().split())
  dt,dx,dy=t-s,x-v,y-w
  if (dt+dx+dy)%2>0 or dt<abs(dx)+abs(dy): print('No'); break
  s,v,w=t,x,y
else: print('Yes')
# Judge status: Wrong Answer
S=input()
N=len(S)
n1=0
n2=0
for i in range(N):
 if S[i]=="h":
  n1=n1+1
 if S[i]=="i":
  n2=n2+1

if (n1==n2)and(n1+n2==N):
 print("Yes")
else:
 print("No")
# Judge status: Accepted
A, B, K = map(int, input().split())
X = []

for x in range(K):
    if B >= A+x or B-x >= A:
        X.append(A+x)
        X.append(B-x)

sortX = sorted(set(X))
# print(" ".join(sortX))
for x in sortX:
    print(x)
# Judge status: Wrong Answer
N, M = [int(a) for a in input().split()]
L = []
R = []

for _ in range(M):
    l, r = [int(a) for a in input().split()]
    L.append(l)
    R.append(r)

mingate = max(L)
maxgate = min(R)
print(maxgate - mingate + 1)
# Judge status: Wrong Answer
import collections

n,m = map(int,raw_input().split(' '))
operations = [map(int, raw_input().split(' ')) for _ in range(m)]
def f(operations, n):

	res = [-1] * n

	for s,c in operations:
		s -=1
		if res[s] == -1:
			res[s] = c
		elif res[s] != c:
			return (False, res)
	
	for i in range(len(res)):
		if res[i] == -1: 
			res[i] = 0 if (i or n == 1) else 1
	
	if res[0] == 0 and n:
		return (False, res)
	return (True, res)
f,r = f(operations, n)
print ''.join(map(str,r)) if f else -1
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
freq = [0 for i in range(10**5+1)]
for x in A:
    freq[x] += 1
ans = sum(A)
for q in range(int(input())):
    B, C = map(int,input().split())
    ans -= B*freq[B]
    ans += C*freq[B]
    freq[C] += freq[B]
    freq[B] = 0
    print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
num_2 = 0
num_4 = 0
for i in a:
    if i % 4 == 0:
        num_4 += 1
    elif i % 2 == 0:
        num_2 += 1
x = num_4 * 2
if num_4 >= n // 2:
    print("Yes")
elif num_2 >= n - x:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
  num = list(map(int,input().split()))
  s=input()
  print(s[0:num[1]-1]+s[num[1]-1].lower()+s[num[1]:num[0]])
main()
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
if b<=c:
  print(0)
elif a<=c and c<=b<=d:
  print(b-c)
elif a<c and d<b:
  print(d-c)
elif c<a:
  print(min(d-a,b-a))
else:
  print(0)
# Judge status: Wrong Answer
N = int(input())
CSF = []
for _ in range(N-1):
    CSF.append(list(map(int,input().split())))
for i in range(N-1):
    ans = 0
    for j in range(i,N-1):
        C,S,F = CSF[j]
        if ans < S:
            ans = S+C
        else:
            ans += ans%F+C
            pass
    print(ans)
print(0)
# Judge status: Accepted
S = list(map(str, input()))
if S[0] == S[1] and S[1] ==S[2] and S[2] == S[0]:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
import math
print(int(input())*2*math.pi)
# Judge status: Wrong Answer
S,W= map(int, input().split())
if S <= W*2:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
import copy

n, k =  map(int,input().split())
s = ['R'] + list(input()) + ['L']

cnt = 0
for i in range(1,n+1):
    if s[i] == 'L' and s[i-1] == 'L':
        cnt += 1
    if s[i] == 'R' and s[i+1] == 'R':
        cnt += 1
# print(cnt)
while k > 0 and cnt < n-1:
    if n- 1 - cnt > 1:
        cnt += 2
    elif n- 1 - cnt > 0:
        cnt += 1
    k -= 1
print(cnt)
# Judge status: Accepted
nums = input().split(' ')
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
d = int(nums[3])

multi = []
multi.append(a * c)
multi.append(a * d)
multi.append(b * c)
multi.append(b * d)

ans = - 10 ** 18
for i in range(4):
    if multi[i] > ans:
        ans = multi[i]

print(ans)
# Judge status: Accepted
# coding: utf-8

# https://atcoder.jp/contests/abc083/tasks/arc088_a
# 17:19-


def main():
    X, Y = map(int, input().split())

    ans = 0
    x = X
    while True:
        if x > Y:
            return ans

        ans += 1
        x *= 2


print(main())
# Judge status: Accepted
n = int(input())
a = [int(x) for x in input().split()]
c = 0
for i in range(n):
  if a[i] != i+1-c:
    c += 1
if c < n:
  print(str(c))
else:
  print(-1)
# Judge status: Accepted
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    
    divisors.sort()
    return divisors

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

div = make_divisors(m)
ans = 0
for d in div:
    if d * n <= m:
        ans = max(ans, d)

print(ans)
# Judge status: Accepted
n,m=[int(x) for x in input().rstrip().split()]
A=[int(x) for x in input().rstrip().split()]
now=[]
bc=[]
for i in range(m):
  BC=[int(x) for x in input().rstrip().split()]
  bc.append(BC)
bc=sorted(bc,key=lambda x:x[1],reverse=True)
A.sort(reverse=True)
d=[]
for b,c in bc:
    d.extend([c]*b)
    if n<=len(d):
      break
A+=d
A.sort(reverse=True)
print(sum(A[:n]))
# Judge status: Accepted
from math import ceil

n, k = map(int, input().split())
a = [int(x) for x in input().split()]

left = 0
right = max(a)

while right - left > 1:
    length = (right + left) // 2
    totcut = 0
    for i in range(n):
        totcut += ceil(a[i]/length) - 1
        if totcut > k:
            left = length
            break
    else:
        right = length
print(right)
# Judge status: Wrong Answer
def otoshidama():
    N, Y = map(int,input().split())
    for i in range(N):
        for j in range(N - i):
                if Y == 1000*i + 5000*j + 10000*(N - j - i):
                    print(N - j - i, j, i)
                    return
    print(-1,-1,-1)
    return
otoshidama()
# Judge status: Accepted
n, m = map(int, input().split())

a = []
for i in range(m):
  #[0] = 県
  #[1] = 誕生年
  #[2] = 市番号
  a.append(list(map(int, input().split())))
  a[i].append(i)

#県、誕生年ごとにソート
a.sort(key=lambda x:(x[0], x[1]))
p = 0
num = 1
for v in a:
  if not v[0] == p:
    p = v[0]
    num = 1
  _id = str(v[0]).zfill(6) + str(num).zfill(6)
  num += 1
  v.append(_id)

a.sort(key=lambda x:x[2])

for v in a:
  print(v[3])
# Judge status: Accepted
n, a, b = map(int, input().split())
ans = n//(a+b)*a
tmp = min(n%(a+b), a)
print(ans + tmp)
# Judge status: Wrong Answer
import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
#import heapq
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n = ri()
a = rl()

ans=[]

for i in range(n,0, -1):
    sum_=0
    iter_=2
    while i*iter_<=n:
        sum_+=a[i*iter_-1]
        iter_+=1

    if sum_%2!=a[i-1]:
        ans.append(i)
print(len(ans))
if ans:
    print(*ans)
# Judge status: Wrong Answer
A = int(input())
B, C = map(int,input().split())
flag = 1

for i in range(B, C):
  if i % A == 0:
    flag = 0
    print("OK")
    break

if flag==1:
  print("NG")
# Judge status: Accepted
n = int(input())
w_list = [input() for _ in range(n)]
for i in range(1, n):
    if w_list[i - 1][-1] != w_list[i][0] or w_list[i] in w_list[:i]:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
import numpy as np
a,b = map(int,input().split())
if (a*10^b) > (b*10^a):
    print(np.ceil(a * (10^b + 10^(b-1) + 10^(b-2) + 10^(b-3) + 10^(b-4) + 10^(b-5) + 10^(b-6) + 10^(b-7) + 10^(b-8) + 10^(b-9))))
else:
    print(np.ceil(b * (10^a + 10^(a-1) + 10^(a-2) + 10^(a-3) + 10^(a-4) + 10^(a-5) + 10^(a-6) + 10^(a-7) + 10^(a-8) + 10^(a-9))))
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
a_L = list(map(int,input().split()))
q = int(input())

L = dict(Counter(a_L))
all_sum = sum(a_L)



ans_L = []
for i in range(q):
    b,c = map(int,input().split())
    try:
        diff = (c-b) * L[b]
        all_sum = all_sum+diff
        L[c] += L[b]
    except:
        pass
    ans_L.append(all_sum+1)


for i in ans_L:
    print(i)
# Judge status: Wrong Answer
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))

count =[0]*N
if N ==1:
    count[0] =A1[0] +A2[0]
else:
    for i in range(1,N-1):
        count[i] =sum(A1[:i+1]) +sum(A2[i:])
print(max(count))
# Judge status: Accepted
Array= list(input().split())
print(len(set(Array)))
# Judge status: Accepted
#!/usr/bin/env python3


def main():
    n, m = map(int, input().split())
    range_list = [list(map(int, input().split())) for _ in range(m)]
    min_list = [x[0] for x in range_list]
    max_list = [x[1] for x in range_list]
    min_id = max(min_list)
    max_id = min(max_list)
    answer = max_id - min_id + 1
    answer = max(answer, 0)
    print(answer)


if __name__ == '__main__':
    main()
# Judge status: Accepted
def readinput():
    s=input()
    return s

def main(s):
    if s=='ABC':
        return 'ARC'
    elif s=='ARC':
        return 'ABC'
    ans=''
    return ans

if __name__=='__main__':
    s=readinput()
    ans=main(s)
    print(ans)
# Judge status: Accepted
x = int(input())
a = x//500
b = (x%500)//5
print(a*1000+b*5)
# Judge status: Accepted
n=int(input())
s=input()
w=[0]*(n+1)
b=[0]*(n+1)
for i in range(1,n+1):
  w[i]=w[i-1]+1 if s[i-1]=="#" else w[i-1]
  b[-i-1]=b[-i]+1 if s[-i]=="." else b[-i]
print(min([x+y for x,y in zip(w,b)]))
# Judge status: Accepted
N, x = map(int, input().split())
a = list(map(int, input().split()))

count = 0

a.sort()

for idx, v in enumerate(a):
    if v <= x:
        x -= v
        if idx == N - 1:
            if x == 0:
                count += 1
        else:
            count +=1

print(count)
# Judge status: Accepted
W,H,x,y = map(int,input().split())
scale = W*H/2
div = 0
if x==W/2 and y==H/2:
  div = 1
print(scale,div)
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    W = list(map(int, input().split()))

    S1 = 0
    S2 = sum(W)
    ans = 10 ** 18
    for i in range(N - 1):
        S1 += W[i]
        S2 -= W[i]
        diff = abs(S1 - S2)
        ans = min(ans, diff)

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
S = input()

if S == "SUN":
  print(7)
elif S == "MON":
  print(6)
elif S == "TUE":
  print(5)
elif S == "WED":
  print(4)
elif S == "THU":
  print(3)
elif S == "FRI":
  print(2)
elif S == "SAT":
  print(1)
# Judge status: Accepted
t = list(input())
for i in range(len(t)):
    if t[i] == "?":
        t[i] = "D"
print("".join(t))
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())

aux=max(A, B, C)
ans=(A+B+C)-aux

for _ in range(K):
  aux+=aux

print(aux+ans)
# Judge status: Wrong Answer
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())
hand = {"r" : p, "s" : r, "p" : s}
ans = 0
for i in range(n-k):
  temp= i-k
  if temp >=0 and t[i]==t[temp]:
    t[i]=""
  else:
    ans+=hand[t[i]]
print(ans)
# Judge status: Wrong Answer
N = int(input())
power = 1
m = 10**9+7
for i in range(N):
    power = power*(i+1)
    poewr = power % m
print(power)
# Judge status: Accepted
from sys import stdin
import sys

A, B, N = [int(x) for x in stdin.readline().rstrip().split()]
# N, M = [int(x) for x in stdin.readline().rstrip().split()]
# U = input().split()
x=min(B-1,N)
ans = int((A*x)/B)-A*int(x/B)
print(ans)
# if N >= B:
# Judge status: Accepted
c = input()
if c == "a" or c == "e" or c == "i" or c == "o" or c == "u":
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
A, B, C = map(int, input().split())
#kA%Bの数列になる
#AをBで割ったあまりはB-1以下になる
#(k+B)A%B = (kA+BA)%B = kA%B + BA%B = kA%B
for i in range(1, B+1):
    if A*i%B == C:
        print('YES')
        exit()
print('NO')
# Judge status: Wrong Answer
X=int(input())
for i in range(8):
    a=400+(8-i)*200
    if a<=X<=a+199:
        print(i)
        break
# Judge status: Wrong Answer
n,k,x,y = [int(input()) for i in range(4)]
print(x*k + y*(n-k))
# Judge status: Wrong Answer

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

cnt = 0
for i in range(N):
    if i % 2 == 1 and AAA[i] % 2 == 1:
        cnt += 1

print(cnt)
# Judge status: Wrong Answer
import math
import numpy as np
A,B = list(map(int,input().split()))
if A == 1:
  print(B)
  exit()
if B == 0:
  print(A)
  exit()
C = A*B
D = []
for i in range(1,int(math.sqrt(C))):
  if A % i == 0 and B % i == 0:
    A = A // i
    B = B // i
    D.append(i)
    C = A*B
p = np.prod(D)
if p != 0:
  C = C*p
print(C)
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    (N, M) = map(int, input().split())
    if N >= M:
        (N, M) = (M, N)
    if N == 1:
        if M == 1:
            print(1)
        else:
            print(M-2)
    else:
        print((N-2) * (M-2))
    

main()
# Judge status: Wrong Answer
def main():
    D, T, S = map(int, input().split())
    if float(S) < float(D) /float(S) :
        print("No")
    else:
        print("Yes")
    #N = int(input())
    #A = [int(s) for s in input().split()]
    #

main()