Harryxun/stf_run huggingface dataset:
import numpy as np
import math
 

xyi = map(int,input().split())
xy = np.array(list(xyi))

x = xy[0]
y = xy[1]
n = 2 * x - y
m = -x + 2 *y

if not n%3 == 0:
    print(0)
else:
    n = int(n/3)
    m = int(m/3)
    cmb = math.factorial(n+m)//math.factorial(n)
    ans = cmb % (10**9 +7)
    print(ans)

### FIXED CODE ###

import numpy as np
 
def calucurate_circle(r):
    S = np.pi * r ** 2
    return S
 
def mulitipulicity(r):
    n = r**2
    n = int(n)
    return n

r = float(input())
print(mulitipulicity(r))
import collections
n = input()
s = [input() for _ in range(n)]
s = collections.Counter(s)
m = max(s.values())

a = []
for d in s.items():
    if d[1] == m:
        a.append(d[0])
for s in a:
    print(s)


### FIXED CODE ###

from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
s = Counter(s)
m = max(s.values())

a = []
for d in s.items():
    if d[1] == m:
        a.append(d[0])
for s in sorted(a):
    print(s)
A, B, T = int(x) for x in input().split()

print((T//A)*B)

### FIXED CODE ###

A, B, T = (int(x) for x in input().split())
 
print((T//A)*B)
A, op, B = map(str, input().split())

if op == '+':
    print(int(A) + int(B))
if op == '-':
    print(int(A)) - int(B)

### FIXED CODE ###

A, op, B = map(str, input().split())

if op == '+':
    print(int(A) + int(B))
if op == '-':
    print(int(A) - int(B))
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# 文字列の入力
X = input()
one = 0
intX = 0
bitcount = 1
for i in reversed(range(len(X))):
    if X[i] == '1':
        one += 1
        intX += bitcount
    bitcount *= 2
hi = one + 1
lo = one - 1
hirembase = intX % hi
lorembase = intX % lo
# print(intX)
# print(hi)
# print(lo)
# print(hirembase)
# print(lorembase)
bo = []
for i in range(200010):
    num = 0
    while i != 0:
        bit = bin(i)
        bitnum = 0
        for j in range(len(bit)):
            if j == 0 or j == 1:
                continue
            if bit[j] == '1':
                bitnum += 1
        i = i % bitnum
        num += 1
    bo.append(num)
ans = []
hirem = 1
lorem = 1
for i in reversed(range(len(X))):
    if X[i] == '0':
        num = (hirembase + hirem + hi) % hi
        ans.append(bo[num] + 1)
    else:
        if bitcount == 1:
            ans.append(0)
        else:
            num = (lorembase - lorem + lo) % lo
            ans.append(bo[num] + 1)
    hirem = (hirem * 2) % hi
    lorem = (lorem * 2) % lo
# print(ans)
# 出力
for i in reversed(range(len(ans))):
    print(ans[i])

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# 文字列の入力
X = input()
one = 0
intX = 0
bitnow = 1
for i in reversed(range(len(X))):
    if X[i] == '1':
        one += 1
        intX += bitnow
    bitnow *= 2
hi = one + 1
lo = one - 1
hirembase = intX % hi
lorembase = 0
if lo != 0:
    lorembase = intX % lo
# print(intX)
# print(hi)
# print(lo)
# print(hirembase)
# print(lorembase)
bo = []
for i in range(200010):
    num = 0
    while i != 0:
        bit = bin(i)
        bitnum = 0
        for j in range(len(bit)):
            if j == 0 or j == 1:
                continue
            if bit[j] == '1':
                bitnum += 1
        i = i % bitnum
        num += 1
    bo.append(num)
ans = []
hirem = 1
lorem = 1
for i in reversed(range(len(X))):
    if X[i] == '0':
        num = (hirembase + hirem + hi) % hi
        ans.append(bo[num] + 1)
    else:
        if one == 1:
            ans.append(0)
        else:
            num = (lorembase - lorem + lo) % lo
            ans.append(bo[num] + 1)
    hirem = (hirem * 2) % hi
    if one != 1:
        lorem = (lorem * 2) % lo
# print(ans)
# 出力
for i in reversed(range(len(ans))):
    print(ans[i])
n=int(input())
a_list=list(map(int,input().split()))
import math
answer=a_list[0]
for i in range(1,n):
    answer=math.gcd(answer,a_list[i])
print(answer)


### FIXED CODE ###

n=int(input())
a_list=list(map(int,input().split()))
import fractions
answer=a_list[0]
for i in range(1,n):
    answer=fractions.gcd(answer,a_list[i])
print(answer)
long = int(input())
p = input()
plng = []
pstr = p.split(" ")
n = 0

for i in range(long):
    plng.append(int(pstr[i]))


for i in range(long-2):
    three = [plng[i],plng[i+1],plng[i+2]]
    three.sort()

    if three[1] == plng[i + 1]:
     n = n +　1

print(n)


### FIXED CODE ###

long = int(input())
p = input()
plng = []
pstr = p.split(" ")
n = 0

for i in range(long):
    plng.append(int(pstr[i]))



for i in range(long-2):
    three = [plng[i],plng[i+1],plng[i+2]]
    three.sort()

    if three[1] == plng[i + 1]:
     n = n + 1

print(n)
while True:
 m,f,r = map(int, raw_input().split())
 m+f = s
 if m==-1 and f==-1 and r ==-1 : break
 elif m==-1 or f==-1 or r<30 : g=4
 elif 30 <= s and s <50 :
      if r <= 50: g=2
      else g=3
 elif 50 <=s and s <65 : g=2
 elif 65 <=s and s<70 : g=1
 else: g=0
 print 'ABCDF'[g]



### FIXED CODE ###


while True:
    m,f,r = map(int, raw_input().split())
    s = m + f
    if m == -1 and f == -1 and r == -1: break
    elif m == -1 or f == -1 or s < 30: g=5
    elif 30 <= s and s < 50:
        if r >= 50: g=2
        else: g=3
    elif 50 <= s and s < 65: g=2
    elif 65 <= s and s < 80: g=1
    else: g=0
    print 'ABCDEF'[g]
import math

def antidiv(x,l,c,d):
    if x == l:
        return l - (l // c) - (l // d) + 1
    else:
        return x - (x // c) - (x // d) 

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

l = (c*d)//math.gcd(c,d)


aq = a // l
ar = a % l
bq = b // l
br = b % l

qq = bq - aq - 1
r1 = antidiv(l,l,c,d) - antidiv(ar-1,l,c,d)
r2 = antidiv(br,l,c,d)

ans = qq * antidiv(l,l,c,d) + r1 + r2

print(ans)


### FIXED CODE ###

import fractions

def antidiv(x,l,c,d):
    if x == l or x < 0:
        return l - (l // c) - (l // d) + 1
    else:
        return x - (x // c) - (x // d) 

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

l = (c*d)//fractions.gcd(c,d)


aq = a // l
ar = a % l
bq = b // l
br = b % l
#print(br)

qq = bq - aq - 1
r1 = antidiv(l,l,c,d) - antidiv(ar-1,l,c,d)
r2 = antidiv(br,l,c,d)

if ar!=0:
    ans = qq * antidiv(l,l,c,d) + r1 + r2
else:
    ans = (qq+1) * antidiv(l,l,c,d) + r1 + r2


print(ans)
import math
N = int(input())
A = [int(_) for _ in input().split()]


class SegmentTree():
    def m(self, v1, v2):  # ***monoid***
        return math.gcd(v1, v2)

    def __init__(self, array):
        m = self.m
        e = self.e = 0  # ***identity element***
        size = self.size = 10**6  # ***limit for array size***
        n = self.n = len(array)
        dat = self.dat = [e] * n + array + [e] * (2 * size - 2 * n)
        for i in range(n - 1, 0, -1):  # build
            dat[i] = m(dat[i << 1], dat[i << 1 | 1])

    def modify(self, p, v):  # set value at position p (0-indexed)
        m, n, dat = self.m, self.n, self.dat
        p += n
        dat[p] = v
        while p > 1:
            dat[p >> 1] = m(dat[p], dat[p ^ 1])
            p >>= 1

    def query(self, l, r):  # result on interval [l, r) (0-indexed)
        m, e, n, dat = self.m, self.e, self.n, self.dat
        res = e
        l += n
        r += n
        while l < r:
            if l & 1:
                res = m(res, dat[l])
                l += 1
            if r & 1:
                r -= 1
                res = m(res, dat[r])
            l >>= 1
            r >>= 1
        return res


ST = SegmentTree(A)
ans = 0
for i, a in enumerate(A):
    ST.modify(i, ST.e)
    ans = max(ans, ST.query(0, N))
    ST.modify(i, a)
print(ans)


### FIXED CODE ###

import itertools
N = int(input())
A = [int(_) for _ in input().split()]
gcd = lambda x, y: gcd(y, x % y) if x % y else y
L = list(itertools.accumulate(A, func=gcd))
R = list(itertools.accumulate(A[::-1], func=gcd))[::-1]
ans = max(R[1], L[-2])
for i in range(1, N - 1):
    ans = max(ans, gcd(L[i - 1], R[i + 1]))
print(ans)
# https://img.atcoder.jp/abc125/editorial.pdf
from typing import List

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

aa = list(reversed(A))

cnt = 0
for i in range(0,N):
    if aa[i] == min(aa[i:]):
        cnt += 1
print(cnt)



### FIXED CODE ###

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

m = A[0]
cnt = 1
for i in range(1,N):
    m = min(m, A[i])
    if A[i] <= m:
        cnt += 1
print(cnt)
n=int(input())
TREE=[[] for _ in range(n)]
for i in range(n-1):
    a,b,c=map(int,input().split())
    a-=1
    b-=1
    TREE[a].append([b,c])
    TREE[b].append([a,c])
q,k=map(int,input().split())
k-=1
depth=[0]*n
visited=[False for _ in range(n)]

def DFS(s,d):
    depth[s]=d
    visited[s]=True
    for i in TREE[s]:
        if not visited[i[0]]:
            DFS(i[0],d+i[1])
    return

DFS(k,0)
for _ in range(q):
    start,goal=map(int,input().split())
    print(depth[start-1]+depth[goal-1])

### FIXED CODE ###

import heapq
import itertools
n=int(input())
edges=[[] for _ in range(n)]
for _ in range(n-1):
    a,b,c=map(int, input().split())
    a,b=a-1,b-1
    edges[a].append((b,c))
    edges[b].append((a,c))

def dijkstra(x,route):
    d=[float('inf')]*n
    d[x]=0
    visited={x}
    hq=[(0,x)]
    while hq:
        u=heapq.heappop(hq)[1]
        visited.add(u)
        for node,cost in route[u]:
            if (node not in visited) and d[node]>d[u]+cost:
                d[node]=d[u]+cost
                heapq.heappush(hq,(d[node],node))
    return d
q,k=map(int,input().split())
k-=1
dist=dijkstra(k,edges)
for _ in range(q):
    start,goal=map(int,input().split())
    print(dist[start-1]+dist[goal-1])
import math
N = int(input())
A = sorted((int(i) for i in input().split()), reverse=True)

k = 2**int(math.log(A[0], 2) + 1)

def f(A, k):
    if len(A) == 1:
        return 0

    v = A[0]

    while k >= 2*v:
        k //= 2
    w = k - v

    if w in A[1:]:
        print(k, "=", v, "+", w)
        A.remove(w)
        r = 1
    else:
        r = 0

    return r + f(A[1:], k)
print(f(A, k))

### FIXED CODE ###

import math
from collections import defaultdict
N = int(input())
A = sorted(int(i) for i in input().split())

d = defaultdict(lambda: 0)
for i in A:
    d[i] += 1

c = 0
for k in sorted(d.keys(), reverse=True):
    l = 2**int(math.log(k, 2) + 1) - k
    v = d[k]
    if k == l:
        c += v // 2
    elif l in d:
        w = d[l]
        if v > w:
            c += w
            d[l] = 0
        else:
            c += v
            d[l] = w-v
print(c)
N,X = map(int,input().split())

"""
　　レベルnの層数：a_0 = 1 , a_n = 2*a_(n-1)+3
レベルnのパティ数：b_0 = 1 , b_n = 2*b_(n-1)+1
"""
def thickness(n):
    if n == 0:
        return 1
    else:
        return 2*thickness(n-1)+3

def patty(n):
    if n == 0:
        return 1
    else:
        return 2*patty(n-1)+1

def ans(n,x):
    if x == 1:
        return 0
    if 1 < x <= thickness(n-1)+1:
        return ans(n-1,x-1)
    if x == thickness(n-1) + 2:
        return patty(n-1) + 1
    if thickness(n-1) + 2 < x < 2 * thickness(n) + 2:
        return patty(n-1) + 1 + ans(n-1,x-2-thickness(n-1))
    if x == thickness(n-1) + 3:
        return 2 * patty(n-1) + 1

print(ans(N,X))


### FIXED CODE ###

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

"""
　　レベルnの層数：a_0 = 1 , a_n = 2*a_(n-1)+3
レベルnのパティ数：b_0 = 1 , b_n = 2*b_(n-1)+1
"""

def thickness(n):
    if n == 0:
        return 1
    else:
        return 2 * thickness(n-1) + 3

def patty(n):
    if n == 0:
        return 1
    else:
        return 2 * patty(n-1) + 1

def ans(n,x):
    if n == 0:
        return 1
    else:
        if x == 1:
            return 0
        if 1 < x <= thickness(n-1)+1:
            return ans(n-1,x-1)
        if x == thickness(n-1) + 2:
            return patty(n-1) + 1
        if thickness(n-1) + 2 < x <= 2 * thickness(n-1) + 2:
            return patty(n-1) + 1 + ans(n-1,x-2-thickness(n-1))
        if x == 2 * thickness(n-1) + 3:
            return 2 * patty(n-1) + 1

print(ans(N,X))
user_input = int(input().split())
five = 0
seven = 0
for i in len(user_input):
    if user_input[i] == 5:
        five += 1
    elif user_input[i] == 7:
        seven += 1

if five == 2 and seven == 1:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
a, b, c = map(int, input().split())
# カウンタのクリア
five_count = 0
seven_count = 0
# 5,7,5を判定
def setsu_check(x):
	global five_count, seven_count
	if x == 5:
		five_count+=1
	elif x == 7:
		seven_count+=1
# 判定関数のCALL
setsu_check(a)
setsu_check(b)
setsu_check(c)
if five_count == 2 and seven_count == 1:
	print("YES")
else:
	print("NO")
a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
l=sorted(set(l))
print(*l,sep='\n')

### FIXED CODE ###

A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)
N, K = map(int, input().split())
*h, = map(int, input().split())
a = [abs(h[0] - h[k]) for k in range(K)]
for n in range(N - K):
    a = a[1:] + [min([a[k] + abs(h[n + k] - h[n + K]) for k in range(K)])]
print(a[K - 1])


### FIXED CODE ###

N, K = map(int, input().split())
K = min(N, K)
*h, = map(int, input().split())
a = [abs(h[0] - h[k]) for k in range(K)]
for n in range(N - K):
    a = a[1:] + [min([a[k] + abs(h[n + k] - h[n + K]) for k in range(K)])]
print(a[K - 1])
def exists(value,n,ms,cs):
    if (len(value) != n):
        return False
    if not all([value[i-1] == c for i,c in zip(ms,cs)]):
        return False
    return True
def unzip(li):
    return list(map(list, zip(*li)))
n,m = [int(e) for e in input().split()]
m = [input().split() for e in range(m)]
ms,cs = unzip(m)
ms = [int(e) for e in ms]
result = -1
for i in range(1000):
    if exists(str(i),n,ms,cs):
        result = i
        break
print(result)

### FIXED CODE ###

n,m = map(int,input().split())
sc = [[i for i in map(int,input().split())] for j in range(m)]
start = 0
goal = 0
if n==1:
  start = 0
  goal = 9
elif n==2:
  start = 10
  goal = 99
elif n==3:
  start = 100
  goal = 999

flag = 1
ans = -1
for num in range(start,goal+1):
  flag = 1
  for i in range(m):
    if str(num)[sc[i][0]-1] != str(sc[i][1]): #両辺ともちゃんとstrで変換
      flag = 0
  if flag == 1:
    ans = num
    break

print(ans)
a = input().rstrip()
ans = a % 1000
print(ans)

### FIXED CODE ###

a = input().rstrip()
b = int(a) % 1000
if b == 0:
  ans = 0
else :
  ans = 1000 - b
print(ans)
# -*- coding: utf-8 -*-

input()
s = set(input().split())
input()
t = set(input().split())
print(int(s & t))


### FIXED CODE ###

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

input()
s = set(input().split())
input()
t = set(input().split())
print(len(s & t))
s = input()

count = 700

for i in range(s):
  if i == "o":
    count += 100
    
print(count)


### FIXED CODE ###

s = input()

count = 700

for i in s:
  if i == "o":
    count += 100
    
print(count)
from sys import stdin 
a = [0]
n = int(stdin.readline())
for _ in xrange(n):
 a.append(int(stdin.readline())
ans = -1
cur = 0
x = 1
s = set()
while True:
 if x in s:
  break
 if x==2:
  ans = cur
  break
 s.add(x)
 cur+=1
 x = a[x]
print ans

### FIXED CODE ###

from sys import stdin 
a = [0]
n = int(stdin.readline())
for _ in xrange(n):
 a.append(int(stdin.readline()))
ans = -1
cur = 0
x = 1
s = set()
while True:
 if x in s:
  break
 if x==2:
  ans = cur
  break
 s.add(x)
 cur+=1
 x = a[x]
print ans
N = int(input())
X = []
for _ in range(N):
  a, b = map(int, input().split())
  X.append((a, b))
mi = 1000
X = sorted(X)
for i in range(N):
    for j in range(i+1, N):
        p = X[j][0]-X[i][0]
        q = X[j][1]-X[i][1]
        if p == 0 and q == 0:
            continue
        if p < 0:
            p, q = -p, -q
        Y = [0] * (p*q)
        c = 0
        for k in range(N):
            for l in range(k):
                if X[l][0] == X[k][0] - p and X[l][1] == X[k][1] - q:
                    break
            else:
                c += 1
        mi = min(mi, c)
print(mi)

### FIXED CODE ###

N = int(input())
X = []
for _ in range(N):
    a, b = map(int, input().split())
    X.append((a, b))
mi = 1000
X = sorted(X)
for i in range(N):
    for j in range(i+1, N):
        p = X[j][0]-X[i][0]
        q = X[j][1]-X[i][1]
        if p == 0 and q == 0:
            continue
        if p < 0:
            p, q = -p, -q
        if p == 0 and q < 0:
            q = -q
        c = 0
        for k in range(N):
            for l in range(k):
                if X[l][0] == X[k][0] - p and X[l][1] == X[k][1] - q:
                    break
            else:
                c += 1
        mi = min(mi, c)
print(mi if mi < 1000 else 1)
N = int(input())

i=1
x = 0

while True:
    m = 10 ** i - 1
    if N <= m:
      x += (N - (10 ** (i-1) - 1))
      break
	x += m
print(x)

### FIXED CODE ###

N = int(input())
 
i=1
x = 0
 
while True:
  m = 10 ** i - 1
  if N <= m:
    x += max((N - (10 ** (i-1) - 1)), 0)
    break
  x += (m - (10 ** (i-1) - 1))
  i += 2
print(x)
ans = ""
for i in range(3):
 s = raw_input().split(" ")
 ans += s[i]
print ans

### FIXED CODE ###

ans = ""
for i in range(3):
 s = raw_input()
 ans += s[i]
print ans
if abs(a - c) <= d:
    print('Yes')
elif abs(a - b) <= d and abs(b - c) <= d:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

if abs(a - c) <= d:
    print('Yes')
elif abs(a - b) <= d and abs(b - c) <= d:
    print('Yes')
else:
    print('No')
N=int(input())
A=list(map(int,input().split()))
A.sort()
S=[]
D=[]

for i in A:
    if i in S:
        D.append(i)
    else:
        S.append(i)
#print(D)
M=N-len(D)

if len(D)%2==1:
    print(M-1)
else:
    MaxD,MinD=max(D),min(D)
    Med=-1
    for i in S:
        if MinD<=i<=MaxD:
            Med=i
            print(M)
            break
    if Med==-1:
        print(M-2)

### FIXED CODE ###

N=int(input());A=list(map(int,input().split()));S=len(set(A));print(S-1+S%2)
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y)//math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
a = list(map(int, input().split()))
lcm = lcm(*a)-1
f = 0
for i in range(len(a)):
    f += lcm%a[i]
print(f)

### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

def lcm(x, y):
    return (x*y)//gcd(x, y)

N = int(input())
a = list(map(int, input().split()))
lcm2 = 1
for i in range(N):
    lcm2 = lcm(a[i], lcm2)
lcm2 -= 1
f = 0
for i in range(N):
    f += lcm2%a[i]
print(f)
from scipy.sparse.csgraph import floyd_warshall as fw
N, M, L = map(int, input().split())

# 町間の道の長さのマトリックスを初期値無限で作成
S = [[float("INF") for i in range(N)] for i in range(N)]

# 町間の道の長さ情報をマトリックスに入力
for i in range(M):
    a, b, c = map(int,input().split())
    S[a-1][b-1] = c
    S[b-1][a-1] = c


# ワーシャルフロイド法で最短距離のマップを生成
Sf = fw(S)

T = [[float("INF")for i in range(N)] for i in range(N)]

# 町間を補給なしで通行可能な場合は1、不可能な場合はINFとしてマトリックスを作成
# （町間距離がタンク容量より大きい場合は通行不可）
for i in range(N):
    for j in range(N):
        if Sf[i][j] <= L:
            T[i][j] = 1

# ワーシャルフロイド法で町間移動可否のマップを生成
# すぐ上のfor文で、補給なしで移動できない町間の移動コストはINFにしたが、
# この処理で複数回の補給を行えば移動できる距離を
Tf = fw(T)

for i in range(int(input())):
    a, b = map(int, input().split())
    if Tf[a-1][b-1] != float("INF"):
        print(int(Tf[a-1][b-1])-1)
    else:
        print(-1)


### FIXED CODE ###

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

ans = A-B*2
if ans<0:
    ans = 0

print(ans)
import sys
from collections import deque
N, M = map(int, input().split())
edges = [[] for i in range(N)]
AB = []
for _ in range(M):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    AB.append((a-1, b-1))
def BFS(s):
    prev = [-1]*N
    que = deque([s])
    while que:
        v = que.pop()
        for nv in edges[v]:
            if nv == s:
                prev[nv] = v
                return (s, prev)
            if prev[nv]<0:
                que.append(nv)
                prev[nv] = v
    return (-1, prev)
for v in range(N):
    v0, prev = BFS(v)
    if v0>=0:
        break
if v0<0:
    print(-1)
    sys.exit()
circle = set()
circle.add(v0)
pv = prev[v0]
while pv != v0:
    circle.add(pv)
    pv = prev[pv]
for a, b in AB:
    if a in circle and b in circle and prev[b] != a:
        pv = prev[b]
        while pv != a:
            circle.remove(pv)
            pv = prev[pv]
        pv[b] = a
print(len(circle))
for i in circle:
    print(i+1)

### FIXED CODE ###

import sys
from collections import deque
N, M = map(int, input().split())
edges = [[] for i in range(N)]
AB = []
for _ in range(M):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    AB.append((a-1, b-1))
def BFS(s):
    prev = [-1]*N
    que = deque([s])
    while que:
        v = que.pop()
        for nv in edges[v]:
            if nv == s:
                prev[nv] = v
                return (s, prev)
            if prev[nv]<0:
                que.append(nv)
                prev[nv] = v
    return (-1, prev)
for v in range(N):
    v0, prev = BFS(v)
    if v0>=0:
        break
if v0<0:
    print(-1)
    sys.exit()
circle = set()
circle.add(v0)
pv = prev[v0]
while pv != v0:
    circle.add(pv)
    pv = prev[pv]
for a, b in AB:
    if a in circle and b in circle and prev[b] != a:
        pv = prev[b]
        while pv != a:
            circle.remove(pv)
            pv = prev[pv]
        prev[b] = a
print(len(circle))
for i in circle:
    print(i+1)
a = input()
print(a+a**2+a**3)

### FIXED CODE ###

a = int(input())
print(a+a**2+a**3)
#!usr/bin/env python3
from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007

#A
"""
t,x = LI()
print(t/x)
"""

#B
"""
n= II()
a = LI()
m = max(a)
if m >= sum(a)-m:
    print("No")
else:
    print("Yes")
"""

#C
"""
n,m = LI()
x = LI()
x.sort()
l = [x[i+1]-x[i] for i in range(m-1)]
l.sort()
l = l[::-1]
ans = sum(l[max(n-1,0):])
print(ans)
"""

#D
n,k = LI()
a = LI()
l = 0
b = [0 for i in range(n)]
for i in range(n):
    b[i] = list(bin(a[i]))[2:]
    l = max(l,len(b[i]))
s = [0 for i in range(l)]
for i in range(n):
    for j in range(l-len(b[i])):
        b[i].insert(0,"0")
for i in range(n):
    for j in range(l):
        s[j] += 1-int(b[i][j])
ke = 1
ans = 0
i = l-1
while i >= 0:
    if s[i] <= n//2:
        ans += (n-s[i])*ke
        s.pop(i)
    else:
        ans += (n-s[i])*ke
        s[i] = [(2*s[i]-n)*ke,ke]
    i -= 1
    ke *= 2
s.sort(key = lambda x:x[0])
s = s[::-1]
d = 0
key = len(list(bin(k)))-2
key -= l
ke = 2**l
for i in range(key):
    d += ke
    ans += n*ke
    ke *= 2
w = len(s)
if w == 0:
    print(ans)
    quit()
b = ans
c = d
for i in range(w):
    q,p = s[i]
    if d+p <= k:
        d += p
        ans += q
import random
for j in range(10):
    a = b
    e = c
    l = [i for i in range(w)]
    for _ in range(w-1):
        i = random.randint(0,len(l)-1)
        i = l.pop(i)
        q,p = s[i]
        if e+p <= k:
            e += p
            a += q
    ans = max(ans,a)
print(ans)
#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007

#A
t,x = LI()
print(t/x)
#B

#C

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T
def mx(p,w,h,l):
	if h <= c/2:
		if w == 0: p[h][w] += p[h-1][w]
		elif w == l-1: p[h][w] += p[h-1][w-1]
		else: p[h][w] += max(p[h-1][w],p[h-1][w-1])
	else:
		p[h][w] += max(p[h-1][w],p[h-1][w+1])
	return p

c = 0
p = []
while True:
	try:
		p.append(map(int, raw_put().split(",")))
		c += 1
	except:
		break
	
for h in range(1,c):
	l = len(p[h])
	for w in range(l):
		p = mx(p,w,h,l)
print p[c-1][0]

### FIXED CODE ###

def mx(p,w,h,l):
	if h <= c/2:
		if w == 0: p[h][w] += p[h-1][w]
		elif w == l-1: p[h][w] += p[h-1][w-1]
		else: p[h][w] += max(p[h-1][w],p[h-1][w-1])
	else:
		p[h][w] += max(p[h-1][w],p[h-1][w+1])
	return p

c = 0
p = []
while True:
	try:
		p.append(map(int, raw_input().split(",")))
		c += 1
	except:
		break
	
for h in range(1,c):
	l = len(p[h])
	for w in range(l):
		p = mx(p,w,h,l)
print p[c-1][0]
5
30 44
26
18
81
18
6

### FIXED CODE ###

N = int(input())
D,X = map(int,input().split())

S = X

for i in range(N):
	a = int(input())
	S += (D-1)//a+1
print(S)