peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math
N = int(input())
a = list(map(int,input().split()))
ave = math.ceil(sum(a)/N-0.4999999999999999)
ans = 0
for i in range(N):
    ans += (a[i]-ave)**2
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

balls = [0] * n

def get_b(num):
    cnt=0
    now=num
    while True:
        cnt+=balls[now-1]
        now+=num
        if now > n:
            break
    return cnt

for i in range(n,0,-1):
    now_cnt=get_b(i)
    if now_cnt%2 != a[i-1]:
        balls[i-1]=1

print(sum(balls))

for i in range(n):
    if balls[i] != 0:
        print(i+1,end=" ")
# Judge status: Accepted
from collections import defaultdict
from heapq import heappush, heappop, merge

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

day = defaultdict(list)
for a, b in ab:
    heappush(day[a], -b)

work, ans = [], 0
for i in range(1, m + 1):
    for j in day[i]:
        heappush(work, j)
    if len(work) > 0:
        ans -= heappop(work)
print(ans)
# Judge status: Wrong Answer

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  min = 0
  tempmin = 1000000
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    min = abs(comp_num - temp)
    if (min >= tempmin):
      break
    tempmin = min

  print(min)
# Judge status: Accepted
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

n = int(input())
a = list(map(int, input().split()))
b = a[0]
for i in range(1, n):
    b = gcd(a[i], b)
print(b)
# Judge status: Accepted
n,k=map(int,input().split())
lst=[0]*(10**5+1)
for i in range(n):
    a,b=map(int,input().split())
    lst[a]+=b

count=0
for i in range(10**5+1):
    count+=lst[i]
    if count>=k:
        print(i)
        break
# Judge status: Wrong Answer
x = int(input())
primes = []
n = 2


def is_prime(num):
    for p in primes:
        if num % p == 0:
            return False
        if p * p > num:
            return True
    return True


while True:
    if is_prime(n):
        if n >= x:
            print(n)
            exit()
        else:
            print('{}: {}'.format(len(primes), n))
            primes.append(n)
    n += 1
# Judge status: Wrong Answer
A, B = map(int, raw_input() .split())
if (A + B)%3 == 0:
    print "Possible"
else:
    print "Impossible"
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans = N


for i in range(1, N):
  x = abs(sum(A[:i]) - sum(A[i:]))
  if x < ans:
    ans = x
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    D = [list(map(int, input().split())) for i in range(N)]
    cnt = 0
    for a, b in D:
        if a == b:
            cnt += 1
        else:
            cnt = 0
        if cnt == 3:
            print('Yes')
            return
    print('No')

if __name__ == '__main__':
    main()
# Judge status: Accepted
import fractions
a, b = list(map(int, input().split()))
print(a * b // fractions.gcd(a, b))
# Judge status: Wrong Answer
a=list(map(int,input().split()))
#a=[map(int,input().split())]
print(a)
if a.count(5)==2 and a.count(7)==1:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range(n-1):
    c=min(a[i],b[i])
    a[i]-=c
    b[i]-=c
    d=min(b[i],a[i+1])
    a[i+1]-=d
    ans+=c+d
print(ans)
# Judge status: Accepted
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
sx = sorted(x)
sy = sorted(y)

if sx[-1] < sy[0] and X < sy[0] and sx[-1] < Y:
    print('No War')
else:
    print('War')
# Judge status: Accepted
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=max(a[0]-x,0)
a[0]-=ans
for i in range(n-1):
  if a[i]+a[i+1]>x:
    ans+=a[i+1]+a[i]-x
    a[i+1]=x-a[i]
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
k = int(input())
while(b <= a):
    b = b*2
    k -= 1
while(c <= b):
    c = c*2
    k -= 1

if k < 0:
    print("No")
    
else:
    print("Yes")
# Judge status: Accepted
total=0
for i in range(1, int(input()) + 1):
    if i % 3 !=0 and i % 5 != 0:
        total += i
print(total)
# Judge status: Wrong Answer
n = list(input())
a = 0
for i in range(len(n)):
  a += int(i)

if a % 9 == 0:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
s=input()
s=list(s)
c=0
for i in range(0,len(s)-1,2):
    if s[i]=='0':
        c+=1
    if s[i+1]=='1':
        c+=1
print(min(c,len(s)-c))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
t = sum(a)
ans = sum(a)
l = 0
for i in a:
    l += i 
    r = t-l
    ans = min(ans, abs(l-r))
print(ans)
# Judge status: Wrong Answer
S=input()
T=input()

count=0
for i in range(len(S)):
  if S[i]!=T[i]:
    count+=1
print(i)
# Judge status: Accepted
import sys
input = sys.stdin.readline
import itertools

N = int(input())
permutations = list(itertools.permutations(list(range(1, N+1))))
p = tuple(map(int, input().split(' ')))
q = tuple(map(int, input().split(' ')))
order = [-1] * 2
for i in range(len(permutations)):
    if p == permutations[i]:
        order[0] = i
    if q == permutations[i]:
        order[1] = i
ans = abs(order[1] - order[0])
print(ans)
# Judge status: Accepted
str=input()
if str[0]==str[1] or str[2]==str[1] or str[2]==str[3]:
    print("Bad")
else:
    print("Good")
# Judge status: Accepted
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        print(a[b], end="")
    else:
        print(a[b-26], end="")
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()


def solve():
    x = ini()
    lb, ub = 0, 0
    while lb <= x:
        if lb <= x <= ub:
            return True
        lb += 100
        ub += 105
    return False


print(1 if solve() else 0)
# Judge status: Wrong Answer
N, W = list(map(int, input().split(" ")))

l = []
for i in range(N):
	w, v = list(map(int, input().split(" ")))
	l.append((w, v))
dp = [[0]* W]*N

for i in range(0, N-1):
	for w in range(0, W):
		weight = l[i][0]
		if w >= weight:
			dp[i + 1][w] = max([dp[i][w - weight] + l[i][1], dp[i][w]])
		else:
			dp[i + 1][w] = dp[i][w]

print(dp[N-1][W-1])
# Judge status: Wrong Answer
a,b=map(int, input().split())
tower=[0 for i in range(1000)]
tower[0] = 1

for i in range(1, 1000):
    tower[i] = tower[i-1] + (i + 1)
    diff_a = tower[i-1] - a
    diff_b = tower[i] - b
    if diff_a and diff_b and diff_a > 0 and diff_b > 0:
        print(diff_a)
        break
# Judge status: Accepted
s=input()
str1=s[0]
str2=""
ans=1
for i in range(len(str1),len(s)):
    str2+=s[i]
    if str1!=str2:
        ans+=1
        str1=str2
        str2=""
print(ans)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())

if (b - a) % 2 == 0:
  print(int(b - (a+b)/2))
else:
  if (a - 1) >= (n - b):
    print((n-b) + 1 + int(n - (n+a+(n-b)+1)/2))
  else:
    print((a-1) + 1 + int(b-(a-1)-1 - (b-(a-1)-1 + 1)/2))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

a_even = list(filter(lambda x: x % 2 == 0, a))
a_odd = list(filter(lambda x: x % 2 != 0, a))

ans = a_odd[::-1] + a_even
if n % 2 == 0:
  ans = ans[::-1]

print(' '.join(map(str, ans)))
# Judge status: Wrong Answer
x = input()
if x == 0:
  print("1")
else:
  print("0")
# Judge status: Wrong Answer
def main():
    n, k = map(int, input().split())
    inlis = list()

    for _ in range(n):
        alis = list(map(int, input().split()))
        inlis.append(alis)
    
    tmp = k
    i = 0

    while tmp > 0:
        tmp -= inlis[i][1]

        if tmp > 0:
            i += 1    
        else:
            print(inlis[i][0])
            exit()



if __name__ == "__main__":
    main()
# Judge status: Accepted
import math
N,X,T = map(int,input().split())
print(math.ceil(N/X)*T)
# Judge status: Accepted
N = int(input())
M = float('inf')
for i in range(1,N):
    M = min(M,sum(list(map(int,str(i)))+list(map(int,str(N-i)))))
print(M)
# Judge status: Accepted
import math
import sys
n = int(input())
li = list(map(int, input().split()))
li.sort()
if (len(li) % 2 == 0):
    print(li[len(li)//2] - li[len(li)//2 - 1])
else:
    print(0)
# Judge status: Accepted
def solve(n,arr):
    maxh = 0
    h = 0
    for i in range(1,n):
        curr = arr[i]
        curh = arr[i-1]
        f = max(curr,curh)
        maxh = max(f,maxh)

        if curr < maxh:
            h += maxh - curr

        # print(f"curr:{curr},curh:{curh},maxh:{maxh}")
        # print(f"h:{h}")

    return h
        



n = int(input())
arr = list(map(int, input().strip().split()))

print(solve(n,arr))
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
if a+b<=c: print('Yes')
else: print('No')
# Judge status: Wrong Answer
import collections
n = int(input())
a = list(map(int,input().split()))

c = sorted(collections.Counter(a).items(),reverse = True)

tmp = 0
ans=[]

for k in c:
  if k[1]>=4:
    tmp = max(tmp,k[0]*k[0])
  elif k[1]>=2:
    ans.append(k[0])
  else:
    continue

if len(ans)>=2:
  print(max(ans[0]*ans[1],tmp))
else:
  print(tmp)
# Judge status: Accepted
A,B = map(int,input().split())

i = 1
ans = 0

while i < B:
    i = i -1 + A 
    ans += 1
print(ans)
# Judge status: Accepted
from heapq import heappop, heappush
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
X = sorted([list(map(int, input().split())) for _ in range(N)], key = lambda x: x[0])

hq = []
ans, j = 0, 0

for i in range(1, M + 1):  # M - i 日後にするバイトを考える
    while (j < N) and (X[j][0] <= i):
        heappush(hq, -X[j][1])  # 候補の追加
        j += 1
    if len(hq):
        ans += -heappop(hq)  # 候補があるとき、候補から最大値を取り出す

print(ans)
# Judge status: Wrong Answer
#n=int(input())
#s,t=input().split()
n,m = map(int, input().split())
#l=list(map(int, input().split()))

a=0
while n<m:
    a=a+1
    n=n*2

print(a)
# Judge status: Wrong Answer
S=str(input())
if S[1]=="R":
  if S[2]=="R" and S[0]=="R":
    print(3)
  else:
    if S[0]=="R":
      print(2)
    if S[2]=="R":
      print(2)
    else:
      print(1)
else:
  if S[2]=="R" or S[0]=="R":
    print(1)
  else:
    print(0)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

MOD = 1000000007

a = 0
b = 0
for i in range(N):
    a += A[i] % MOD
    b += (A[i] ** 2) % MOD
a = a ** 2
ans = (a - b) * pow(2, MOD - 2, MOD) % MOD
print(ans)
# Judge status: Accepted
n, m = map(int,input().split())

if n==m:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s = input()
print(["x"]*len(s))
# Judge status: Accepted
A, B = map(int,input().split())
ans = 0
for i in range(2):
  ans += max(A,B)
  if max(A,B) == A:
    A -= 1
  else:
    B -= 1
print(ans)
# Judge status: Wrong Answer
a,b,h,m = map(int,input().split())
import math
sitah = 30 * h + 0.5 * m
sitam = 6 * m
sitax = abs(sitah - sitam)
sitax = sitax % 180
kosain = (math.cos((math.radians(sitax))))
x2 = a**2 + b**2 - 2*a*b*kosain
ans = math.sqrt(x2)
print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())

print(h * (a + b) // 2)
# Judge status: Accepted
n,k=map(int,input().split())
n=n%k
flag=n
li=[n]
for i in range(10**10):
  n=abs(n-k)
  li.append(n)
  if n==flag:
    break
  
print(min(li))
# Judge status: Accepted
N, K = map(int, input().split())
p = list(map(int, input().split()))

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)
# Judge status: Accepted
N,M = map(int,input().split())
a = [True]*(N+1)
for _ in range(M):
  b = int(input())
  a[b] = False

mod = 10**9+7
dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
  for j in range(i+1,min(i+2,N)+1):
    if a[j]:
      dp[j] += dp[i]
      dp[j] %= mod


print(dp[-1])
# Judge status: Accepted
o = input()
e = input()
ans = ''
if len(o) == len(e):
    for i in range(len(o)):
        ans += o[i] + e[i]
else:
    for i in range(len(e)):
        ans += o[i] + e[i]
    ans += o[len(o) - 1]
print(ans)
# Judge status: Accepted
print((1000-int(input())%1000)%1000)
# Judge status: Wrong Answer
n,k = map(int,input().split())

r = n%k
w = r%k
print(min(r,w))
# Judge status: Accepted
from fractions import gcd
A, B, C = map(int, input().split())
if C % gcd(A, B) == 0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
l=list(map(int,input().split()))
print(l[0]*l[1]//2)
# Judge status: Accepted
from fractions import gcd

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

n,m = map(int,input().split())
a = list(map(int,input().split()))
b = [i // 2 for i in a]

def f(n):
    res = 0
    while n % 2 == 0:
        res += 1
        n //= 2
    return res

if not all(f(b[0]) == f(b[i]) for i in range(n)):
    print(0)
    exit(0)

cnt = f(b[0])
g = b[0] >> cnt
for i in b:
    g = lcm(g, i >> cnt)

gg = g << cnt
print((m + gg) // (2 * gg))
# Judge status: Accepted
def solve() :
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    p.sort()

    print(sum(p[0:k]))

if __name__ == "__main__":
    solve()
# Judge status: Accepted
n = input()
ans = "Yes" if '9' in n else "No"
print(ans)
# Judge status: Accepted
s = input()
t = input()
dic = {}
n = len(s)
for i in range(n):
    if s[i] in dic:
        if dic[s[i]] != t[i]:
            print("No")
            exit()
    else:
        dic[s[i]] = t[i]
if len(dic.values()) != len(set(dic.values())):
    print("No")
else:
    print("Yes")
# Judge status: Accepted
x=int(input())
a=1
for b in range(1,x+1):
    for p in range(2,x+1):
        t=b**p
        if t>x:
            break
        a=max(a,t)
print(a)
# Judge status: Accepted
n = int(input())
w = []
for i in range(n):
    w.append(input())
ok = True
for i in range(n-1):
    sz = len(w[i])
    if w[i][sz-1] != w[i+1][0]: ok = False
for i in range(n):
    for j in range(n):
        if i != j and w[i] == w[j]:
            ok = False
if ok: print('Yes')
else: print('No')
# Judge status: Accepted
#「ABピザを買う枚数」で全探索

A,B,C,X,Y = map(int,input().split())

ans = float("inf")

for i in range(0,2*max(X,Y)+1,1):#「ABピザを買う枚数」で全探索
    tmpans = i*C#ABピザの代金

    tmp_x = max(0,X-i//2)
    tmp_y = max(0,Y-i//2)
    tmpans += A*tmp_x
    tmpans += B*tmp_y

    ans = min(ans,tmpans)

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

print (x[0]+y[0]+z[0])
# Judge status: Wrong Answer
n = int(input())
print((n//2 + n%2) /2)
# Judge status: Wrong Answer
N = input()

judge = 0
i = 1

for i in range(4):
	if (N[i] == N[i-1]):
		judge += 1
	else:
		judge = 0
	if (judge >= 2):
		break
	

if (judge >= 2):
	print("Yes")
else:
	print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
len_F = sum(A)
min_F = 2020202021
sum_A = 0

for i in range(N):
    sum_A += A[i]
    len_F -= A[i]
    if(abs(sum_A - len_F) < min_F):
        min_F = abs(sum_A - len_F)
        
print(min_F)
# Judge status: Accepted
N = int(input())


isSucceed = False
cnt = 0
f = False
for _ in range(N):
    d1, d2 = map(int,input().split())
    if d1 == d2:
        if not isSucceed:
            isSucceed = True
            cnt = 1
        else:
            cnt += 1
            if cnt >= 3:
                f = True
                
    else:
        isSucceed = False
        cnt = 0

if f:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a_list = list(map(int, input().split()))

sorted_a = sorted(a_list)

print(sum(sorted_a[n:2*n]))
# Judge status: Accepted
S = list(input())
L = [0]*2019
L[0]=1
digit = 1
x = 0

for i in S[::-1]:
    x += digit*int(i)
    digit *= 10
    x %= 2019
    digit %= 2019 
    L[x] += 1

ans = 0

for i in L:
    ans += i*(i-1)//2

print(ans)
# Judge status: Accepted
s = input()
t = input()

count = len(t)

for i in range(0, len(s) - len(t) + 1):
    x = s[i : i + len(t)]
    cnt = 0
    for i in range(len(t)):
        if t[i] != x[i]:
            cnt += 1
    if count >= cnt:
        count = cnt

print(count)
# Judge status: Accepted
import numpy as np
N,W=list(map(int,input().split()))
DP=np.zeros(W+1)

for i in range(N):
    w,v=list(map(int,input().split()))
    a=DP[:-w]+v
    b=DP[w:]
    c=np.maximum(a,b)
    DP[w:]=c



print(int(DP[-1]))
# for i in DP:
#     print(i)
# Judge status: Accepted
c = str(input())

vow = ['a','i','u','e','o']
flag = 0

for i in vow:
    if c == i:
        print('vowel')
        
    else:
        flag+=1
        
if flag ==5:
    print('consonant')
# Judge status: Wrong Answer
n,s=int(input()),str(input())
ans=0
for i in range(n-1):
  for j in range(i,n):
    x=s[i:j+1]
    if all(x.count(c)==1 for c in x):
      ans+=1
print(ans%(10**9+7))
# Judge status: Wrong Answer
import bisect

N = int(input())
L = sorted(map(int, input().split(' ')))

ans = 0
for i in range(len(L)):
    for j in range(i + 1, len(L)):
        a = L[i]
        b = L[j]
        left = b
        right = a + b
        ans += bisect.bisect_left(L, right) - bisect.bisect_right(L, left)

print(ans)
# Judge status: Accepted
N=int(input())
N3=N//3
N5=N//5
N15=N//15
def s(x):
  return x*(x+1)//2
print(s(N)-3*s(N3)-5*s(N5)+15*s(N15))
# Judge status: Wrong Answer
X,Y = map(int, input().split())
import math

tmp1 = math.floor(math.log((Y/X),2))
print(tmp1 + 1)
# Judge status: Accepted
n=int(input())

a=[]
b=[]

for i in range(n):
    aa,bb=list(map(int,input().split()))
    a.append(aa*2)
    b.append(bb*2)

a.sort()
b.sort()

if n%2==1:
    amed=a[(n-1)//2]
    bmed=b[(n-1)//2]

    ans=(bmed-amed)//2+1
else:
    amed=(a[n//2-1]+a[n//2])/2
    bmed = (b[n // 2 - 1] + b[n // 2]) / 2

    ans=bmed-amed+1

print(int(ans))
# Judge status: Accepted
N = int(input())
upper = list(map(int,input().split()))
lower = list(map(int,input().split()))

temp_sum = sum(upper) + lower[N-1]
max_value =temp_sum

for i in range(N-1):
  temp_sum = temp_sum - upper[-(i+1)] +lower[-(i+2)]
  if temp_sum > max_value:
    max_value = temp_sum

print(max_value)
# Judge status: Accepted
n = list(input())
t = int(n[-1])
if t in [2,4,5,7,9]:
  print('hon')
elif t in [0,1,6,8]:
  print('pon')
else:
  print('bon')
# Judge status: Accepted
d, n = map(int, input().split())
if n == 100:
    print(max(100 ** d, 1) * n + 100**d)
else:
    print(max(100 ** d, 1) * n)
# Judge status: Accepted
n = int(input())

for x in range(1, 10**5):
	if int(x * 1.08) == n:
		print(x)
		exit()
print(':(')
# Judge status: Wrong Answer
D=input()
if D==25:
    print('Christmas')
if D==24:
    print('Christmas Eve')
if D==23:
    print('Christmas Eve Eve')
if D==22:
    print('Christmas Eve Eve Eve')
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))

resZero = resOne = 0
for a in A:
    if a % 2 == 0:
        resZero += 1
    else:
        resOne += 1

if resOne == 0:
    if P == 1:
        print(0)
    else:
        print(2 ** N)
else:
    print(2**(N-1))
# Judge status: Accepted
A=[[int(i) for i in input().split()] for q in range(3)]
n=int(input())

tar=[]
for i in range(n):
  ck=int(input())
  for p in range(9):
    if A[p//3][p%3] == ck:
      tar.append(p)
      
def check(a,b,c):
  if a in tar and b in tar and c in tar:
    return 1
  else:
    return 0
  
res=check(0,1,2)+check(3,4,5)+check(6,7,8)+check(0,3,6)+check(1,4,7)+check(2,5,8)+check(0,4,8)+check(2,4,6)
if res == 0:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
A,B,C=input().split()
print("A"+B[0]+"C")
# Judge status: Wrong Answer
N = 3
print(N *(N + 1) / 2)

N = 10
print(N * (N + 1) / 2)

N = 1
print(N * (N + 1) / 2)
# Judge status: Accepted
from operator import itemgetter

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [tuple(int(i) for i in input().split()) for _ in range(m)]

a.sort()
bc.sort(key=itemgetter(1), reverse=True)
idx = 0
b, c = bc[idx]
for i in range(n):
    if a[i] >= c:
        break
    a[i] = c
    b -= 1

    if b == 0:
        idx += 1
        if idx >= m:
            break
        b, c = bc[idx]

print(sum(a))
# Judge status: Wrong Answer
K,N=map(int,input().split())
A=sorted(list(map(int,input().split())))

max_a = max(A)
min_a = min(A)
diff_min = K

if max_a - min_a <= K/2:
    print(max_a-min_a)
else:
    if K - A[1] - min_a < max_a - min_a:
        print(K - A[1] - min_a)
    else:
        print(max_a - min_a)
# Judge status: Accepted
n = input()
total = 0
for digit in n:
  total += int(digit)
if total == 1:
  print(10)
else:
  print(total)
# Judge status: Accepted
def main():
    x, y = (int(i) for i in input().split())
    A = [x]
    while A[-1]*2 <= y:
        A.append(A[-1]*2)
    print(len(A))


if __name__ == '__main__':
    main()
# 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
n,k=map(int,input().split())
l=[0]*(10**5+1)
for i in range(n):
  a,b=map(int,input().split())
  l[a]+=b
sm=0
for i in range(1,10**5+1):
  sm+=l[i]

  if sm>=k:
    print(i)
    break
# Judge status: Wrong Answer
import sys

a,b=map(int,input().split())
ss=input().strip()

if len(ss) != (a+b+1):
  print("No")
  sys.exit()

#a 3  123-345
nums=[0,1,2,3,4,5,6,7,8,9]

for i in range(len(ss)):
  if i==a:
    if i!="-":
      print("No")
      sys.exit()
  elif i not in nums:
    print("No")
    sys.exit()
print("Yes")
# Judge status: Accepted
arr = [[''] * 3 for i in range(2)]
for i in range(2):
    tmp = input()
    tmp = list(tmp)
    arr[i] = tmp

if arr[0][0] == arr[1][2] and arr[0][1] == arr[1][1] and arr[0][2] == arr[1][0]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n,x,y = map(int,input().split())

dist_list = [0 for _ in range(n)]

for i in range(1,n+1):
    for j in range(i+1,n+1):
        if j <= x or i >= y:
            distance = j-i
        else:
            distance = min(j-i,abs(x-i)+abs(y-j)+1)
        dist_list[distance] += 1

for i,dist in enumerate(dist_list):
    if i >= 1:
        print(dist)
# Judge status: Wrong Answer
import numpy as np

N=int(input())
#A=[int(x) for x in input().split()]
XL=[]
for i in range(N):
    XL.append(list(map(int,list(input().split()))))
XL=np.asarray(XL)
XLs=XL[np.argsort(XL[:,0])]
right=XLs[0][0]+XLs[0][1]
ans=1
for i in range(N-1):
    if XLs[i+1][0]-XLs[i+1][1]-right>=0:
        ans+=1
        right=XLs[i+1][0]-XLs[i+1][1]
        
#ans=XLs
print(ans)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if c >= a + b:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
a,b = map(int,input().split())

kaku_a = 360/16 * a
kaku_b = 360/16 * b

if kaku_a < 180 and kaku_b < 180:
    print('Yey!')
else:
    print(':(')
# Judge status: Wrong Answer
a=list(map(int,input().split()))
a=sorted(a)
con=0
for i in range(1):
  con+=a[i]
  
print(con)
# Judge status: Accepted
import heapq

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

day_rew = {}
for _ in range(N):
    a, b = map(int, input().split()) 
    day_rew.setdefault(a,[])
    day_rew[a].append(b)

ans = 0
job_rew = []
heapq.heapify(job_rew)
for i in range(1, M+1):
    if i in day_rew:
        for r in day_rew[i]:
            heapq.heappush(job_rew, r*(-1))
    if job_rew:
        this_day_rew = heapq.heappop(job_rew)*(-1)
        ans += this_day_rew

print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
c=0
s=n
while(s<=k):
    c=c+1
    s=s*2
print(c)
# Judge status: Wrong Answer
n,m,x = map(int,input().split())
book = [list(map(int,input().split())) for _ in range(n)]
ans = 12 * (10**5) + 1
for i in range(2**n):
    kingaku = 0
    rikaido = [0] * m
    for j in range(n):
        if (i >> j) & 1:
            kingaku += book[j][0]
            for k in range(m):
                rikaido[k] += book[j][1]
    if all((a >= x for a in rikaido)):
        ans = min(ans,kingaku)
if ans != 12 * (10**5) + 1:
    print(ans)
else:
    print("-1")
# Judge status: Accepted
import heapq
n,m=map(int,input().split())
t=[[] for _ in range(m+1)]
for i in range(n):
    a,b=map(int,input().split())
    if a>m:
        continue
    t[a].append(b)
ans=0
h=[]
for l in t:
    for i in l:
        heapq.heappush(h,-i)
    if h:
        ans-=heapq.heappop(h)
print(ans)