peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans=0
import heapq
hq=[]
for i in range(N):
    if i==0:
        heapq.heappush(hq,-A[i])
        continue
    else:
        tmp=heapq.heappop(hq)*-1
        ans+=tmp
        heapq.heappush(hq,-A[i])
        heapq.heappush(hq,-A[i])
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split(' '))
ans = 0
if a % 2 == 0 and a == b and a == c:
    ans = -1
elif (a+1)*(b+1)*(c+1)%2 == 0:
    ans = 0
else:
    A = [a,b,c]
    A.sort()
    a1 = A[2]-A[1]
    a2 = A[1]-A[0]
    ans = 0
    while a1%2 == 0 and a2%2 == 0:
        ans += 1
        a1 /= 2
        a2 /= 2
print(ans)
# Judge status: Accepted

ab=[int(i) for i in input().split()]
for i in range(2):
    if ab[i]==1:
        ab[i]+=13
print("Alice" if ab[0]>ab[1] else "Draw" if ab[0]==ab[1] else "Bob")
# Judge status: Accepted
x=input()
l=[]
for i in x:
  if len(l)>0 and l[-1]=='S' and i=='T':
    l.pop()
    continue
  l.append(i)
print(len(l))
# Judge status: Wrong Answer
N = int(input())
A = input()
S = A.replace(' ','a')
for i in range(N):
  j = str(i+1) + 'a'
  k = S.count(j)
  print(k)
# Judge status: Wrong Answer
from collections import defaultdict
n,k,q = map(int,input().split())
l = [int(input()) for _ in range(q)] #複数行1文字をintでリストに
d = defaultdict(int)
for i in l:
    if i in d:
        d[i] += 1
    else:
        d[i] =1

for i in range(n):
    a = q-d[i]
    b = k-a
    if b >=0:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
# coding: utf-8
# 日本語を入力できるようにするために上記一文が必要


N = int(input())

chash = 0
while chash < N:
        chash += 1000

print(chash - N )
# Judge status: Accepted
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
correct = [0] * N

for a in A:
    correct[a-1] += 1

hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
A,B,C = map(int, input().split())

if A%2==0 or B%2==0 or C%2==0:
  print(0)
else:
  print(min(A*B,B*C,C*A))
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())

while B <= A:
    B *= 2
    K -= 1

while C <= B:
    C *= 2
    K -= 1

if K >= 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
L,R=map(int,input().split())
ans=2020
if R-L>=2019:
    ans=0
else:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            a=(i*j)%2019
            ans=min(ans,a)
print(ans)
# Judge status: Accepted
import math
x=int(input())
p=100
cnt=0
while x>p:
    p+=p//100
    cnt+=1
print(cnt)
# Judge status: Wrong Answer
n=int(input())
s=input()
x=0
y=0
for i in range(n-1):
    if (s[i]=="I"):
        x+=1
        y=max(x,y)
    else:
        x-=1
print(y)
# Judge status: Wrong Answer
a=sum(map(int,input().split()))
print(a if a<=24 else a-24)
# Judge status: Accepted
def calc_sum(num):
    ans = 0
    for i in range(len(str(num))):
        target = num % 10
        num //= 10
        ans += target
    return ans

def main():

    n, a, b = map(int, input().split())
    ans = 0
    for i in range(1, n + 1):
        num = calc_sum(i)
        if a <= num <= b:
            ans += i
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
a,b = map(int,input().split())
c = 0
if a < 0 and b < 0:
    if  a-b % 2 == 0:
        print("Positive")
        sys.exit()
elif a < 0 and b >= 0:
    if a%2 == 0:
        print("Positive")
        sys.exit()
elif a < 0 and b >= 0:
    if b % 2 == 0:
        print("Positive")
        sys.exit()
if (a+b) == 0:
    print("Zero")
elif (a+b) > 0:
    print("Positive")
else:
    print("Negative")
# Judge status: Wrong Answer
N, X, Y = map(int, input().split())
print('\n'.join(map(str, [sum([[(j-i)-(Y-X)+1 if i<=X<Y<=j else (j-i) for j in range(1, N+1) if i<j] for i in range(1, N+1)], []).count(k) for k in range(1, N)])))
# Judge status: Accepted
N = int(input())

counter = 0
for n in range(1,N+1):
    a = N//n
    counter += a*(a+1)*n//2


print(counter)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

l = [0] *(10**6+1)

for i in range(N):
    num = A[i]
    if l[num] != 0:
        l[num] = 2
        continue
    for j in range(num, 10**6+1, num):
        l[j] += 1
ans = 0
for i in range(N):
    num = A[i]
    if l[num] == 1:
        ans += 1
print(ans)
# Judge status: Accepted
n, d = map(int, input().split())
d = 2 * d + 1
print((n + d - 1) // d)
# Judge status: Accepted
x = int(input())

q = x // 11
ans = q * 2
if x % 11 == 0:
    print(ans)
elif x - q * 11 <=6:
    print(ans+1)
else:
    print(ans+2)
# Judge status: Accepted
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())

dist = abs(A-B)
v = V-W
if T*v>=dist:print('YES')
else:print('NO')
# Judge status: Accepted
import sys
import math
import itertools
n = int(input())
if(n%2==0):
    print((n + 1) * (n // 2) - n)
else:
    print((n + 1) * ((n-1) // 2) +(n+1)//2- n)
# Judge status: Accepted
d,t,s=map(int,input().split())
x=d/s
if x<=t:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
x = int(input())

money = 100
ans = 0


while money <= x:
  money = int(money*1.01)
  ans += 1
  
print(ans)
# Judge status: Accepted
import math
n  = int(input())
root_n = math.floor(math.sqrt(n))
ans = 0
for i in range(1,root_n+1):
    if n % i ==0:
        ans = i
print(int(ans + n/ans -2))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

b=max(a)
d=b/2

c=abs(d-a[0])
#print(c)
if a[0]==b:
  c=99999
ans=a[0]
for i in a:
  #print(abs(i-d))
  if i==b:
    continue
  if abs(i-d)<c:
    ans=i
    c=abs(i-d)
    
print(b,end=" ")
print(ans)
# Judge status: Accepted
a = int(input())
s = input()

print(s) if a >= 3200 else print("red")
# Judge status: Wrong Answer
import sys
N = int(input())
*A, = map(int, input().split())

count = 0
for a in range(len(A)):
    if A[a]%4==0:
        count = count + 1

if N<3:
    if count>=1:
        print("Yes")
        sys.exit()
    else:
        print("No")
        sys.exit()

num4 = (N//3)
if (N%3)!=0:
    num4 = num4 + 1

if num4<=count:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N,M = map(int, input().split())

ans = 0
if N<=M:
    ans = N
    M = max(0, M-2*N)
    ans = ans + M//4
    print(ans)
else:
    print(M//2)
# Judge status: Wrong Answer
a=list(map(int,input().split()))
n=a[1]
a[1]=a[0]
a[0]=a[2]
a[2]=n
print (a)
# Judge status: Wrong Answer
N, M = map(int, input().split())
ab = [list(map(int,input().split())) for i in range(N)]
cd = [list(map(int,input().split())) for i in range(M)]

for i in range(N):
    check = 10**5
    ans = 51
    for j in range(M):
        if abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]) < check:
            ans = j+1
            check = min(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]), check)
    print(ans)
# Judge status: Accepted
N = int(input())

def d_sum(n):
    ret = 0
    while(n>0):
        ret += n%10
        n //= 10
    return ret

ans = N
for i in range(1, N//2+2):
    ans = min(ans, d_sum(i)+d_sum(N-i))

print(ans)
# Judge status: Accepted
n = str(input())
if n[0] == "9" or n[1] == "9":
	print("Yes")
else:
	print("No")
# Judge status: Accepted
import math

N, H = map(int, input().split())

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

max_a = max(a_list)
b_list.sort(reverse=True)

count = 0
for b in b_list:
    if b > max_a and H > 0:
        count += 1
        H -= b
    else:
        break

if H > 0:
    count += math.ceil(H / max_a)
print(count)
# Judge status: Accepted
import math
a,b,x = map(int,input().split())
if x<=(a**2*b)/2:
    deg = math.degrees(math.atan((a*b**2)/(2*x)))
else:
    deg = math.degrees(math.atan(2*(b*a**2-x)/a**3))
print(deg)
# Judge status: Wrong Answer
n = int(input())
s = []
for i in range(n):
    s += [int(input())]

if sum(s) % 10 != 0:
    print(sum(s))
else:
    a = []
    for i in range(n):
        a += [s[i]]
        if sum(s) - sum(a) % 10 != 0:
            print(sum(s) - sum(a))
            exit()
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print(c -(a-b))
# Judge status: Wrong Answer
N,P = map(int, input().split())
A = list(map(int, input().split()))
in_odd = False
for i in range(N):
    if A[i]%2:
        in_odd = True
        break
if (not in_odd and P == 1):
    print(0)
else:
    print(2**(N-1))
# Judge status: Accepted
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True) + [0, 0, 0, 0]
l = []
for i in range(len(a) - 1):
  if a[i] == a[i + 1] and (len(l) == 0 or l[-1] != i - 1):
    l.append(i)
    if len(l) >= 2:
      break
print(a[l[0]] * a[l[1]])
# Judge status: Wrong Answer
from collections import deque

s = input()
t = input()

t = deque(t)
for i in range(len(s)):
  if s=="".join(t):
    print("Yes")
    exit()
  t.append(t.popleft())
# Judge status: Accepted
a,b = input().split()

c = a+b
w = False

for i in range(int(c)):
    if i*i == int(c):
        print("Yes")
        w = True
        break
if w == False:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = [0]+list(map(int,input().split()))
x = [0]*(n+1)
for i in range(n,0,-1):
    buf = 0
    for j in range(1,n//i+1):
        buf += x[i*j]
    if buf!=a[i]:x[i]=1
x = x[1:]
m = 0
b = []
for i in range(n):
    if x[i]==1:
        b.append(i+1)
        m+=1
print(m)
print(*b)
# Judge status: Accepted
n, y = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
ans = 0
if y == sum(a):
  ans = n
elif y > sum(a):
  ans = n -1
else:
  for i in range(n):
    if y - a[i] >= 0:
      y -= a[i]
      ans += 1
    else:
      break
print(ans)
# Judge status: Accepted
n, m, x = map(int, input().split())
ca = [list(map(int, input().split())) for i in range(n)]
ans = 1e18
for i in range(1<<n):
    cost = 0
    udst = [0] * m
    for j in range(n):
        if((i>>j)&1):
            cost += ca[j][0]
            for k in range(m):
                udst[k] += ca[j][k+1]
    ok = True
    for j in range(m):
        if udst[j]<x: ok = False
    if ok: ans = min(ans, cost)

if ans>=1e18: print(-1)
else: print(ans)
# Judge status: Wrong Answer
ans = 0
n = int(input())
l = [int(input()) for _ in range(n)]
l.sort()
c = 1
if n > 1:
  for i in range(n-1):
    if l[i] == l[i+1]:
      c += 1
    else:
      if c%2 != 0:
        ans += 1
      c = 1
  if l[-2] != l[-1]:
    ans += 1
else:
  ans = 1
print(ans)
# Judge status: Accepted
n = int(input())
ans = float('inf')
for i in range(1, n):
    a = i
    b = n-i
    m = len(str(a))
    l = len(str(b))
    cnt = 0
    for j in range(m):
        cnt += int(str(a)[j])
    for j in range(l):
        cnt += int(str(b)[j])
    ans = min(ans, cnt)

print(ans)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())

print('No') if c>(a and b) or c<(a and b) else print('Yes')
# Judge status: Accepted

S = input()
List=[0]*(len(S)+1)
i=0
while i<len(S):
    if S[i]=="<":
        List[i+1]=List[i]+1
    i+=1
j=1
while j<=len(S):
    if S[-j]==">":
        List[-(j+1)]=max(List[-j]+1,List[-(j+1)])
    j+=1
print(sum(List))
# Judge status: Wrong Answer
n, m = map(int, input().split())

s = [0] * (n+2)

for i in range(m):
  l, r = map(int, input().split())
  s[l-1] += 1
  s[r] -= 1

ans = [0] * (n+2)
for i in range(1, n+2):
  ans[i] = ans[i-1] + s[i]

print(ans.count(max(ans)))
# Judge status: Accepted
N = int(input())

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

counter = 0
flag = 1

while flag == 1:
	for i in range(len(l)):
		if l[i] % 2 != 0:
			flag = 0
			break
		else:
			l[i] = int(l[i] / 2)
	if flag == 1:
		counter += 1

print(counter)
# Judge status: Accepted
def readinput():
    a,b,c,d=map(int,input().split())
    return a,b,c,d

def main(a,b,c,d):
    l=max(a,c)
    r=min(b,d)
    return max(r-l,0)

if __name__=='__main__':
    a,b,c,d=readinput()
    ans=main(a,b,c,d)
    print(ans)
# Judge status: Wrong Answer
a, b, n = map(int, input().split())

def calc(x):
    # print(a, b, x)
    return (a*x)//b - a*(x//b)

res = 0


for i in range(0, min(a + 5, n + 1)):
    # print(i)
    # print(calc(i))
    res = max(res, calc(i))
    # print(res)

print(res)
# Judge status: Wrong Answer
n = int(input())

a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
c.append(0)
c[a[n-1]-1] = 0

ans = 0

for i in a:
    ans += b[i-1] + c[i-1]


print(ans)
# Judge status: Accepted
# coding: utf-8
n, m = map(int, input().split())

ans = 0
# 最初のs使いきれるか
if 2 * n >= m:
    print(min(n, m // 2))
else:
    ans += n
    m -= 2 * n
    ans += m // 4
    print(ans)
# Judge status: Wrong Answer
#初期入力
import sys
N = int(input())
A=[int(i) for i in input().split()]
#

i=2 #探す「文字」
brick_remain =set()
if 1 not in A:
    print(-1)
    exit
else:
    brick_remain.add(1)
    for a in A:
        if a ==i:
            brick_remain.add(a)
            i +=1
    brick_destroy = N - len(brick_remain)       
    print(brick_destroy)
# Judge status: Wrong Answer
n, tl = [int(x) for x in input().split()]

c_init = 10 * 4
ans = c_init
for _ in range(n):
    c, t = [int(x) for x in input().split()]
    if t <= tl and ans > c:
        ans = c
if ans == c_init:
    ans = "TLE"
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]
H.sort()
ans = 10 ** 18
for i in range(N - K + 1):
    h1 = H[i]
    h2 = H[i + K - 1]
    ans = min(ans, h2 - h1)
print(ans)
# Judge status: Accepted
a, b = input().split()
s = int(a+b)
result = 'No'
for i in range(1,round(s)):
  if s/i == i:
    result = 'Yes'
    
print(result)
# Judge status: Accepted
s=input()
t=s[::-1]

n=len(s)

num=n//2
count=0

for i in range(num):
    if s[i]!=t[i]:
        count+=1
        
print(count)
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

if b-a == c-b:
  print('YES')
else:
  print("NO")
# Judge status: Accepted
N = int(input())

hoge = []

if N % 2 != 0:
    print(0)
else:
    for i in range(1, 27):
        hoge.append((N // 10)  // (5 ** i))
    print(sum(hoge) + (N // 10))
# Judge status: Accepted
import sys

X = int(sys.stdin.readline().strip())

p = 100
ans = 0
while p < X:
    p = int(p * 1.01)
    ans += 1
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())

from collections import Counter
c = Counter(list(map(int, input().split())))

#Counterからの取り出し
l = []
m = []
for x, y in c.items():
    l += [y]
    m += [x]

L = sorted(l)
M = len(m)

cnt = 0 
if M <= k:
    print(0)
else:
    for i in range(M-k):
        cnt += L[i]
    print(cnt)
# Judge status: Wrong Answer
x = list(map(int, input().split()))
counter = 0
for i in x:
  counter += 1
  if x == 0:
    print(counter)
# Judge status: Accepted
n= int(input())
n -= 1
arr= sorted(list(map(int,input().split())))[::-1]
ans = arr[0]
i = 1
while n > 1:

    if n > 2:
        ans += arr[i]*2
        i += 1
        n -= 2
    elif n ==2:
        ans += arr[i]
        break
                
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
if N%2 == 0:
    print(abs(sum(A[N//2:])-sum(A[:N//2])))
else:
    sum1 = sum(A[N//2:]) - sum(A[:N//2])
    sum2 = sum(A[N//2+1:]) - sum(A[:N//2+1])
    print(min(abs(sum1),abs(sum2)))
# Judge status: Wrong Answer
inputted = list(map(int, input().split()))
N = inputted[0]
X = inputted[1]
L = list(map(int, input().split()))

x = 0
number_of_bounds = 0
for _i, Li in enumerate(L):
    x += Li
    number_of_bounds = _i + 1
    if x > X: break
    
print(number_of_bounds)
# Judge status: Accepted
w = input()

for i in range(len(w)):
    if w.count(w[i:i+1]) % 2 != 0:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

countA,countB = 0,0

for i in range(N):
  if A[i] <= B[i]:
    countA += (B[i]-A[i])/2
  else:
    countB += A[i]-B[i]
if sum(B)-sum(A) >= max(countA,countB):
  ans = "Yes"
else:
  ans = "No"

print(ans)
# Judge status: Accepted
x,y = map(int,input().split())

ans = 0
while x <= y:
    x *= 2
    ans += 1

print(ans)
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

N = int(input())

import math
lower = math.floor(N / 1.08)
upper = math.ceil(N / 1.08)
if math.floor(lower * 1.08) == N:
    print(lower)
elif math.floor(upper * 1.08) == N:
    print(upper)
else:
    print(":(")
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(0,a+1):
  for j in range(0,b+1):
    for k in range(0,c+1):
      if (i*500+j*100+k*50==x):
        ans+=1
        break
      elif (i*500+j*100+k*50>x):
        break

print(ans)
# Judge status: Accepted
# Problem B - Iron Bar cutting

# input process
N = int(input())
a_list = list(map(int, input().split()))

# initialization
min_cost = 10**18
left_sum = 0
right_sum = sum(a_list)

# count process cumulative sum
for i in range(N-1):
    left_sum += a_list[i]
    right_sum -= a_list[i]
    distance = abs(left_sum - right_sum)
    min_cost = min(min_cost, distance)

# output process
print(min_cost)
# Judge status: Accepted
import sys
input = sys.stdin.readline

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


cnt=1
M=P[0]#現在の最小値
for i in range(1,N):
    if(M > P[i]):#Pの値が現在の最小値より小さかったら最小値を更新しcnt++する
        M=P[i]
        cnt+=1



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

if a==b==c and a%2==0:
  print(-1)
   
else:
  while a%2==0 and b%2==0 and c%2==0:
    a,b,c=(b+c)//2,(a+c)//2,(a+b)//2
    cnt+=1
  print(cnt)
# Judge status: Accepted
N, D = map(int, input().split())
X = []
for i in range(N):
  X.append(list(map(int, input().split())))
#print(X)

ans = 0
for i in range(N):
  for j in range(i+1, N):
    dist_sq = 0
    for x, y in zip(X[i], X[j]):
      dist_sq += (x - y) ** 2

    dist = dist_sq ** 0.5
    #print(i, j, dist)

    if dist - int(dist) == 0:
      ans += 1

print(ans)
# Judge status: Accepted
A, B, K = map(int, input().split())

if A > K:
    A -= K
else:
    K -= A
    A = 0
    B -= K

if B < 0:
    B = 0

print(A,B)
# Judge status: Accepted
S=input()
T=input()
NS=len(S)
NT=len(T)
ans=pow(10,9)
for n in range(NS-NT):
    suuji=0
    for m in range(NT):
        if S[n+m]!=T[m]:
            suuji+=1
    ans=min(ans,suuji)
if NS==NT:
    suuji=0
    for n in range(NS):
        if S[n]!=T[n]:
            suuji+=1
    ans=min(suuji,ans)
print(ans)
# Judge status: Wrong Answer
x = int(input())

count_11 = x // 11
count_11 *= 2
remainder = x % 11

if remainder > 6:
    count_11 += 2
else:
    count_11 += 1



print(count_11)
# Judge status: Accepted
n=int(input())
a=[]
d={}
b=0
m=0
for i in range(n):
    s=input()
    try:
        a[d[s]][1]+=1
    except:
        d[s]=b
        a.append([s,1])
        b+=1
    m=max(m,a[d[s]][1])
a.sort()
for i in range(len(a)):
    if a[i][1]==m:
        print(a[i][0])
# Judge status: Accepted
import sys
import math
import bisect

def main():
    ans = 0
    for c in input():
        if c == '1':
            ans += 1
    print(ans)
    
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = [0] + a + [k[0]]
sa = [b[i + 1] - b[i] for i in range(len(b) - 1)]
c = sa[1:-1]
if k[1] % 2 == 1:
  temae = (len(sa) // 2) -1
  oku = temae + 1
  d = sum(sa) - sa[temae]
  e = sum(sa) - sa[oku]
  print(min([sum(c), d, e]))
else:
  x = len(sa) // 2
  d = sum(sa) - sa[x]
  print(min([sum(c),d]))
# Judge status: Accepted
N,M=map(int,input().split())

print(min((N *2+M)//4,M//2))
# Judge status: Accepted
N=int(input())
alist=list(map(int,input().split()))

money=1000
kabu=0
for i in range(N-1):
  if alist[i]<alist[i+1]:
    #buy as possible
    k=money//alist[i]
    kabu+=k
    money-=k*alist[i]
  elif alist[i]>alist[i+1]:
    #sell all
    money+=alist[i]*kabu
    kabu=0

money+=alist[N-1]*kabu    
print(money)
# Judge status: Accepted
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

sum_a = 0
for a in a_list:
    sum_a += a
if h <= sum_a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,A,B=map(int,input().split())
ans=0
for i in range(1,N+1):
  a=str(i)
  b=0
  for j in range(len(a)):
    b+=int(a[j])
  if A<=b<=B:
    ans+=i
print(ans)
# Judge status: Accepted
n=int(input())
t,a=list(map(float,input().split()))
h=list(map(int,input().split()))
tmp=float(1e9+7)
ans=0
for i in range(n):
    if abs(a-(t-h[i]*0.006))<tmp:
        tmp=abs(a-(t-h[i]*0.006))
        ans=i+1
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [100000000000 for _ in range(n)]
dp[0] = 0
for i in range(n):
    for j in range(min(i,k)+1):
        dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[-1])
# Judge status: Accepted
n, m = map(int, input().split())
*arr, = map(int, input().split())

print(max(n - sum(arr), -1))
# Judge status: Wrong Answer
k = int(input())
a,b = map(int,input().split())

if k <= b-a+1 or (a<=k and k<=b) or (b % k >= b-a+1):
    print('OK')
else:
    print('NG')
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

t = [i for i in range(1,n+1)]
l = [i for i in range(n) if p[i] != t[i]]

if len(l) == 0 or len(l) == 2:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
#b
N=int(input())
W=[None]*N
for i in range(N):
    W[i] = input()


if all( W[i][0]==W[i-1][-1] for i in range(1,N) ) and len(set(W))==N:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import copy
a,b = map(int, input().split())
s = list(input())
tmp = copy.copy(s)
tmp.pop(a)
if 1 <= a and b <= 5 and a + b + 1 == len(s) and s[a] == '-' and 'tmp'.join(tmp).isnumeric():
    print('yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
a,b=map(int,input().split())
cnt=1
for i in range(1,a):
    for j in range(1,b):
        if i==j:
            cnt+=1
print(cnt)
# Judge status: Accepted
a = list(map(int, input().split()))
sum = a[0] + a[1]
if sum%2 == 0:
  print(int(sum/2))
else:
  print(int((sum + 1)/2))
# Judge status: Accepted
X, Y = map(int, input().split())

if X % Y == 0:
    print(-1)
else:
   print(X)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
x=a[0]
for i in range(1,n):
  x=x^a[i]
ans=[]
for i in range(n):
  ans.append(str(x^a[i]))
print(' '.join(ans))
# Judge status: Accepted
a, b, k = map(int, input().split())

if a >= k:
    print(a-k, b)
elif b >= k-a:
    print(0, b - (k-a))
else:
    print(0, 0)
# Judge status: Wrong Answer
n, a, b, c, d = map(int, input().split())
S = input()

if c < d and (S[a-1:d+1].count("##") == 0):
    print("Yes")
    exit()

if c > d and (S[b-1:d+1].count("...") >= 1) and (S[a-1:d+1].count("##") == 0):
    print("Yes")
    exit()

print("No")
# Judge status: Accepted
import math
from scipy.special import comb
n, p = map(int, input().split())
aa = list(map(int, input().split()))
odd = []
even = []
for i in range(n):
  if aa[i] % 2 == 0:
    even.append(aa[i])
  else:
    odd.append(aa[i])
    
x = len(odd)
y = len(even)


sum1 = 0
for i in range(0, x+1, 2):
  sum1 += comb(x,i)
sum2 = 0
for i in range(1, x+1, 2):
  sum2 += comb(x,i)
  
if p == 0:
  ans = int((2 ** y) * sum1)
else:
  ans = int((2 ** y) * sum2)
print(ans)
# Judge status: Wrong Answer
def main():
  a = list(map(int, input().split()))
  print(sum(a))
    
if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
import sys
def main():
    input = sys.stdin.readline
    n=int(input())
    *A,=map(int, input().split())
    #mCr
    m,r=max(A),0
    maxd=0
    for a in A:
        if a>=m: continue
        d = min(a,m+1-a)
        if maxd<d:
            maxd=d
            r=a
    print(m,r)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
print('Yes' if int(input()) in [7, 5, 3] else 'No')
# Judge status: Accepted
K=int(input())
S=input()
print(S[:K]+"..." if len(S)>K else S)