peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())

import math

ans = []

def calc(N):
  ans_q = math.ceil((2*N+1/4)**(1/2)-1/2)
  ans.append(ans_q)
  return N-ans_q

while N != 0:
  N = calc(N)

[print(x) for x in sorted(ans)]
# Judge status: Accepted
s = input()
ans = ""
for i in range(len(s)):
  if s[i] == "0":
    ans += "0"
  elif s[i] == "1":
    ans += "1"
  else:
    ans = ans[:-1]
print(ans)
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
minus = 0
ans = 0
abs_min = float('inf')
for a in A:
  if a < 0:
    minus += 1
  ans += abs(a)
  abs_min = min(abs_min, abs(a))
if minus%2:
  ans -= abs_min*2

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

i = K
S = 0
while i < N+1:
    S = S + (N+1-i)*i+1
    i = i + 1
S = S + 1

print(int(S%1000000007))
# Judge status: Accepted
n = int(input())
line = [int(x) for x in input().split()]
count = 0
for i in range(0, n, 2):
    if line[i] % 2 != 0:
        count += 1
print(count)
# Judge status: Wrong Answer
import fractions

n = int(input())
t = [0]*n
for i in range(n):
    t[i] = int(input())
    
ans = t[0]
    
for i in range(n-1):
    ans = t[i] * t[i+1] / fractions.gcd(t[i],t[i+1])
    
print(int(ans))
# Judge status: Accepted
N=int(input())
an=sorted(list(map(int,input().split())))
dic={}

for ai in an:
  if ai not in dic:dic[ai]=1
  else:dic[ai]+=1
  pass

max_v=0
for x in range(an[0],an[-1]+1):
  v=0
  if x-1 in dic: v+=dic[x-1]
  if x   in dic: v+=dic[x]
  if x+1 in dic: v+=dic[x+1]
  max_v=max(max_v,v)
print(max_v)
# Judge status: Accepted
#template
def inputlist(): return [int(j) for j in input().split()]
from collections import Counter
#template
#issueから始める
li = inputlist()
K = int(input())
li.sort()
li[-1] = li[-1]*2**K
print(sum(li))
# Judge status: Accepted
x,a,b=map(int,input().split())
print(["A","B"][abs(x-b)<=abs(x-a)])
# Judge status: Wrong Answer
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

s = list(input())
t = list(input())
t2 = ""
for i in range(len(t)):
    t2+=t[len(t)-i-1]
if s == t2:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
c = input().rstrip('\n')

str1 = "dreamer"
str2 = "dream"
str3 = "eraser"
str4 = "erase"


count = 0

while(count < len(c)-1):
  if(c[count:count+len(str1)] == str1):
    count += len(str1)
  elif(c[count:count+len(str2)] == str2):
    count += len(str2)
  elif(c[count:count+len(str3)] == str3):
    count += len(str3)
  elif(c[count:count+len(str4)] == str4):
    count += len(str4)
  else:
    print("NO")
    exit()

print("YES")
# Judge status: Accepted
N = int(input())
D = input().split()
D = sorted([[int(D[i]),i+1] for i in range(N)])
for i in range(N):
  print(D[i][1],end = " ")
# Judge status: Wrong Answer
X = int(input())
ans = 1
for i in range(2,int(X**0.5)+1):
    cnt = 2
    y = i**cnt
    while y<X:
        ans = max(ans,y)
        cnt +=1
        y = y*i
print(ans)
# Judge status: Accepted
a, b = map(int,input().split())
if b < 10:
  for x in range(10*b,10*(b+1)):
    if int(0.08*x) == a:
      print(x)
      exit()
else:
  for x in range(10*b,10*b+10):
    if int(0.08*x) == a:
      print(x)
      exit()
print(-1)
# Judge status: Accepted
N,M = map(int,input().split())
if N == 1 and M == 1:
  print(1)
elif N == 1 or M == 1:
  print(N*M-2)
elif 2 <= N*M <= 6:
  print(0)
else:
  print((N-2)*(M-2))
# Judge status: Wrong Answer
n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n):
  if a[i]<=x:
    x=x-a[i]
    ans=ans+1
if ans>0 and x>0:
  ans=ans-1
print(ans)
# Judge status: Accepted
s = int(input())
def f(n):
  a = 0
  if n % 2 == 0:
    a = n // 2
  else:
    a = 3 * n + 1
  return a

arr = [s]
i = 1
flag = 0
while flag == 0:
  an = f(arr[i - 1])
  arr.append(an)
  for j in range(i):
    if an == arr[j]:
      flag = 1
      break
  i += 1
print(len(arr))
# Judge status: Accepted
n,k = map(int,input().split())
h = [int(input()) for _ in range(n)]
h.sort()

ans = 10**9
for i in range(n-k+1):
    #print(i,i+k-1)
    ans = min(ans,h[i+k-1]-h[i])
print(ans)
# Judge status: Accepted
x = input()
s = int(x.split()[0])
w = int(x.split()[1])

if w >= s:
  print("unsafe")
else:
  print("safe")
# Judge status: Accepted
a, b, x = map(int, input().split())
print(b//x-(a-1)//x)
# Judge status: Accepted
n = int(input())
a,b = map(int,input().split())
#a_L = list(map(int,input().split()))

for i in range(a,b+1):
    if i%n == 0:
        print("OK")
        exit()
print("NG")
# Judge status: Accepted
N = int(input())
a  =list(map(int, input().split()))
a.sort()

ans1 = a[-1]
ans2 = 0

for i in a:
    if abs(ans1/2-ans2) > abs(ans1/2-i):
        ans2 = i
print(ans1, ans2)
# Judge status: Wrong Answer
A, B, C = list(map(int, input().split()))

flag = False
for i in range(1, B + 1):
    remainder = A * i % B
    if remainder == C:
        flag = True
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
ans=-1
next=1
b=0
for i in range(n):
  if a[i]==next:
    next+=1
  else:
    b+=1

print(b if b<n else -1)
# Judge status: Accepted
print(6 - int(input()) - int(input()))
# Judge status: Wrong Answer
n,a,b=map(int,input().split())

ans=0
for i in range(1,n+1):
  s=str(i)
  s=sum(list(map(int,s)))
  if a<=s and s<=b:
    ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]

ans = 0
for i in range(N-1):
    ans += A[i]//2
    A[i] %= 2
    if A[i] <= A[i+1]:
        ans += A[i]
        A[i+1] -= A[i]
ans += A[N-1]//2

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

if a <= 8 and b <= 8 :
    print("Yay!")
else:
    print(":(")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

a.sort()

for i in range(n):
    a.pop()
    a.pop(0)

print(sum(a))
# Judge status: Accepted
import statistics

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

if N % 2 == 0:
    print(round(2 * (Bm - Am) + 1))
else:
    print(Bm - Am + 1)
# Judge status: Accepted
N=input()
sides = [int(i) for i in input().split()]
maxSide = max(sides)
print('Yes' if maxSide < sum(sides) - maxSide else 'No')
# Judge status: Accepted
#abc108 a
k=int(input())
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        if i%2==0 and j%2==1:
            ans+=1
print(ans)
# Judge status: Wrong Answer
def resolve():
    N = int(input())
    A = [int(i) for i in input().split()]
    for i in range(N - 1):
        if A[i] < 0:
            A[i] *= -1
            A[i + 1] *= -1
    if abs(A[-2]) < abs(A[-1]):
        A[-2] *= -1
        A[-1] *= -1
    print(sum(A))

resolve()
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

def main():
    S=list(input())
    ans=0
    tmp=0
    for s in S:
        if s=='A' or s=='T' or s=='G' or s=='C':
            tmp+=1
        else:
            ans=max(ans,tmp)
            tmp=0
    ans=max(ans,tmp)
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
S =str(input())
S.split()

kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']
c = 0

for i in range(len(S)):
  if i%2 == 0:
    if S[i] in kisu:
      c += 1
  else:
    if S[i] in gusu:
      c += 1
      

if c == len(S):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
def solve(x):
  n = len(str(x))
  res = 0
  for i in str(x):
    res += int(i)
  return res

n=int(input())
ans = 10**20
for a in range(1,n):
  ans = min(ans,solve(a)+solve(n-a))
print(ans)
# Judge status: Wrong Answer
import bisect as bs
import sys

x = int(input())

dic = {}

i = 1
while True:
  dic[i ** 5] = i
  if i ** 5 >= 10 ** 10:
    break
    
  i += 1
  

for i in range(100):
  tmp = x + (i ** 5)
  if tmp in dic.keys():
    print(dic[tmp], i)
    sys.exit(0)
    
  tmp = x - (i ** 5)
  if tmp in dic.keys():
    print(dic[tmp], -i)
    sys.exit(0)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
sum_a=sum(a)
sum_b=sum(b)
a_cnt,b_cnt=0,0
for aa,bb in zip(a,b):
    if aa>bb:
        a_cnt+=aa-bb
    elif aa<bb:
        b_cnt+=(bb-aa)//2
if a_cnt<=b_cnt:
  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)
#    exit()
L = abs(A*B*(C//2) - (A*B*(C-C//2)))
N = abs(A*C*(B//2) - (A*C*(B-B//2)))
M = abs(C*B*(A//2) - (C*B*(A-A//2)))

print(min(L,N,M))
# Judge status: Wrong Answer
num = [int(s) for s in input().split()]

com = 1
tes = 2
if max(num)%min(num) == 0:
  print(max(num))
else:
  while tes < min(num)/2:
    if min(num)%tes == 0 and max(num)%tes == 0:
      com *= tes
      num = [int(n/tes) for n in num]
    else:
      tes += 1

print(com*min(num)*max(num))
# Judge status: Accepted
def gcd(a, b):
    while b: a, b = b, a % b
    return a
def lcm(a, b):
    return b//gcd(a, b)*a

P = 10**9+7
N = int(input())
A = [int(a) for a in input().split()]
L = 1
s = 0
for a in A:
    L = a // gcd(L, a) * L
    s += pow(a, P-2, P)
print(s * L % P)
# Judge status: Accepted
import collections
n=int(input())
a=list(map(int,input().split()))
c=collections.Counter(a)
cnt=0
for a in c:
    if c[a]-a>=0:
        cnt+=min(c[a]-a,c[a])
    else:
        cnt+=c[a]
print(cnt)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
h = int(input())

print(2*(a+b)*h)
# Judge status: Accepted
n = int(input())
A = []
for i in range(n):
    A.append(input())
A = list(set(A))
print(len(A))
# Judge status: Wrong Answer
n=int(input())
a=int(input())
if a==0:
    if n%500==0:
        print("Yes")
    else:
        print("No")
elif n//500+a>=n:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def cin():
    return input().split()

x = cin()
l = int(x[0])
r = int(x[1])
d = int(x[2])
sum = 0;
for i in range(l,r+1):
    if i % d == 0:
        sum += 1
print(sum)
# Judge status: Accepted
n,m = map(int,input().split()) #要復習
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]
 
for i in range(n-m+1):
    for j in range(n-m+1):
        a1 = [a[k][j:j+m] for k in range(i,i+m)]
        if a1 == b:
            print('Yes')
            exit()

print('No')
# Judge status: Wrong Answer
n =int(input())
a =[int(input()) for _ in range(n)]
new_a=sorted(a)
first_max =new_a[-1]
second_max =new_a[-2]
for i in a:
    print(i)
    if i ==first_max:
        print(second_max)
    else:
        print(first_max)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
A=a*c
B=a*d
C=b*c
D=b*d
N=[A,B,C,D]
print(max(N))
# Judge status: Accepted
a, b = map(int, input().split())
print("Even") if (a * b) % 2 == 0 else print("Odd")
# Judge status: Wrong Answer
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b, k = Input()
    ans = 0
    for i in range(1, k, a):
        ans += b
    print(ans)


main()
# Judge status: Wrong Answer
n = int(input())
la = [int(w) for w in input().split()]

ans = 0
i = 1
for a in la:
    if a != i:
        ans += 1
    else:
        i += 1
print(ans)
# Judge status: Wrong Answer
n=int(input())
s=input()
t=0
m=-1
for i in range(len(s)):
    if s[i]=="I":
        t+=1
    else:
        t-=1
    if m<t:
        m=t
print(m)
# Judge status: Wrong Answer
N, M = map(int, input().split())
n = min(N, M)
m = max(N, M)
if ｎ == 1:
    print(max(m-2, 0))
elif n == 2:
    print(0)
else:
    print((n-2)*(m-2))
# Judge status: Accepted
from fractions import gcd


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


def mod_inv(a, m):
    return pow(a, m-2, m)


MOD = 10 ** 9 + 7

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


_lcm = 1
for a in A:
    _lcm = lcm(_lcm, a)

ans = _lcm * sum([mod_inv(s, MOD) for s in A]) % MOD

print(int(ans % MOD))
# Judge status: Accepted
#!/usr/bin/env python3
n = int(input())
a = input().split()
ans = a[0::2][::-1] + a[1::2]
if n % 2:
    print(*ans)
else:
    print(*ans[::-1])
# Judge status: Accepted
n, m = map(int, input().split())

if n % 2 == 1:
    for i in range(1, m+1):
        print(i, n - i)
else:
    for i in range(1, min(n//4+1, m+1)):
        print(i, n - i + 1)
    for i in range(n//4+1, m+1):
        print(i, n - i)
# Judge status: Wrong Answer
import bisect as bi
I=lambda:list(map(int,input().split()))
n,x=I()
l=I()
ans=0
t=0
for i in range(1,n):
  l[i]+=l[i-1]
an=bi.bisect(l,x)
print(an)
# Judge status: Accepted
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
cnt=0
for i in range(n-2):
    if (l[i][0]==l[i][1]) and (l[i+1][0]==l[i+1][1]) and (l[i+2][0]==l[i+2][1]):
        print("Yes")
        exit()
print("No")
# Judge status: Wrong Answer
S = input()

# Greedyアルゴリズム
S = S[::-1]
print(S)

S = S.replace("resare","")
S = S.replace("esare","")
S = S.replace("remaerd","")
S = S.replace("maerd","")

if S == "":
        print("YES")
else:
        print("NO")
# Judge status: Wrong Answer
N, L = map(int, input().split())
hates = list(map(str, input().split()))
for i in range(N, 10000):
    nums = list(str(i))
    com = set(nums) & set(hates)
    if len(com) == 0:
        print(i)
        break
# Judge status: Accepted
#!/usr/bin/env python3
n,x = map(int,input().split())
a = list(map(int,input().split()))
def gcd(a,b):
    if b > a: a,b = b,a
    while b > 0:
        #print(a,b)
        a,b = b,a%b
    return a
cur_gcd = abs(x-a[0])
a.sort()
for i in range(n-1):
    cur_gcd = gcd(cur_gcd,abs(x-a[i+1]))
    #print(cur_gcd)
print(cur_gcd)
# Judge status: Accepted
n = list(str(input()))

if int(''.join([n[0],n[0],n[0]])) < int(''.join(n)):
  print(int(''.join([n[0],n[0],n[0]]))+111)
else:
  print(int(''.join([n[0],n[0],n[0]])))
# Judge status: Accepted
n  = int(input())
s = [int(input()) for i in range(n)]

s.sort()
ans = sum(s)
if (ans % 10 != 0):
    print(ans)
else:
    for i in s:
        if (i % 10 != 0):
            print(ans - i)
            break
    else:
        print(0)
# Judge status: Accepted
a, b = map(int, input().split())
c = a+b
if c >= 24:
    print(c-24)
else:
    print(c)
# Judge status: Accepted
a,b,c,x = map(int,[input() for i in range(4)])
ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i * 500 + j * 100 +k * 50 == x:
        ans += 1
print(ans)
# Judge status: Accepted
from collections import Counter
def comb(x):
    return x*(x-1)//2
n = int(input())
a = list(map(int,input().split()))
c = Counter(a)
b = 0
for i in c.values():
    b+=comb(i)
for k in range(n):
    print(b-c[a[k]]+1)
# Judge status: Accepted
N,M = map(int,input().split())
List = list(map(int,input().split()))
if sum(List) > N:
  print(-1)
else:
  print(N-sum(List))
# Judge status: Wrong Answer
import sys
import copy
import math
import itertools
import numpy as np
import re

N = int(input())
s = [int(input()) for c in range(N)]
s = sorted(s)
ans = sum(s)

for i in range(N):
    if ans % 10 ==0:
        ans -= s[i]
    else:
        print(ans)
        sys.exit(0)

print(0)
# Judge status: Accepted
l=list(map(int,input().split()))
a=l[0]
b=l[1]
c=l[2]
if a+b==c or b+c==a or c+a==b:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
D, T, S = map(int, input().split())

if(T >= D/S):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
s = input() + '#'

idx = s.index('#')

cnt = 0
for i in range(idx + 1, n):
    if s[i] == '.':
        cnt += 1

res1 = cnt
res2 = s.count('.')
res3 = s[:n].count('#')

print(min(res1, res2, res3))
# Judge status: Accepted
s = input()
s=list(s)
N=len(s)

def check(s):
    n=len(s)
    if n%2==1:
        lefts=s[:n//2]
        rights=s[n//2+1:]
    else:
        lefts=s[:n//2]
        rights=s[n//2:]
    if lefts!=rights[::-1]:
        return False
    else:
        return True

if check(s) and check(s[:(N-1)//2]) and check(s[(N+3)//2-1:]):
    print('Yes')
else: 
    print('No')
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A.sort()
ans = A[N-1]

update = True
while update == True:
    update = False
    n = len(A)
    for i in range(1,n):
        A[i] %= A[0]
    C = []
    for a in A:
        if 1 <= a:
            C.append(a)
    C.sort()
    A = C
    if A[0] < ans:
        ans = A[0]
        update = True

print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
p=0
for x in a:
	p^=x
ans=[]
for x in a:
	ans.append(p^x)
print(ans)
# Judge status: Wrong Answer
w = input()
if w[-1] =='s':
    result = w[:-1] + 'es'
else:
    result = w + 's'
print(result)
# Judge status: Accepted
def main():
  ans = [0] *100000
  for i in range(1,  101):
    for j in range(1, 101):
      for k in range(1, 101):
        ans[i**2 + j**2 + k**2 + i*j + j*k + k*i-1] +=1
  n = int(input())
  for i in range(n):
    print(ans[i])
  
if __name__ == "__main__":
  main()
# Judge status: Accepted
n, q = map(int, input().split())
s = str(input())

count = [0] * n
for i in range(n - 1):
    if s[i:i+2] == "AC":
        count[i+1] = count[i] + 1
    else:
      count[i+1] = count[i]

for i in range(q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    print(count[r] - count[l])
# Judge status: Accepted
N = input()

if N.count('7') == 0:
    print('No')
else:
    print('Yes')
# Judge status: Accepted


def main():
    A, B = input().split()
    A = int(A)
    B = float(B)
    B = int(B*100 + 0.5)
    result = str(A*B)[:-2] or '0'
    print(result)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
s=0
for i in range(9):
    for j in range(9):
        if N == (i+1)*(j+1):
            s=1
            break
    if s==1:break
if s==1:
    print("Yes")
else: print("No")
# Judge status: Wrong Answer
X,Y = map(int, input().split())

print(X +(Y/2))
# Judge status: Wrong Answer
# https://atcoder.jp/contests/arc081/tasks/arc081_a
N = int(input())
A = list(map(int, input().split()))

# まずは使える辺の長さを抽出
from collections import Counter
A_cnt = Counter(A)
candi = {k for k, v in A_cnt.items() if v > 1}
if len(candi) < 2:
    print(0)
    exit()
A_ls = sorted(candi, reverse=True)
print(A_ls[0] * A_ls[1])
# Judge status: Accepted
n = int(input())
x = list(map(int, input().split()))
sum1 = 100*100**2
for i in range(101):
    sum2 = 0
    for j in range(len(x)):
        sum2 += (x[j] - i)**2
    if sum2 < sum1:
        sum1 = sum2
print(sum1)
# Judge status: Accepted
a, b, c = map(int, input().split())

for i in range(1, 101):
    if a * i % b == c:
        print("YES")
        exit()
else:
    print("NO")
# Judge status: Accepted
s = ''.join(sorted(input(), reverse=False))
t = ''.join(sorted(input(), reverse=True))

if s < t:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
B = [float("inf")] + [int(i) for i in input().split()] + [float("inf")]
A = 0
for i in range(N):
    A += min(B[i], B[i+1])
print(A)
# Judge status: Wrong Answer
x, y = map(int, input().split())

mod = 10 ** 9 + 7


def choose(n, r):
    cx = 1
    cy = 1
    for i in range(r):
        cx = cx * (n - i) % mod
        cy = cy * (i + 1) % mod
    cy = pow(cy, mod - 2, mod)
    return cx * cy % mod


if (x + y) % 3 != 0 or x < 0 or y < 0:
    print(0)
    exit()
else:
    n = (x + y) // 3
    x -= n
    y -= n
    print(choose(x + y, x))
# Judge status: Wrong Answer
import sys
n=int(input())
x=list(map(int,input().split()))

c=[]

for i in x:
    if i not in c:
        c.append(i)
    else:
        print('No')
        sys.exit()

print('Yes')
# Judge status: Accepted
import sys


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


sys.setrecursionlimit(10 ** 9)


def main():
    N, K, S = map(int, input().split())
    A = [S for _ in range(K)]
    if S != 10 ** 9:
        B = [S + 1 for _ in range(N - K)]
    else:
        B = [S - 1 for _ in range(N - K)]
    C = A + B
    print(*C, sep=" ")


if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
cnt = [0]*(10**5+1)
sumA = sum(A)
for a in A:
  cnt[a] += 1
        
for query in range(Q):
  b,c = map(int,input().split())
  sumA += cnt[b]*(c-b)
  cnt[c] += cnt[b]
  cnt[b] = 0
  print(sumA)
# Judge status: Wrong Answer
n, x = map(int, input().split())
list = list(map(int, input().split()))

jump = 0
cnt = 0
for i in list:
    if cnt < n and jump <= x:
        cnt += 1
        jump += i
    else:
        break

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

if A[0] == A[1] and A[1] != A[2]:
    print("Yes")
elif A[0] != A[1] and A[1] == A[2]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N , M = map(int,input().split())


if 0<=N<=100 and 0 <= M <= N:
    if N==M:
        print("yes")
        
else:
    print("no")
# Judge status: Accepted
a, b, c = map(int, input().split())
if a == 5 and b == 5 and c == 7:
  print("YES")
elif a == 5 and b == 7 and c == 5:
  print("YES")
elif a == 7 and b == 5 and c == 5:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
from functools import reduce
s, t = input(), input()
ans = 10**9
for i in range(0, len(s) - len(t)):
    ans = min(ans, reduce(lambda x, a: x + (1 if a[0] != a[1] else 0), zip(s[i:], t), 0))
print(ans)
# Judge status: Accepted
N,M=list(map(int, input().split()))
if N>1 and M>1:
  print((N-2)*(M-2))
elif N*M>1:
  print(N*M-2)
else:
  print(1)
# Judge status: Wrong Answer
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()
# row = [int(input().rstrip()) for _ in range(n)]

def resolve():
    import sys
    input = sys.stdin.readline

    x, y = [int(x) for x in input().rstrip().split(" ")]

    # 何倍までできるか
    m = y / x

    # 2 ** ?
    count = 0
    num = 1
    while m >= num:
        count += 1
        num *= 2
    print(count)


if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
n=int(input())

print(n%2)
ans=[]
while n!=0:
    r=n%2
    ans.append(r)
    n=int((n-r)/(-2))

ans.reverse()

for i in ans:
    print(i,end='')
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a + b % 2 == 1: 
    print('IMPOSSIBLE')
    exit()
print((a+b) // 2)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
print(sum(a[n:2*n]))
# Judge status: Accepted
N = int(input())
C = input()

l, r = 0, N - 1
ans = 0
while l < r:
    if C[l] == 'R':
        l += 1
    elif C[r] == 'W':
        r -= 1
    else:
        ans += 1
        l += 1
        r -= 1
print(ans)
# Judge status: Accepted
n=int(input())
i=1
while True:
  if i**2>n:
    ans=(i-1)**2
    break
  i+=1
print(ans)
# Judge status: Wrong Answer
import random
a=random.randint(1,11)
print(str(a+a*a+a*a*a))
# Judge status: Accepted
N, K = map(int, input().split())
dic = {}
dic['s'], dic['p'], dic['r'] = map(int, input().split())
T = input()
score = [0]*N
for i in range(N):
  if i>=K and T[i]==T[i-K] and score[i-K]>0:
    continue
  score[i] = dic[T[i]]
print(sum(score))
# Judge status: Accepted
x, a, b = map(int, input().split())
print("BA"[abs(a - x) < abs(b - x)])
# Judge status: Accepted
X,K,D = (int(x) for x in input().split())
X=abs(X)
if X>K*D:
    print(X-K*D)
else:
    s=X//D
    X-=s*D
    K-=s
    if K%2==0:
        print(X)
    else:
        print(abs(X-D))
# Judge status: Accepted
data = input()

if data[-1] == 's':
  data = data + "es"
else:
  data = data + "s"
print(data)
# Judge status: Wrong Answer
n,q = list(map(int, input().split()))
s = input()
s_ps=[0]*n

a =s[0]

for i in range(n):
    b = a
    a = s[i]
    if b+a=='AC':
        s_ps[i]=1
        
#print(s_ps)


for _ in range(q):
    r,l=list(map(int, input().split()))
    #print(s_ps[r-1:l])
    print(sum(s_ps[r-1:l]))
# Judge status: Wrong Answer
a,b = map(int,input().split(" "))
ar = list(map(int,input().split(" ")))
count = 1
a -= b
if a <= b and a != 0:
    count += 1
elif a // (b - 1) == 0:
    count += a // (b - 1)
else:
    count += a // (b - 1) + 1
print(count)