Harryxun/stf_run huggingface dataset:
a,b=map(int,input().split())
print(a*b,2*(a+b))

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,2*(a+b))
N, R = map(int, input().split())
print(R + 100*(10-N)) if n < 10 else print(R)

### FIXED CODE ###

N, R = map(int, input().split())
print(R + 100*(10-N)) if N < 10 else print(R)
s = input()
slen = len(s)

minRes = 10**6

for idx in range(2, slen):
	b = idx-2
	
	n = int(s[b:idx+1])
	
	tempRes = abs(n-753)
	
	minRes = min(tempRes, minRes)

print(minRes)
	


### FIXED CODE ###

s = input()
slen = len(s)

minRes = 10**6

for idx in range(2, slen):
	b = idx-2
	
	n = int(s[b:idx+1])
	
	tempRes = abs(n-753)
	
	minRes = min(tempRes, minRes)

print(minRes)
input = raw_input
range = xrange

n, m = map(int,input().split())
grid = [input() for i in range(n)]

use = [False]*n
cur = []
def backtrack(i, rem):
    if rem == 0: return check(cur)
    if use[i]: return backtrack(i+1, rem)
    if rem == 1:
        use[i] = True; cur.append(i)
        backtrack(i+1, 0)
        use[i] = False; cur.pop()
    use[i] = True; cur.append(i)
    for j in range(i+1, n):
        if use[j]: continue
        use[j] = True; cur.append(j)
        backtrack(i+1, rem-2)
        use[j] = False; cur.pop()
    use[i] = False; cur.pop()

middle_initial = (n%2 == 0)
from collections import Counter
def check(cur):
    P = cur[::2] + cur[1::2][::-1]
    cols = Counter((''.join(grid[P[i]][j] for i in range(n))) for j in range(m))
    middle_filled = middle_initial
    rem = n
    while rem:
        w = next(iter(cols))
        cols[w]-= 1; rem-= 1
        if cols[w] == 0: del cols[w]
        w2 = w[::-1]
        if w2 in cols:
            assert cols[w2]
            cols[w2]-= 1; rem-= 1
            if cols[w2] == 0: del cols[w2]
        elif w == w[::-1] and not middle_filled:
            middle_filled = True
        else: return False
    print("YES"); exit()

backtrack(0, n)
print("NO")

### FIXED CODE ###

input = raw_input
range = xrange

n, m = map(int,input().split())
grid = [input() for i in range(n)]

use = [False]*n
cur = []
def backtrack_even(i, rem, addwhat):
    if rem == 0:
        if addwhat != None: cur.append(addwhat)
        check(cur)
        if addwhat != None: cur.pop()
        return
    if use[i]: return backtrack_even(i+1, rem, addwhat)
    use[i] = True; cur.append(i)
    for j in range(i+1, n):
        if use[j]: continue
        use[j] = True; cur.append(j)
        backtrack_even(i+1, rem-2, addwhat)
        use[j] = False; cur.pop()
    use[i] = False; cur.pop()

def backtrack():
    if n%2 == 0: return backtrack_even(0, n, None)
    for i in range(n):
        use[i] = True
        backtrack_even((0 if i else 1), n-1, i)
        use[i] = False

middle_initial = (m%2 == 0)
from collections import Counter
def check(cur):
    P = cur[::2] + cur[1::2][::-1]
    cols = Counter((''.join(grid[P[i]][j] for i in range(n))) for j in range(m))
    #print(cur, P, cols)
    middle_filled = middle_initial
    rem = m
    while rem:
        w = next(iter(cols))
        cols[w]-= 1; rem-= 1
        if cols[w] == 0: del cols[w]
        w2 = w[::-1]
        if w2 in cols:
            assert cols[w2]
            cols[w2]-= 1; rem-= 1
            if cols[w2] == 0: del cols[w2]
        elif w == w[::-1] and not middle_filled:
            middle_filled = True
        else: return False
    print("YES"); exit()

backtrack()
print("NO")
import math

def slv(A, B):
    A, B = (A, B) if A > B else (B, A)
    
    s = A * B
    c = math.floor(math.sqrt(A * B))
    
    if A == B:
        return 2 * c - 2
    elif c * c < s:
        return 2 * c - 2
    elif c * (c - 1) < s:
        return 2 * c - 3

Q = int(input())
for q in range(Q):
    A, B = map(int, input().split())
    print(slv(A, B))

### FIXED CODE ###

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

lst.sort()

mini = lst[0]
av = lst[1]
max = lst[2]

d = max - av
ans1 = 0
mini += d
d2 = max - mini

if d2 % 2:
    d2 = (d2 + 1) // 2
    ans1 += 1

else:
    d2 = d2 // 2

ans1 += d + d2

ans2 = 0
mini = lst[0]
av = lst[1]
max = lst[2]

d = max - av

mini += d

d2 = max + 1 - mini

if d2 % 2:
    d2 = (d2 + 1) // 2
    ans2 += 1
else:
    d2 = d2 // 2

ans2 += d + d2 + 1

print(min(ans1, ans2))
W, H, x, y = map(int, input().split())

if W // x == 2 and H // y == 2:
    print("{} {}".format(W * H / 2, 1))
else:
    print("{} {}".format(W * H / 2, 0))

### FIXED CODE ###

W, H, x, y = map(int, input().split())

is_center = int(x * 2 == W and y * 2 == H)
min_sq = W * H / 2

print("{} {}".format(min_sq, is_center))
import math

A, B = map(float, input().split())
keta = int(math.log10(A))
A /= 10**keta

print(int(A*B*(10**keta)))


### FIXED CODE ###

import fractions
import math

A, B = map(fractions.Fraction, input().split())

print(int(math.floor(A*B)))
s = input()
print(s[0]+s.count()+s[-1])

### FIXED CODE ###

s = input()
print(s[0]+str(len(s)-2)+s[-1])
N = int(input())
A = list(map(int, input().split()))

mod = 7 + 10**9
for i in A:
	A[i] %= mod
for j in range(N-1): 
	for	k in range(j+1, N):
		t = A[j] * A[k] 
		ans += t

ans %= mod
print(ans)

### FIXED CODE ###

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

ans = 0
mod = 7 + 10**9

s = sum(A)
for i in range(N):
	s -= A[i]
	ans += s * A[i]
	ans %= mod

print(ans)
k = int(input())
a,b = map(int,input().split())
for i in range(a, b+1):
	if i % k == 0:
    	print("OK")
        exit()
print("NG")

### FIXED CODE ###

k = int(input())
a,b = map(int,input().split())
for i in range(a, b+1):
  if i % k == 0:
    print("OK")
    exit()
print("NG")
a,b,c = input().split()
e,f,g = input().split()
h,i,j = input().split()
print(a,f,j)

### FIXED CODE ###

a = input()
x = [a[i:i+1] for i in range(len(a))]
b = input()
y = [b[i:i+1] for i in range(len(b))]
c = input()
z = [c[i:i+1] for i in range(len(c))]
ans = x[0]+y[1]+z[2]
print(ans)
n,m=map(int,input().split())
printf((n-1)*(m-1))

### FIXED CODE ###

n,m=map(int,input().split())
print((n-1)*(m-1))
import math
 
a,b = map(int,input().split())
 
def lcm(x,y):
    return(x*y//(math.gcd(x,y)))
 
print(lcm(a,b))

### FIXED CODE ###

import fractions

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

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))
import sys
import time
def anscheck(x,y,d,e,f):
    print "%.3f %.3f %.3f %.3f %.3f"%(x,y,d,e,f)
    time.sleep(1)
    if d*x+e*y == f:
        # print "correct!"
        print "%.3f %.3f"%(x,y)
        return True
    else:
        # print "different"
        return False
for line in sys.stdin:
    a,b,c,d,e,f = map(float,line.split())
    i=0
    while True:
        if (a*i-c) % b ==0:
            x=i
            if a*i-c>0:
                y= -((a*i-c)/b)
            elif a*i-c<0:
                y= (a*i-c)/b
            else:
                y=0
            if anscheck(x,y,d,e,f):
                break
        # if b*i-c % a == 0:
        #     x=i
        #     if b*i>c:
        #         y= -(b*i-c)/a
        #     elif b*i<c:
        #         y= (b*i-c)/a
        #     else:
        #         pass
        #     anscheck(x,y,d,e,f)
        if (a*(-i)-c) % b ==0:
            x=-i
            if a*(-i)-c > 0:
                y= (a*(-i)-c)/b
            elif a*(-i)-c<0:
                y= -((a*(-i)-c)/b)
            else:
                y=0
            if anscheck(x,y,d,e,f):
                break
        # if b*(-i)-c % a ==0:
        #     x=-i
        #     if b*(-i)>c:
        #         y= -(b*(-i)-c)/a
        #     elif b*(-i)<c:
        #         y= (b*(-i)-c)/a
        #     else:
        #         pass
        #     anscheck(x,y,d,e,f)
        i+=1.0

### FIXED CODE ###

import sys
import time
#1.2 2.8 4.12 1.5 3.0 4.5
for line in sys.stdin:
    a1,b1,c1,a2,b2,c2 = map(float,line.split())
    i=0
    x = (c1*b2-c2*b1) / (a1*b2-a2*b1)
    y = (a1*c2-a2*c1) / (a1*b2-a2*b1)
    if "-0" in str(x):
        x = 0.0
    print "%.3f %.3f"%(x,y)
# coding: utf-8
# Your code here!
N=int(input())
S=list(map(int,input().split()))

S1=[]
for i in range(N):
    S1.append(S[i])
S1.sort()
chuouchi=S1[len(S1)//2]
chuouchi2=S1[len(S1)//2+1]
ans=10**15
ansj=0
for i in range(chuouchi-N//2-5,chuouchi-N//2+5):
    goukei=0
    for j in range(N):
        goukei+=abs(S[j]-(i+j+1))
        ansj=j
    if ans>goukei:
        ans=goukei
        
for i in range(chuouchi2-N//2-5,chuouchi2-N//2+5):
    goukei=0
    for j in range(N):
        goukei+=abs(S[j]-(i+j+1))
        ansj=j
    if ans>goukei:
        ans=goukei
        
        
print(ans)


### FIXED CODE ###

# coding: utf-8
# Your code here!
import statistics

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

S1=[]
for i in range(N):
    S1.append(S[i]-i)
S1.sort()
chuouchi=statistics.median_high(S1)
chuouchi2=statistics.median_low(S1)
chuouchi3=statistics.median(S1)
ans=10**20
ansj=0
A=chuouchi-4
B=chuouchi+4
C=chuouchi2-4
D=chuouchi2+4
E=int(chuouchi3)-4
F=int(chuouchi3)+4
for i in range(A,B):
    goukei=0
    for j in range(N):
        goukei+=abs(S[j]-(i+j+1))
        
    if ans>goukei:
        ans=goukei
        
for i in range(C,D):
    goukei=0
    for j in range(N):
        goukei+=abs(S[j]-(i+j+1))
        
    if ans>goukei:
        ans=goukei

for i in range(E,F):
    goukei=0
    for j in range(N):
        goukei+=abs(S[j]-(i+j+1))
        
    if ans>goukei:
        ans=goukei        
        
print(ans)
import math

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

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

print(lcm(a, b))

### FIXED CODE ###

A, B = map(int, input().split())
import fractions

print(int(A*B/fractions.gcd(A,B)))
s=set(map(int,input().split()))
if len(s)==2:
    print('Yes'):
else:
    print('No')

### FIXED CODE ###

# coding: utf-8
# Your code here!
s=set(map(int,input().split()))
if len(s)==2:
    print('Yes')
else:
    print('No')
from math import ceil
import numpy as np
N,K=map(int, input().split())
#サイコロを振る　１以上K未満→コイン　K以上ゲーム終了、す抜けのかち
#コイン　表なら２倍　裏なら０　０なったら負け
ans=max( (N-K+1),0) /N

#(K-1)/N
# M*(2**x)>=K M:サイコロの目
# x*log(2)>=log(K/M)
lim=min(K-1,N)
for i in range(1,lim+1):
    x=ceil(np.log(K/i)/np.log(2))
    ans+=(1/N)*((0.5)**x)
print(ans)

### FIXED CODE ###

from math import ceil
import numpy as np
N,K=map(int, input().split())
#サイコロを振る　１以上K未満→コイン　K以上ゲーム終了、す抜けのかち
#コイン　表なら２倍　裏なら０　０なったら負け
ans=max( (N-K+1),0) /N

#(K-1)/N
# M*(2**x)>=K M:サイコロの目
# x*log(2)>=log(K/M)
lim=min(K-1,N)
for i in range(1,lim+1):
    x=ceil(np.log(K/i)/np.log(2))
    ans+=(1/N)*((0.5)**x)
print(ans)
H, W = map(int, input().split())
board = [list(input()) for i in range(H)]

ans = board
dist = [(1, 1), (1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1)]

for i in range(H):
    for j in range(W):
        if board[i][j] == '#':
            continue
        count = 0
        for x, y in dist:
            now_x = i + x
            now_y = j + y
            if now_x > W or now_x < 0 or now_y > H or now_y < 0:
                continue
            if board[now_x][now_y] == '#':
                count += 1
        ans[i][j] = str(count)

for line in ans:
    print(''.join(line))


### FIXED CODE ###

import sys
def main():
    in1 = input()
    nums, length = in1.split(' ')
    nums= int(nums)
    length = int(length)
    bombs = []

    for i in range(nums):

        bombs.append(input())
    checked = [['']*length for i in range(nums)]
    for i in range(nums):
        for j in range(length):
            if bombs[i][j] == '#':
                checked[i][j] = '#'
            else:
                bombnum = 0
                if i != 0:
                    if j != 0:
                        if bombs[i-1][j-1] == '#':
                            bombnum += 1

                    if j != length -1:
                        if bombs[i-1][j+1] == '#':
                            bombnum += 1

                    if bombs[i-1][j] == '#':
                        bombnum += 1


                if j != 0:
                    if bombs[i][j-1] == '#':
                        bombnum += 1

                if j != length-1:
                    if bombs[i][j+1] == '#':
                        bombnum += 1


                if i != nums-1:
                    if j != 0:
                        if bombs[i+1][j-1] == '#':
                            bombnum += 1

                    if j != length -1:
                        if bombs[i+1][j+1] == '#':
                            bombnum += 1

                    if bombs[i+1][j] == '#':
                        bombnum += 1

                checked[i][j] = bombnum
    for i in checked:
        for j in i:
            print(j, end = '')
        print('')
if __name__ == '__main__':
    main()
n = int(input())
taste_list = list(map(int, input().split()))
taste_sum = 0
for i in range(n):
  for j in range(n):
    taste = taste_list[i]*taste_list[j]
    taste_sum += taste
for i in range(len(taste_list)):
  taste_sum -= taste_list[i]**2
print(taste_sum/2)

### FIXED CODE ###

a, b = input().split()
num_a = int(a)
num_b = int(b)
dif = num_a - num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)
a = int(input)

print(a+a**2+a**3)

### FIXED CODE ###

a = int(input())
print(a+a**2+a**3)
MOD = 10 ** 9 + 7

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


def permutation(n,r):
    import math
    return math.factorial(n)//math.factorial(n-r)

cal_lst = [None] * (K)
def calc(n):
    if cal_lst[n] != None:
        return cal_lst[n]
    if n == 0:
        cal_lst[n] = 1
        return cal_lst[n]
    if n > K-2:
        return 0;
    cal_lst[n] = permutation(K-2, n)
    return cal_lst[n]

lst = [0] * (N)
children = []
for _ in range(N-1):
    a, b = map(int, input().split())
    if a > b:
        a, b = b, a
    #子の数を記録
    lst[a-1] += 1
    #親が1のもののリスト
    if a-1 == 0:
        children += [b-1]

# lst2.sort()
# print (lst)
# print (lst2)

ans = K
for i in range(N):
    if i == 0:
        ans *= permutation(K-1, lst[i])
    else:
        # if lst[i] in children:
        #     ans *= permutation(K-1, lst[i])
        ans *= calc(lst[i])
    ans = ans%MOD
print (ans)

### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7

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


def permutation(n,r):
    import math
    return math.factorial(n)//math.factorial(n-r)

cal_lst = [None] * (K)
def calc(n):
    if cal_lst[n] != None:
        return cal_lst[n]
    if n == 0:
        cal_lst[n] = 1
        return cal_lst[n]
    if n > K-2:
        return 0;
    cal_lst[n] = permutation(K-2, n)
    return cal_lst[n]

g = [[] for _ in range(N+1)]
for _ in range(N-1):
    a, b = map(int, input().split())
    g[a] += [b]
    g[b] += [a]

# print (g)

s = 1
Q = deque([s])
ans = K
searced = [0] * (N+1)
searced[s] = 1
cand = K-1
while len(Q) != 0:
    tmp = 1
    v = Q.popleft()
    for i in g[v]:
        if searced[i] == 1:
            continue
        else:
            searced[i] = 1
            tmp = (tmp * cand) % MOD
            cand -= 1
            Q.append(i)
    ans = (ans * tmp) % MOD
    cand = K-2
print (ans % MOD)
from collections import Counter
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
b = Counter(a_list)
b_list = sorted(b.items(), key=lambda x:x[1])
for i in b_list.values[:k]:
    d = sum(i)
print(n-i)

### FIXED CODE ###

import collections
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
b = collections.Counter(a_list)
d = b.most_common()[k:]
sum = 0
for i in d:
    sum += i[1]
print(sum)
S = input()
def div(strings):
    if len(strings) == 0:
        return 0
    elif len(strings) == 1:
        return 1
    elif len(strings) == 2:
        if S[0] == S[1]:
            return 1
        else:
            return 2
    elif strings[len(strings)-1] != strings[len(strings)-2]:
        return div(strings[0:len(strings)-1]) + 1
    else:
        return div(strings[0:len(strings)-3]) + 2
print(div(S))

### FIXED CODE ###

S = input()
count = 1
i = 0
initial_length = len(S)-1
l = S[0]
S = S + '&' + '%'
while i < initial_length:
    if l == S[i+1]:
        if i == initial_length-1:
            break
        elif S[i+2] == S[i+3]:
            l = S[i+3]
            i += 3
            count += 1
        else:
            l = S[i+1:i+3]
            i += 2
    else:
        l = S[i+1]
        i += 1
    count += 1
print(count)
n, m = map(int, input().split())
dmg = []
cost = []

for i in range(m):
    a, b = map(int, input().split())
    dmg.append(a)
    cost.append(b)

inf = 10**9
dp = [inf] * 10001
dp[0] = 0

for i in range(m):
    for j in range(n):
        if dp[j] != inf:
            dp[j + dmg[i]] = min(dp[j + dmg[i]], dp[j] + cost[i])
print(min(dp[n:]))


### FIXED CODE ###

n, m = map(int, input().split())
dmg = []
cost = []

for i in range(m):
    a, b = map(int, input().split())
    dmg.append(a)
    cost.append(b)

inf = 10**9
dp = [inf] * 30000
dp[0] = 0

for i in range(m):
    for j in range(n):
        if dp[j] != inf:
            dp[j + dmg[i]] = min(dp[j + dmg[i]], dp[j] + cost[i])
print(min(dp[n:]))
import sys
input=sys.stdin.readline
N=int(input())
C=[int(input())]
for i in range(N-1)
  tmp=int(input())
  if tmp != C[-1]:
    C.append(tmp)
  
import collections
table=collections.defaultdict(list)
N=len(C)
dp=[0]*(N+1)
dp[N]=1
mod=10**9 + 7
for i,x in enumerate(C[::-1]):
  dp[N-1-i]=dp[N-i]
  for y in table[x]:
    dp[N-1-i]+=dp[y+1]
  dp[N-1-i]%=mod
  table[x].append(N-1-i)

print(dp[0])


### FIXED CODE ###

import sys
input=sys.stdin.readline
N=int(input())
C=[int(input())]
for i in range(N-1):
  tmp=int(input())
  if tmp != C[-1]:
    C.append(tmp)
  
import collections
table=collections.defaultdict(int)
N=len(C)
dp=[0]*(N+1)
dp[N]=1
mod=10**9 + 7
for i,x in enumerate(C[::-1]):
  dp[N-1-i]=dp[N-i] + table[x] 
  dp[N-1-i]%=mod
  table[x]+=dp[N-i]
print(dp[0])
n,m = map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
t=0

for i in range(m):
    a[0]=a[0]//2
    t=a[0]
    
    if n>1:
        for j in range(m):
            if a[j]<a[j+1]:
                a[j]=a[j+1]
                a[j+1]=t
            else:
                break
    
print(sum(a))

### FIXED CODE ###

import heapq
 
N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)
 
print(-sum(A))
s=map(int, input().split())
print("Yes" if s[0]==s[-1] else "No")

### FIXED CODE ###

s= input()
print("Yes" if s[0]==s[-1] else "No")
n=int(iput())
a=input()
st=set(a)
ans='Yes'
for i in range(n-1):
    s=input()
    if a[-1]!=s[0]:
        ans='No'
    st.add(s)
    a=s
if len(st)<n:
    ans='No'
print(ans)

### FIXED CODE ###

n=int(input())
a=input()
st=set()
st.add(a)
ans='Yes'
for i in range(n-1):
    s=input()
    st.add(s)
    if a[-1]!=s[0]:
        ans='No'
    a=s
if len(st)<n:
    ans='No'
print(ans)
def modpow(a,n):
    if n==0:
        return 1
    elif n==1:
        return a%mod
    elif n%2==0:
        return (modpow(a,n/2)**2)%mod
    else:
        return (a*modpow(a,n-1))%mod

def modfact(l,r):
    fact=1
    for i in range(l-r+1):
        fact=fact*(r+i)%mod
    return fact

def comb(n,x):
    S=modfact(n,n-x+1)
    fact=modfact(x,1)
    T=modpow(fact,mod-2)
    print(S,fact,T,S*T%mod)
    return S*T%mod

n,a,b=map(int,input().split())
fact=modpow(2,n)
ans=fact-1-comb(n,a)-comb(n,b)
while ans<0:
    ans+=mod
print(ans)

### FIXED CODE ###

mod=10**9+7

def modpow(a,n):
    if n==0:
        return 1
    elif n==1:
        return a%mod
    elif n%2==0:
        return (modpow(a,n/2)**2)%mod
    else:
        return (a*modpow(a,n-1))%mod

def modfact(l,r):
    fact=1
    for i in range(l-r+1):
        fact=fact*(r+i)%mod
    return fact

def comb(n,x):
    S=modfact(n,n-x+1)
    fact=modfact(x,1)
    T=modpow(fact,mod-2)
    return S*T%mod

n,a,b=map(int,input().split())
fact=modpow(2,n)
ans=fact-1-comb(n,a)-comb(n,b)
while ans<0:
    ans+=mod
print(ans)
import math
n = int(input())
d = list(map(int,input().split()))
MOD = 998244353
s = list(set(d))
s.sort()

cnt = []
for num in s:
  cnt += [d.count(num)]
#print(cnt)

ans = 1
for c in cnt:
  if c != 1:
    ans *= math.factorial(c)
    
ans *= cnt[1]
print(ans%MOD)

### FIXED CODE ###

import collections
 
n = int(input())
d = list(map(int,input().split()))
MOD = 998244353
#頂点1が0でないとだめ
if d[0]!=0:
  print(0)
  exit()
  
#同じ長さの位置に何個頂点があるか
cnt = dict(collections.Counter(d))
#頂点1だけが0じゃないとだめ
if cnt[0]==1:
  m = max(cnt)
  #一番大きい数字までにちゃんとすべての数字が揃ってないとだめ
  for i in range(m):
    if i not in cnt:
      print(0)
      exit()
  ans = 1
  for i in range(m):
    val_1 = cnt[i]
    val_2 = cnt[i+1]
    ans *= (val_1**val_2)%MOD
 
  print(ans%MOD)
else:
  print(0)
n = int(input())
l = list(map(int, input().split()))

if l.count(max(l)) >= 2:
    print("No")
    break
elif max(l) < sum(l) - max(l):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if max(l) < sum(l)-max(l):
    print("Yes")
else:
    print("No")
# AOJ ITP1_8_C

def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    counts = []
    for i in range(26): counts.append(0)

    while(string = input()):
        for c in string:
            if 97 <= ord(c) <= 122:
                counts[ord(c) - 97] += 1
            elif 65 <= ord(c) <= 90:
                counts[ord(c) - 65] += 1

    # 結果を出力。
    for i in range(26):
        print(chr(97 + i) + " : " + str(counts[i]))

if __name__ == "__main__":
    main()

# Accepted.



### FIXED CODE ###

# AOJ ITP1_8_C

import sys

def main():
    counts = []
    for i in range(26): counts.append(0)

    lines = sys.stdin.readlines()

    for i in range(len(lines)):
        string = lines[i]
        for k in range(len(string)):
            c = string[k]
            if 97 <= ord(c) <= 122:
                counts[ord(c) - 97] += 1
            elif 65 <= ord(c) <= 90:
                counts[ord(c) - 65] += 1

    # 結果を出力。
    for i in range(26):
        print(chr(97 + i) + " : " + str(counts[i]))

if __name__ == "__main__":
    main()

# Accepted.
a = int(input())
b = int(input())
 
if a >= 13:
  print(b)
elif a >= 6 and a <= 12:
  print(b/2)
else:
  print(0)

### FIXED CODE ###

a,b = map(int, input().split())
 
ans=0
if a <= 5:
	ans = 0
elif a >= 6 and a<=12:
	ans = b/2
else:
	ans = b
 
print(int(ans))
#!/usr/bin/env python
# -*- coding:utf-8 -*-

# http://arc078.contest.atcoder.jp/tasks/arc078_a

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

sum_num = sum(a)
current_sum = 0
min_diff = float('inf')
for i in range(0, N - 1):
    current_sum += a[i]
    min_diff = min(min_diff, abs(current_sum - (sum_num - current_sum)))
print(min_diff)


### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
sum_num = sum(a)
current_sum = 0
min_diff = float('inf')
for i in range(0, N - 1):
    current_sum += a[i]
    min_diff = min(min_diff, abs(current_sum - (sum_num - current_sum)))
print(min_diff)
n = int(input())
s = input()

print(s.count("ABC")

### FIXED CODE ###

n = int(input())
s= input()
print(s.count("ABC"))
import numpy as np
a = np.array(map(int, raw_input().split()))

### FIXED CODE ###

n, m = map(int, raw_input().split())
 
a = [[0]*m for i in xrange(n)]
 
b = [0]*m
 
for i in xrange(n):
    tmp = map(int, raw_input().split())
    for j in xrange(m):
        a[i][j] = tmp[j]
for i in xrange(m):
    b[i] = input()
for i in xrange(n):
    tmp = 0
    for j in xrange(m):
        tmp += a[i][j] * b[j]
    print tmp
from math import ceil


def main():
    length, sum_num, subarray_sum = map(int, input().split())
    base_length = ceil(length / sum_num)
    base_array = [subarray_sum]
    base_array += [10 ** 9 if subarray_sum < 10 ** 9 else 1] * (base_length - 1)
    print(" ".join(map(str, (base_array * (length // base_length + 1))[:length])))


if __name__ == '__main__':
    main()



### FIXED CODE ###

def main():
    length, sum_num, subarray_sum = map(int, input().split())
    answer = [subarray_sum] * sum_num
    if subarray_sum == 10 ** 9:
        answer += [1] * (length - sum_num)
    else:
        answer += [subarray_sum + 1] * (length - sum_num)
    print(" ".join(map(str, answer)))


if __name__ == '__main__':
    main()
n = int(input())
a = list(map(int, input().split()))

for i in a:
  count += bin(i).rfind("1") - 1

  print(count)

### FIXED CODE ###

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

count = 0
for i in a:
  count += len(bin(i)) - bin(i).rfind("1") - 1

print(count)