Problem:


Score : 200 points

Problem Statement

Some number of chocolate pieces were prepared for a training camp.
The camp had N participants and lasted for D days.
The i-th participant (1 \leq i \leq N) ate one chocolate piece on each of the following days in the camp: the 1-st day, the (A_i + 1)-th day, the (2A_i + 1)-th day, and so on.
As a result, there were X chocolate pieces remaining at the end of the camp. During the camp, nobody except the participants ate chocolate pieces.

Find the number of chocolate pieces prepared at the beginning of the camp.

Constraints

1 \leq N \leq 100

1 \leq D \leq 100

1 \leq X \leq 100

1 \leq A_i \leq 100 (1 \leq i \leq N)

All input values are integers.

Input

Input is given from Standard Input in the following format:

N
D X
A_1
A_2
:
A_N

Output

Find the number of chocolate pieces prepared at the beginning of the camp.

Sample Input 1

3
7 1
2
5
10

Sample Output 1

8

The camp has 3 participants and lasts for 7 days.
Each participant eats chocolate pieces as follows:

The first participant eats one chocolate piece on Day 1, 3, 5 and 7, for a total of four.

The second participant eats one chocolate piece on Day 1 and 6, for a total of two.

The third participant eats one chocolate piece only on Day 1, for a total of one.

Since the number of pieces remaining at the end of the camp is one, the number of pieces prepared at the beginning of the camp is 1 + 4 + 2 + 1 = 8.

Sample Input 2

2
8 20
1
10

Sample Output 2

29

Sample Input 3

5
30 44
26
18
81
18
6

Sample Output 3

56



Sample input:
3
7 1
2
5
10


Sample output:
8

Submission status: Accepted

Solution code:
def abc092_b():
    n = int(input())
    d, x = map(int, input().split())
    a = [int(input()) for _ in range(n)]
    choco = x
    for i in range(n):
        choco += (d - 1) // a[i] + 1

    print(choco)


abc092_b()

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
a = []
for k in range(n):
    a.append(int(input()))
ans = x
for i in range(n):
    j = 0
    while a[i]*j+1 <= d:
        ans +=1
        j +=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int,input().split())

ans = x
for _ in range(n):
    a = int(input())
    # y*a+1 <= d
    y = (d-1)//a
    ans += y+1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D,X = list(map(int,input().split(" ")))
A = [int(input()) for i in range(N)]

ans = X
for i in range(N):
    r = int((D - 1)/A[i] + 1)
    ans+=r
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
D,X=map(int,input().split())
A = [int(input()) for _ in range(N)]
count=0
for i in range(1,D+1):
    for j in range(N): 
        if (i-1)%A[j]==0:
            count+=1
print(count+X)

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int, input().split())
a = []
for _ in range(n):
    a.append(int(input()))

res = 0
for e in a:
    i = 0
    while e*i+1 <= d:
        res += 1
        i += 1

print(res+x)

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int, input().split())
a = [int(input()) for _ in range(n)]

for i in range(n):
    day=1
    while day<=d:
        x += 1
        day += a[i]
print(x)

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())
s=0
for i in range(n):
  k=0
  a=int(input())
  c=0
  while True:
    y=k*a+1
    if y<=d:
      c+=1
      k+=1
    else:
      s+=c
      break
print(s+x)

Submission status: Accepted

Solution code:
i=input
I=int
n=I(i())
d,x=map(I,i().split())
print(sum((lambda m:(d+m-1)//m)(I(i())) for v in [0]*n)+x)

Submission status: Accepted

Solution code:
from math import *
i=input
I=int
n=I(i())
d,x=map(I,i().split())
print(sum(ceil(d/I(i()))for _ in range(n))+x)

Submission status: Accepted

Solution code:
from math import *
n=int(input())
d,x=map(int,input().split())
print(sum(ceil(d/int(input()))for _ in range(n))+x)

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())
m=0
for _ in range(n):
    M=int(input())
    m+=(d+M-1)//M
print(m+x)

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())
print(sum((lambda m:(d+m-1)//m)(int(input())) for v in range(n))+x)

Submission status: Accepted

Solution code:
import math
n=int(input())
d,x=map(int,input().split())
print(sum(math.ceil(d/int(input()))for v in range(n))+x)

Submission status: Accepted

Solution code:
n=input();d,x=map(int,input().split())
for i in range(int(n)):a=int(input());x+=(d+a-1)//a
print(x)

Submission status: Accepted

Solution code:
n=input()
d,x=map(int,input().split())
for i in range(int(n)):
 a=int(input())
 x+=(d+a-1)//a
print(x)

Submission status: Accepted

Solution code:
n=input()
d,x=map(int,input().split())
for i in range(int(n)):
    a=int(input())
    x+=(d+a-1)//a
print(x)

Submission status: Accepted

Solution code:
n=int(input());d,x=map(int,input().split());res=0
for i in range(n):
    a=int(input())
    res+=(d+a-1)//a
print(res+x)

Submission status: Accepted

Solution code:
n=int(input());d,x=map(int,input().split());res=0
for i in range(n):
    a=int(input())
    
    if a>d:
        #print(1)
        res+=1
    else:
        #print(d//a+1)
        if d%a!=0:
            res+=d//a+1
        else:
            res+=d//a
    
    #res+=1 if a>d else d//a
    #:res+=1 if d%a!=0
print(res+x)

Submission status: Accepted

Solution code:
N=int(input())
D,X=list(map(int,input().split()))
c=0
for i in range(N):
    A=int(input())
    if(D%A!=0):c+=1
    c+=int(D/A)
print(X+c)

Submission status: Accepted

Solution code:
a = int(input())
N,X = map(int,input().split(" "))
count = 0
for i in range(a):
    l = int(input())
    if N % l == 0:
        count += N // l
    else:
        count += N // l + 1
print(count + X)

Submission status: Accepted

Solution code:
N = int(input())
D,X = map(int, input().split())
A_list = [int(input()) for i in range(N)]
ans = X

for a in A_list:
    ans += int((D-1)/a + 1)

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())
chocho=0

for i in range(n):
  j=1
  chocho+=1
  A=int(input())
  tmp=j*A+1
  while tmp <= d:
    j+=1
    tmp=j*A+1
    chocho+=1
print(chocho+x)

Submission status: Accepted

Solution code:
# Chocolate
n = int(input())
d, x = map(int, input().split())
for _ in range(n):
    x += ((d - 1) // int(input())) + 1
print(x)

Submission status: Accepted

Solution code:
a=int(input())
b,c=map(int,input().split())
d=[int(input()) for i in range(a)]
#print(d)
e=0
for k in range(a):
	for i in range(100):
		if i*d[k]+1<=b:
			e=e+1
print(e+c)

Submission status: Accepted

Solution code:
#coding: utf-8
N = int(input())
D, ans = map(int, input().split())

for i in range(0,N):
    A = int(input())
    ans += int((D-1)/A)+1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())

a = list()
for i in range(n):
    a.append(int(input()))

ans = x

for i in range(1, d + 1):
    for j in range(n):
        if((i - 1) % a[j] == 0):
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    d, x = map(int, input().split())

    for i in range(n):
        a = int(input())
        x += (d-1)//a + 1

    print(x)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
dx = list(map(int, input().split()))
d = dx[0]
x = dx[1]
for i in range(n):
    k = 0
    a = int(input())
    while a * k + 1 <= d:
        x += 1
        k += 1
print(x)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map( int, input().split())
A = list()
chocoX = 0

for i in range(N):
  a = input()
  A.append(a)
    
for j in range(N):
  chocoX += (((D -1) // int(A[j])) + 1)
    
print(chocoX + X)

Submission status: Accepted

Solution code:
N = int(input())
D, X = [int(_) for _ in input().split()]
A = [int(input()) for _ in range(N)]

for a in A:
    X += 1 + (D - 1) // a
print(X)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
eaten_amount = 0

for i in range(N):
    a_n = int(input())
    j = 0
    while a_n * j + 1 <= D:
        eaten_amount += 1
        j += 1

print(X + eaten_amount)

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int,input().split())
a = [input() for i in range(n)]
b = [int(i) for i in a]
eat = []
for i in range(n):
  eat.append((d-1)//b[i] + 1)
print(sum(eat) + x)

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int,input().split())
a = [int(input()) for _ in range(n)]
s = 0
for v in a:
    s += (d - 1) // v + 1
print(s + x)

Submission status: Accepted

Solution code:
N = input()
D, X = map(int, raw_input().split())
A = [input() for i in range(N)]
print sum([(D - 1) / a + 1 for a in A]) + X

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int,input().split())
a = [int(input()) for _ in range(n)]
for i in a:
    for j in range(1,d+1):
        if (j-1)%i==0:
            x += 1
print(x)

Submission status: Accepted

Solution code:
n = int(input())
d,x =map(int,input().split())
cnt = 0
for i in range(n):
    cnt += 1+(d-1)//int(input())
print(cnt+x)

Submission status: Accepted

Solution code:
a=int(input())
b,c=map(int,input().split())
print(sum((b-1)//int(input())for i in[a]*a)+a+c)

Submission status: Accepted

Solution code:
a=int(input())
b,c=map(int,input().split())
d=list((b-1)//int(input())for i in range(a))
print(a+c+sum(d))

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())
x+=n
d-=1
for i in range(n):
  a=int(input())
  x+=d//a
print(x)

Submission status: Accepted

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

for i in range(N):
    A = int(input())
    X += 1 + (D - 1) // A

print(X)

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int, input().split())
a = [int(input()) for i in range(n)]
co = 0
for i in range(1, d + 1):
  for j in a:
    for k in range(d + 1):
      if i ==  k * j + 1:
        co += 1
co += x
print(co)

Submission status: Accepted

Solution code:
n = int(input())
d, x = [int(i) for i in input().split()]
a = [int(input()) for i in range(n)]
c = 0
for i in range(d):
  for j in range(n):
    if i*a[j]+1 <= d:
      c += 1
print(c+x)

Submission status: Accepted

Solution code:
N=int(input())
D,X=map(int,input().split())
ans=X

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

Submission status: Accepted

Solution code:
N=int(input())
D,X=map(int,input().split())
ans=X

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

Submission status: Accepted

Solution code:
import math
n = int(input())
d,x = map(int,input().split())
lis = [int(input()) for i in range(n)]
cou = x
for i in range(n):cou += math.ceil(d/lis[i])
print(cou)

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
a = [int(input()) for i in range(n)]

ans = x
for i in range(n):
    count = 1
    day = 1
    while day + a[i] <= d:
        day += a[i]
        count += 1
    ans += count

print(ans)

Submission status: Accepted

Solution code:
import sys
fin = sys.stdin.readline

N = int(fin())
D, X = [int(elem) for elem in fin().split()]
A_list = [int(fin()) for _ in range(N)]

eaten_num_chocolate = 0
for A in A_list:
    eaten_num_chocolate += (D - 1) // A + 1

print(eaten_num_chocolate + X)

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
D, X = map(int, input().split())
A = [int(input()) for i in range(N)]

ans = 0
for a in A:
    ans += ceil(D / a)
ans += X
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
D,X=map(int,input().split())
a=[]
for _ in range(N):
    a.append(int(input()))
answer = 0
for v in a:
    day = 1
    while day <= D:
        answer += 1
        day += v
answer += X
print(answer)

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
for _ in range(n):
  a = int(input())
  x += 1 + (d - 1) // a
print(x)

Submission status: Accepted

Solution code:
"""
B - Chocolate
"""

n = int(input())

days, offset = map(int, input().split())

a_list = []
for part in range(n):
    a_list.append(int(input()))

choco_sum = offset

for day in range(days):
    for a in a_list:
        if day % a == 0:
            choco_sum += 1

print(choco_sum)

Submission status: Accepted

Solution code:
import sys
N = int(input())
D,X = map(int,input().split())
choco = 0
for i in range(N):
    a = int(input())
    k = 0
    while k*a+1 <= D:
        k += 1
        choco += 1
print(choco+X)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
a = []
for i in range(N):
    a.append(int(input()))
sum = 0
for i in range(N):
    sum += int((D-1) / a[i] + 1)
print(sum+X)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    d, x = map(int, input().split())
    count = x
    tmp = [1] * (d + 1)

    for i in range(1, n + 1):
        ai = int(input())
        count += sum(tmp[1::ai])

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
a = [int(input()) for i in range(n)]

ans = x
for i in range(n):
    count = 1
    num = 1
    while num + a[i] <= d:
        count += 1
        num += a[i]
    ans += count

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D,X = map(int,input().split())
ans = X
for i in range(N) :
    a = int(input())
    ans += 1 + (D-1)//a
print(ans)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
d,x = li()
a = []
for _ in range(n):
    a.append(ni())

ans = x
for ai in a:
    ans += ((d-1)//ai + 1)
    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D,X = map(int,input().split())
A = [int(input()) for i in range(N)]

ans = X
for a in A:
    for n in range(1,D+1,a):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int,input().split())
a = [int(input()) for i in range(n)]

c = 0
for i in a:
    c += d//i + (d%i!=0)
print(c+x)

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
ans = x
for i in range(n):
    a = int(input())
    ans += (d - 1) // a + 1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

dic = dict()


def main() -> None:
    n = next_int()
    d, x = [int(s) for s in input().split()]

    for i in range(n):
        a = next_int()
        x += 1 + (d - 1) // a

    print(x)


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int,input().split())
ans = 0
for i in range(n):
    a = int(input())
    if d%a==0:
        ans += (d//a)
    else:
        ans += (d//a + 1)
print(ans+x)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split( ))
ans = X
for i in range(N):
	A = int(input())
	if D == A * (D//A):
		ans += D//A

	else:
		ans += D//A + 1 

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
for _ in range(n):
    a = int(input())
    x += (d-1) // a + 1
print(x)

Submission status: Accepted

Solution code:
N = int(input())
D, X = list(map(int, input().split()))

s = 0
for i in range(N):
	A = int(input())
	s += 1 + int((D - 1) // A)
print(X + s)

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())
ans=0
for i in range(n):
    a=int(input())
    ans+=d//a
    if d%a!=0:
        ans+=1
print(ans+x)

Submission status: Accepted

Solution code:
N = int(input())
D, X = [int(i) for i in input().split()]
A = [int(input()) for _ in range(N)]
n = 0
for a in A:
    i = 1
    while i <= D:
        n += 1
        i += a
print(n+X)

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int, input().split())
for i in range(n):
    a = int(input())
    x += 1
    x += len([f for f in range(2,d+1) if (f-1) % a == 0])
print(x)

Submission status: Accepted

Solution code:
n = int(input())
d, x = list(map(int, input().split()))
a = [int(input()) for _ in range(n)]

ans = x
for i in range(n):
    ans += (d-1)//a[i]+1
print(ans)

Submission status: Accepted

Solution code:
#人数
N = input()
#合宿D日、最後に残ったチョコX
D,X = input().split()
A = []
for i in range(int(N)):
    A.append(input())
x  = int(N)
for a in A:
    x += int((int(D)-1)/int(a))
    #print("---"+D+"/"+a+"=",int(int(D)/int(a)))
print(x+int(X))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
D = A[0]
X = A[1]

for i in range(N):
  M = int(input())
  X += int(D / M) + (0 if D % M == 0 else 1)

print(X)

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N = int(input())
    D, X = li_input()
    A = [int(input()) for _ in range(N)]

    print(
        sum([math.ceil(D / a) for a in A]) + X
    )


main()

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N = int(input())
    D, X = li_input()
    A = [int(input()) for _ in range(N)]

    e = sum([math.ceil(D / a) for a in A])

    print(e + X)


main()

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N = int(input())
    D, X = li_input()
    A = [int(input()) for _ in range(N)]

    e = 0

    for a in A:
        e += math.ceil(D / a)

    print(e + X)


main()

Submission status: Accepted

Solution code:
n = int(input())

d,x = map(int,input().split())

a = [(d-1)//int(input()) for _ in range(n)]

print(x + sum(a) + len(a))

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N = int(input())
    D, X = li_input()

    eaten = 0

    for i in range(N):
        a = int(input())
        eaten += math.ceil(D / a)

    print(eaten + X)


main()

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
a = [int(input()) for _ in range(n)]

ans = x
for i in a:
    temp = 1
    while temp <= d:
        ans += 1
        temp += i

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D, X  = map(int, input().split())
cacao = 0
for i in range(N):
    A = int(input())
    cacao += ((D-1)//A)+1
print(cacao+X)

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int,input().split())
cnt = 0

for i in range(n):
    s = int(input())
    c = 1
    dcnt = 1
    while dcnt <=d :
        dcnt = c * s + 1
        cnt += 1
        c += 1

print(cnt + x)

Submission status: Accepted

Solution code:
n = int(input())
d, x = [int(m) for m in input().split(" ")]
a = [int(input()) for i in range(n)]

print(x + sum([(d-1)//a_i+1 for a_i in a]))

Submission status: Accepted

Solution code:
N = int(input())
D,X = map(int, input().split())
C = 0

def Chocolate(A,D):
  b = 0
  i = 0
  while(True):
    date = i*A + 1
    if date > D:
      break
    else:
      b += 1
      i += 1
  
  return b

for n in range(N):
  A = int(input())
  C += Chocolate(A,D)
  
print(C+X)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
A = [int(input()) for i in range(N)]

cnt = 0
for a in A:
    for i in range(1, D+1, a):
        cnt += 1

print(cnt + X)

Submission status: Accepted

Solution code:
N = int(input())
D,X = map(int,input().split())
A = [int(input()) for i in range(N)]

kosuu = []
for i in range(N):
    if D % A[i] == 0:
        kosuu.append(D // A[i])
    else:
        kosuu.append(D // A[i] + 1)
    
print(sum(kosuu) + X)

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())

cnt=0

for i in range (n):
	a=int(input())
	cnt=cnt+1
	for j in range (1,d):
		if ((j*a)+1)<=d:
			cnt=cnt+1

		
			
    		
print(cnt+x)