Harryxun/stf_run huggingface dataset:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
A = LIST()
L = [LIST() for i in range(M)]

L = sorted(L, key=lambda x: x[1], reverse=True) # 0番目の要素でソート

A.sort()
n = 0
for i in range(M):
    times, num = L[i]
    while times > 0:
        if A[n] < num:
            A[n] = num
            times -= 1
            n += 1
        else:
            print(sum(A))
            exit()
print(sum(A))


    



### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
import heapq

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
A = LIST()
L = [LIST() for i in range(M)]
L = sorted(L, key=lambda x : x[1], reverse=True)
default_sum = sum(A)

heapq.heapify(A)  # リストを優先度付きキューへ

for max_cnt, target in L:
    cnt = 0
    while cnt < max_cnt and len(A) != 0:
        min_num = heapq.heappop(A) # pop min
        default_sum += max(target - min_num, 0)
        cnt += 1
    
print(default_sum)



    

exit()
print(heapq.heappop(a))  # 最小値の取り出し

heapq.heappush(a, -2)  # 要素の挿入
print(a)
for i in range(M):
    a = heapq.heappop(A) * (-1)
    a = a // 2
    heapq.heappush(A, -a)
A = list(map(lambda x: x * (-1), A))
print(sum(A))
import math
 
a, b = map(int, input().split())
c = a*b
math.floor(c)
print(c)


### FIXED CODE ###

def main():
    A, B = input().split()
    A = int(A)
    B_big, B_small = B.split(".")
    B_big = int(B_big)
    B_small = int(B_small)
    print(A*B_big + A*B_small//100)
 
 
if __name__ == "__main__":
    main()
inf = 10**9 + 7
n, k = map(int, input().split())

nodes = list(map(int, input().split()))
dp = [inf] * n

dp[0] = 0

# for i in range(n):
#     for j in range(i+1, min(i+k+1, n)):
#         dp[j] = min(dp[j], dp[i] + abs(nodes[i] - nodes[j]))
for i in range(n):
    for j in range(k):
        dp[i+j] = min(dp[i+j], dp[i]+abs(nodes[i]-nodes[i+j]))
print(dp[n-1])


### FIXED CODE ###

inf = 10**9 + 7
n, k = map(int, input().split())

nodes = list(map(int, input().split()))
dp = [inf] * n

dp[0] = 0

for i in range(n):
    for j in range(i+1, min(i+k+1, n)):
        dp[j] = min(dp[j], dp[i] + abs(nodes[i] - nodes[j]))
# for i in range(n):
#     for j in range(1, min(k+1, n-i)):
#         dp[i+j] = min(dp[i+j], dp[i]+abs(nodes[i]-nodes[i+j]))
print(dp[n-1])
n = int(input())
 
prod = 1
for i in range(1,n+1):
    prod *= i
    ans = ans%(10**9+7)
print(ans)

### FIXED CODE ###

n=int(input())
ans=1
for i in range(1,n+1):
  ans*=i
  ans%=10**9+7
print(ans)
N, A, B = map(int, input().split())

ans = N // (A + B) * A
temp = N % (A + B)
if temp < A:
    ans += temp
else:
    ans += A
print(ans)

### FIXED CODE ###

S = input()

if len(set(S)) == 2:
    print("Yes")
else:
    print("No")
from statistics import median

n = input()
a = list(map(int, input().split()))

b = [v - (i + 1) for i, v in enumerate(a)]

median = int(median(b))

c = sum(abs(v - median) for v in b)

print(c)


### FIXED CODE ###

n = int(input())

if n % 2 == 0:
    print(n)
else:
    print(n * 2)
N = int(input())
x = list(input())[::-1]
print(x)
num = 0
nump = 0
numm = 0
pop_num = 0
for i in range(N):
    if x[i] == "1":
        pop_num += 1
for i in range(N):
    if x[i] == "1":
        num += pow(2,i,pop_num)
        num %= pop_num 
        nump += pow(2,i,pop_num+1)
        nump %= pop_num  + 1
        numm += pow(2,i,pop_num - 1)
        numm %= pop_num - 1



def popcnt(n):
    c = (n & 0x5555555555555555) + ((n>>1) & 0x5555555555555555)
    c = (c & 0x3333333333333333) + ((c>>2) & 0x3333333333333333)
    c = (c & 0x0f0f0f0f0f0f0f0f) + ((c>>4) & 0x0f0f0f0f0f0f0f0f)
    c = (c & 0x00ff00ff00ff00ff) + ((c>>8) & 0x00ff00ff00ff00ff)
    c = (c & 0x0000ffff0000ffff) + ((c>>16) & 0x0000ffff0000ffff)
    c = (c & 0x00000000ffffffff) + ((c>>32) & 0x00000000ffffffff)
    return c

x = x[::-1]
def calc(i,depth,n):
    if depth == 0:
        if x[i] == "1":
            tmp = numm
            tmp -= pow(2,N-i-1,pop_num-1)
            tmp %= (pop_num - 1)
            return calc(i,depth+1,tmp)
        else:
            tmp = nump
            tmp += pow(2,N-i-1,pop_num+1)
            tmp %= (pop_num + 1)
            return calc(i,depth+1,tmp)
    else:
        if n == 0: return depth
        return calc(i,depth+1, n % popcnt(n))
        

for i in range(N):
    exit()
    print(calc(i,0,0))



### FIXED CODE ###

N = int(input())
x = list(input())[::-1]
num = 0
nump = 0
numm = 0
pop_num = 0
for i in range(N):
        if x[i] == "1":
            pop_num += 1
for i in range(N):
    if x[i] == "1":
        num += pow(2,i,pop_num)
        num %= pop_num 
        nump += pow(2,i,pop_num+1)
        nump %= pop_num  + 1
        if pop_num-1 != 0:
            numm += pow(2,i,pop_num - 1)
            numm %= pop_num - 1



def popcnt(n):
    c = (n & 0x5555555555555555) + ((n>>1) & 0x5555555555555555)
    c = (c & 0x3333333333333333) + ((c>>2) & 0x3333333333333333)
    c = (c & 0x0f0f0f0f0f0f0f0f) + ((c>>4) & 0x0f0f0f0f0f0f0f0f)
    c = (c & 0x00ff00ff00ff00ff) + ((c>>8) & 0x00ff00ff00ff00ff)
    c = (c & 0x0000ffff0000ffff) + ((c>>16) & 0x0000ffff0000ffff)
    c = (c & 0x00000000ffffffff) + ((c>>32) & 0x00000000ffffffff)
    return c

x = x[::-1]
def calc(i,depth,n):
    if depth == 0:
        if x[i] == "1":
            tmp = numm
            if pop_num - 1 != 0:
                tmp -= pow(2,N-i-1,pop_num-1)
                tmp %= (pop_num - 1)
            else:
                return 0
            return calc(i,depth+1,tmp)
        else:
            tmp = nump
            tmp += pow(2,N-i-1,pop_num+1)
            tmp %= (pop_num + 1)
            return calc(i,depth+1,tmp)
    else:
        if n == 0: return depth
        return calc(i,depth+1, n % popcnt(n))
        

for i in range(N):
    print(calc(i,0,0))
S = list(input())
K = int(input())

#print(link_S)
#S = S.append(S[len(S)-1])
i = 0
sum = 1
total_sum = 0
sum_ketu = 0
while(1):
    if i == len(S)-1:
        if (S[i] == S[0] and S[0] != S[1]) or (S[i-1] != S[i] and S[0] == S[1]):
            if sum % 2 == 1:
                sum += 1
                sum_ketu = -1
        break
    if S[i] == S[i+1]:
     #   print("i is", i)
     #   print("S[i] is", S[i], "S[i+1] is", S[i+1])
        sum += 1
     #   print(sum)
        i += 1
    else:
        total_sum += sum // 2
        sum = 1
        i += 1
        
total_sum += sum // 2
#print(sum_ketu)
#print(total_sum)
print(total_sum * K + sum_ketu)



### FIXED CODE ###

S = list(input())
K = int(input())

if len(S) == 1:
    print( K // 2)
    exit()

count = 1
i = 0
sum = 0
while(1):
    if S[i] == S[i+1]:
        count += 1
        i += 1
    else:
        sum += count//2
        count = 1
        i += 1
    if i == len(S)-1:
        break

sum += count//2 #最後のカウントの加算

#print("check1",sum)

#先頭の連続数をカウント
j = 0 # リストカウント
a = 1 # 連続数カウント
while(1):
    if S[j] == S[j+1]:
        a += 1
        j += 1
    else:
        break
    if j == len(S) -1:
        break
#print("check")

#末尾の連続数をカウント
m = len(S)-1 # リストカウント
b = 1 # 連続数カウント
while(1):
    if S[m] == S[m-1]:
        m -= 1
        b += 1
    else:
        break
    if m == 0:
        break

#print("a is",a)
#print("b is",b)
#print("sum is", sum)
if a == len(S): #１文字のみで文字列構成の場合
    print((len(S)* K)//2)
elif S[len(S)-1] == S[0]:
    print( sum * K + ((a+b)//2 - a//2 - b //2 ) * ( K -1))
else:
    print( sum * K)
N=int(input())
result={}
s=[]
t=[]
for i in range(N):
  s.append(input())
  if s[i] in result.keys():
    result[s[i]]+=1
  else:
    result[s[i]]=1
M=int(input())
for j in range(M):
  t.append(input())
  if t[j] in result.keys():
    result[t[j]]-=1
print(max(k for k in result.values() if k > 0))

### FIXED CODE ###

N=int(input())
result={}
s=[]
t=[]
for i in range(N):
  s.append(input())
  if s[i] in result.keys():
    result[s[i]]+=1
  else:
    result[s[i]]=1
M=int(input())
for j in range(M):
  t.append(input())
  if t[j] in result.keys():
    result[t[j]]-=1
if max(result.values()) > 0:
  print(max(result.values()))
else:
  print(0)
# -*- coding: utf-8 -*-

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

dict_A = {}
for a in A:
    if a not in dict_A:
        dict_A[a] = 1
    else:
        dict_A[a] += 1

num_list = [[] for _ in range(n)]
for key in dict_A.keys():
    num_list[dict_A[key]].append(key)

ans = 0
count = len(dict_A.keys())
pointer = 1
while count > k:
    if len(num_list[pointer]) == 0:
        pointer += 1
        continue
    ans += pointer
    count -= 1
    del num_list[pointer][0]
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-

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

dict_A = {}
for a in A:
    if a not in dict_A:
        dict_A[a] = 1
    else:
        dict_A[a] += 1

if len(dict_A.keys()) <= k:
    print(0)
    exit()

sorted_A = sorted(dict_A.items(), key=lambda x: x[1])

ans = 0
for i in range(len(dict_A.keys())-k):
    ans += sorted_A[i][1]

print(ans)
import math

A, B = input().split()
A = int(A)
B = math.floor(B)
res = A * B
print(res)


### FIXED CODE ###

from decimal import Decimal, ROUND_FLOOR

A, B = input().split()
A = Decimal(A)
B = Decimal(B)
res = A * B
print(res.quantize(Decimal("1"), rounding=ROUND_FLOOR))
A,B,N = list(map(int, input().split()))
res = 0

for x in range(1,N+1):
    if A <= res:
        break
    else:
        res = int(A*x/B)- A* int(x/B)

print(res) 




### FIXED CODE ###

K = int(input())
A,B = input().split()
A = int(A)
B = int(B)

i = 1
while True:
    k = K*i
    if A <= k and k <= B:
        print("OK")
        break
    if B < k:
        print("NG")
        break
    i += 1
N = int(input())
a_li = list(map(int,input().split()))
     
cnt = 0
for i in a_li:
    while i % 2 == 0:
        cnt += 1
        i //= 2
        if i % 2 != 0:
            break
     
print(cnt)

### FIXED CODE ###

a, b = (int(i) for i in input().split())
if a > 8 or b > 8:
  print(':(')
else:
  print('Yay!')
s=input()
answer-0
counter=0
for i in range(len(s)-1,-1,-1):
  if s[i]=="B":
    answer += len(s)-i-1-counter
    counter += 1
print(answer)
  
    
    

### FIXED CODE ###

S = input()
ans = 0
count = 0
for i in range(len(S)-1, -1, -1):
    if S[i] == "B":
        ans += len(S)-i-1-count
        count += 1
 
print(ans)
m,n=map(int,input())
print(m*(m-1)+n*(n-1))

### FIXED CODE ###

m,n=map(int,input().split())
print(m*(m-1)//2+n*(n-1)//2)
n,k = map(int, input().split())
s = input()

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower
  else:
    b += s[i]
    
print(b)

### FIXED CODE ###

n,k = map(int, input().split())
s = input()

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower()
  else:
    b += s[i]
    
print(b)
n=int(input())
if n<1200:
  print("ABC")
elif:
  print("ARC")
else:
  print("AGC")

### FIXED CODE ###

n=int(input())
if n<1200:
  print("ABC")
elif n<2800:
  print("ARC")
else:
  print("AGC")
import math
h,w = map(int,input().split())
ans = 0

if h == 1 or w ==1:
  ans += 1

elif:
    #奇数行目+偶数行目
    ans += math.ceil(h/2)*math.ceil(w/2)+(h//2)*(w//2)
 
print(ans)

### FIXED CODE ###

import math
h,w = map(int,input().split())
ans = 0

if h == 1 or w ==1 :
  ans += 1

else:
    #奇数行目+偶数行目
    ans += math.ceil(h/2)*math.ceil(w/2)+(h//2)*(w//2)
 
print(ans)
N=int(input())
xyh=[list(map(int,input().split())) for i in range(N)]
MAX=100
for PosY in range(MAX+1):
    for PosX in range(MAX+1):
        needH=-1
        for i in range(N):
             if xyh[i][2]>0:
                tmp=xyh[i][2]+abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH==-1:
                    needH=tmp
                else:
                    if needH!=tmp:
                        needH=-2
                        break
        if needH==-2:
            continue
        for i in range(N):
            if xyh[i][2]==0:
                dist=abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH>dist:
                    needH=-2
                    break
        if needH==-2:
            continue
        print(PosX,PosY,needH)

### FIXED CODE ###

N=int(input())
if N==1:
    print('Hello World')
if N==2:
    A=int(input())
    B=int(input())
    print(A+B)
import sys

N=input()
A=map(int, sys.stdin.readline().split())
A.sort()

L=[]
for i in range(N-1):
	if i==0:
		next=A[i]-A[i+1]
		L.append( (A[i], A[i+1]) )

	else:
		if i==N-2:
			if A[i+1]<next:
				ans=next-A[i+1]
				L.append( (next,A[i+1]) )
			else:
				ans=A[i+1]-next
				L.append( (A[i+1],next) )
		else:
			L.append( (next, A[i+1]) )
			next=next-A[i+1]
else:
	print ans
	for x, y in L:
		print x,y



### FIXED CODE ###

import sys

N=input()
A=map(int, sys.stdin.readline().split())
A.sort()
min_A=A[0]
max_A=A[-1]

L=[]
for i in range(1,N-1):
	v=A[i]
	if v<0:
		L.append( (max_A, v) )
		max_A-=v
	else:
		L.append( (min_A, v) )
		min_A-=v
else:
	L.append( (max_A,min_A) )
	print max_A-min_A
	for x,y in L:
		print x,y
import sys
from io import StringIO
import unittest
import numpy as np


def resolve():
    N, L = map(int, input().split())
    taste = np.zeros(N)
    for i in range(N):
        taste[i] = L + i
    min_idx = np.argsort(np.abs(taste))[0]
    sum_taste = np.sum(taste) - taste[min_idx]
    print(np.int(sum_taste))
resolve()

### FIXED CODE ###

import sys
from io import StringIO
import unittest
import numpy as np


def resolve():
    N, L = map(int, input().split())
    taste = np.zeros(N)
    for i in range(N):
        taste[i] = L + i
    min_idx = np.argsort(np.abs(taste))[0]
    sum_taste = np.sum(taste) - taste[min_idx]
    print(np.int(sum_taste))

resolve()
from copy import deepcopy
n = int(input())
t = list(map(int,input().split()))
m = int(input())
p = []
x = []
for i in range(m):
    tmpp,tmpx = map(int,input().split())
    p.append(tmpp)
    x.append(tmpx)
for j in p:
    tmplist = deepcopy(t)
    tmplist[j-1] = x[j-1]
    print(sum(tmplist))

### FIXED CODE ###

from copy import deepcopy
n = int(input())
t = list(map(int,input().split()))
m = int(input())
p = []
x = []
for i in range(m):
    tmpp,tmpx = map(int,input().split())
    p.append(tmpp)
    x.append(tmpx)
for j in range(len(p)):
    tmplist = deepcopy(t)
    tmplist[p[j]-1] = x[j]
    print(sum(tmplist))
import numpy as np
from numba import njit
import sys

input = sys.stdin.readline

N = int(input())
H = np.array(input().split(), dtype=np.int64)

@njit
def main():
    Hdiff = np.diff(H)
    cnt = 0; ans = 0
    for h in Hdiff:
        if h <= 0:
            cnt += 1
        else:
            cnt = 0
        ans = max(ans, cnt)
    print(ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import numpy as np
#from numba import jit
import sys

input = sys.stdin.readline

N = int(input())
H = np.array(input().split(), dtype=np.int64)

#@jit(nopython=True)
def main():
    Hdiff = np.diff(H)
    cnt = 0; ans = 0
    for h in Hdiff:
        if h <= 0:
            cnt += 1
        else:
            cnt = 0
        ans = max(ans, cnt)
    print(ans)

if __name__ == "__main__":
    main()
# Atcoder 2019/10/19
"""
# A
A, B = map(int, input().split())

ans = A - 2 * B

if ans >= 0:
    print(ans)
else:
    print(0)
"""

"""
# B
import sys
n = int(input())
d = list(map(int, sys.stdin.readline().strip().split()))

ans = 0

for i in range(n - 1):
    for j in range(i + 1, n):
        ans += d[i] * d[j]

print(ans)
"""

"""
# C
n = int(input())
s = input()

count = 1

for i in range(len(s) - 1):
    if s[i] != s[i + 1]:
        count += 1

print(count)
"""

# D
import sys

def main():
    n = int(input())
    l = list(map(int, sys.stdin.readline().strip().split()))

    global big_ans
    big_ans = []

    def angle(l, count, ans, i, n):
        if len(ans) == 3:
            big_ans.append(ans)
            return ans

        if i == n:
            # print('i end')
            return

        if len(ans) + n - i < 3:
            return

        passa = ans.copy()
        angle(l, count, passa, i + 1, n)
        ans.append(l[i])
        passb = ans.copy()
        angle(l, count + 1, passb, i + 1, n)


    angle(l, 0, [], 0, len(l))

    ans_count = 0

    for i in big_ans:
        big = i.index(max(i))
        if sum(i) - 2 * i[big] > 0:
            ans_count += 1

    print(ans_count)


if __name__ == '__main__':
    main()




### FIXED CODE ###

import sys
import bisect

n = int(input())
l = list(map(int, sys.stdin.readline().strip().split()))

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

print(ans)
def gcd(a,b):
    return b





def lcm(a,b):
    return a


n=int(input())
t=[int(input()) for lop in range(n)]
ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t)
print(int(ans))

### FIXED CODE ###



a,b,c,d=[int(i) for i in input().strip().split(' ')]

'''
入力は他の人のを見た
'''

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)
K = int(input())
sunuke = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,199,299,399,499,599,699,799,899,999]
i = 0
while i < K:
  print(sunuke[i])
  i+=1

### FIXED CODE ###

#D問題
K=int(input())
keta=1
now=1
count=0

def sunuke(n):
    a=0
    for i in str(n):
        a+=int(i)
    return(n/a)

while count < K:
    if sunuke(now) <= sunuke(now+keta):
        print(now)
        now+=keta
        count+=1
    else:
        now+=9*keta
        keta*=10
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X):
  D=D+L[i]
  i=i+1
if X=0:
  print(1)
else:
  print(i)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 1
line = 0
for i in range(N):
    line += L[i]
    if line <= X:
        count += 1
print(count)
#!/usr/bin/env python3
# Christmas Eve Eve

N = int(input().strip())
i = 0
p = []
while i < N:
  pi = int(input().strip())
  p.append(pi)
  i += 1
p = sorted(p)
p[-1] = p[-1]/2
print(int(sum(p))

### FIXED CODE ###

#!/usr/bin/env python3
# Christmas Eve Eve

N = int(input().strip())
i = 0
p = []
while i < N:
  pi = int(input().strip())
  p.append(pi)
  i += 1
p = sorted(p)
p[-1] = p[-1]/2
print(int(sum(p)))
import math
N = int(input())
n = N
amari = 0
for i in range (len(str(N))):
  amari += n % 10
  n = math.floor(n / 10)
if amari = 1:
  print(10)
else:
  print(amari)

### FIXED CODE ###

import math
N = int(input())
n = N
amari = 0
for i in range (len(str(N))):
  amari += n % 10
  n = math.floor(n / 10)
if amari == 1:
  print(10)
else:
  print(amari)
import math
import sys
n = int(input())
s = int(input())

def f(b, n):
    if n == 0:
        return 0
    return f(b, n//b) + n % b

if s > n:
    print(-1)
    sys.exit(0)

sn = math.ceil(math.sqrt(n))
for i in range(2, sn):
    if f(i, n) == s:
        print(i)
        sys.exit(0)

for i in range(1, sn):
    if (n - s) % i == 0:
        b = (n-s)//i + 1
        if f(b + n%b, n) == s:
            print(b)
            sys.exit(0)
if s == n:
    print(n+1)
else:
    print(-1)


### FIXED CODE ###

import math
import sys

n = int(input())
s = int(input())

def f(b, n):
    if n == 0:
        return 0
    return f(b, n//b) + n % b

if s > n:
    print(-1)
    sys.exit(0)

sn = math.ceil(math.sqrt(n))
for i in range(2, sn+1):
    if f(i, n) == s:
        print(i)
        sys.exit(0)

ans = n + 1
for i in range(1, sn+1):
    if (n - s) % i == 0:
        b = (n-s)//i + 1
        if b >= 2 and f(b, b * i + n%b) == s:
            ans = min((ans, b))
if s == n:
    print(n+1)
elif ans < n + 1:
    print(ans)
else:
    print(-1)
n = input()
n = int(input())
a = list(map(int, input().split()))

count = 0
flag = True

while flag:
  for i in range(n):
    if a[i] %2 != 0:
      break
    else:
      a[i] = a[i]//2
    if flag == False:
      break
  count = count+1

print(count)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

count = 0
flag = True

while flag:
    for i in range(n):
        if a[i] % 2 != 0:
            flag = False

    if flag == False:
        break

    for i in range(n):
        a[i] //= 2
    count = count + 1
print(count)
A = list(int(input()))

if A[0] == 7 or A[1] == 7 or A[2] == 7:
  print('Yes')
  
else:
  print('No')

### FIXED CODE ###

A = list(map(int, input()))

if A[0] == 7 or A[1] == 7 or A[2] == 7:
  print('Yes')

else:
  print('No')
import math
n = int(input())
if n == 0:
    print(0)
if n == 1:
    print(0)
else:
    if n % 2 ==1:
        print(0)
    else:
        ans = 0
        l = 10
        while n>=l:
            ans += floor(n/(l))
            l *= 5
        print(ans)

### FIXED CODE ###

n = input()
m = len(n)
n = int(n)
if n%2==1:
    print(0)
else:
    if m==1:
        print(0)
    else:
        ans = 0
        i = 1
        while  True:
            ans_plus=n//(2*5**i)
            if ans_plus==0:
                break
            ans += ans_plus
            
            i += 1
        print(ans)
n=input()

a=list(map(int,input(),split()))

b=list(map(rfind('1')-1,a))

print(min(b))

### FIXED CODE ###

import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
S = input()
flag = False

for i in range(4):
    if S[i:i+2] == "AC"
        flag = True

print("Yes" if flag else "No")

### FIXED CODE ###

S = input()
flag = False

for i in range(4):
    if S[i:i+2] == "AC":
        flag = True

print("Yes" if flag else "No")