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 main():
    N = int(input())
    D, X = map(int, input().split())
    l = []
    for i in range(N):
        l.append(int(input()))
    choco = 0
    for i in range(N):
        day = 1
        choco += 1
        multiply = 1
        while day <= D:
            day = l[i] * multiply + 1
            if day > D:
                break
            else:
                choco += 1
                multiply += 1
    print(choco + X)

main()

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())
eat=[]
for i in range(n):
    a=int(input())
    count=0
    for j in range(101):
        aeat=a*j+1
        if aeat<=d:
            count+=1
        else:
            eat.append(count)
            break
print(x+sum(eat))

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:
    ans += 1 + int((D-1)/i)
    
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
D,X = map(int,input().split())
ans = 0
for i in range(N):
  num = int(input())
  ans += (math.floor((D - 1) / num) + 1)
print(ans + 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 i in range(n):
    cnt+=((d-1)//a[i]+1)
print(x+cnt)

Submission status: Accepted

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

choco = 0

for e_a in a:
    day = 0
    for i in range(d):
        if day*e_a + 1 == (i+1):
            day += 1
            choco += 1

choco += x
print(choco)

Submission status: Accepted

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

sum = 0
for i in range(N):
    a = int(input())
    d = 0
    i = 0
    while d <= D:
        d = a*i + 1
        i += 1
        if d <= D:
	        sum += 1

print(sum + X)

Submission status: Accepted

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

Submission status: Accepted

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

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

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 a:
  day=1
  while day <= d:
    day+=i
    count+=1
print(count+x)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
d, x = rm()
cnt = 0
for _ in range(n):
    cnt += (d - 1) // ri() + 1
print(x + cnt)

Submission status: Accepted

Solution code:
N=int(input())
D,X=map(int,input().split())
ans=X
for i in range(N):
  A=int(input())
  j=0
  while j*A+1<=D:
    ans+=1
    j+=1
print(ans)

Submission status: Accepted

Solution code:
#B - Chocolate
N = int(input())
D,X = map(int,input().split())
A = list(int(input()) for i in range(N))

choco = 0

for i in A:
    day = [i*j + 1 for j in range(100) if i*j < D]
    choco += len(day)

print(X + choco)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
ans = X
for i in range(N):
    a = int(input())
    for j in range(0, 101):
        if j * a + 1 <= D:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

ans = 0
for i in range(n):
    if (d % a[i] == 0):
        ans += d // a[i]
    else:
        ans += d // a[i] + 1
print(ans + x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
M,K=map(int,input().split())
ans=K
for i in range(N):
  s=int(input())
  ans+=1+(M-1)//s
print(ans)

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 range(N):
    for j in range(1, D + 1):
        if (j - 1) % A[i] == 0:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
day,rest=map(int,input().split())
cho=0
for i in range(N):
  k=int(input())
  for h in range(day+1):
    if  k*h+1<=day:
      cho+=1
    else:
      break
print(cho+rest)

Submission status: Accepted

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

for i in range(n):
    day = 1
    count = 0
    m = int(input())
    while d >= day:
        day += m
        count += 1
    ans += count
    
print(ans + x)

Submission status: Accepted

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

ans = X + sum([-(-D//a) for a in A])

print(ans)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, D, X, *A = map(int, read().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math


def resolve():
    import sys
    input = sys.stdin.readline
    # row = [int(x) for x in input().rstrip().split(" ")]
    # n = int(input().rstrip())
    n = int(input().rstrip())
    dx = [int(x) for x in input().rstrip().split(" ")]
    d = dx[0]
    x = dx[1]

    ans = 0

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

        day_count = 0
        while True:
            day = day_count * a + 1

            if day > d:
                break
            ans += 1
            day_count += 1

    print(ans + x)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
A = [int(input()) for _ in range(N)]
print(X + sum([D//a if D%a==0 else (D//a)+1 for a in A]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
d, x = inintm()

ans = 0

for _ in range(n):
    a = inint()
    for i in range(102):
        if a*i + 1 > d:
            break
        ans += 1

print(ans+x)

Submission status: Accepted

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

for n 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= list(map(int, input().strip().split()))
a=[0]*n
for i in range(n):
    a[i]=int(input())
choko=x
for i in range(n):
    choko+=((d-1)//a[i])+1
print(choko)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

SUM=0
for i in range(N):
  count=1
  d = 1
  while 1:
    d += A[i]
    if d > D:
      break
    else:
      count += 1
  SUM += count
  
print(SUM+X)

Submission status: Accepted

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

A = [int(input()) for _ in range(N)]

choco = [0] * (D + 1)
for a in A:
    i = 0
    while i * a + 1 <= D:
        choco[i * a + 1] += 1
        i += 1
print(sum(choco) + X)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
d, x = map(int, input().split())
a = np.array([int(input()) for _ in range(n)])
a = np.ceil(d / a)
print(int(np.sum(a) + x))

Submission status: Accepted

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

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

Submission status: Accepted

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

d = D - 1

eat = 0
for a in A:
    eat += d // a + 1

print(eat + X)

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
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
import numpy as np
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 = INT()
D, X = MAP()
A = [INT() for i in range(N)]

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

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):
    X += len([d for d in range(D) if d*A[i]+1 <= D])
print(X)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

X += N
for d in range(2,D+1):
    for a in A:
        if (d - 1) % a == 0:
            X += 1

print(X)

Submission status: Accepted

Solution code:
n,dd = int(raw_input()),  map(int, raw_input().split())
print dd[1] + sum([(dd[0]-1)/int(raw_input())  for _ in range(n)]) + n

Submission status: Accepted

Solution code:
n = int(raw_input())
d,x = map(int, raw_input().split())
print x + sum([1 + (d-1)/int(raw_input())  for _ in range(n)])

Submission status: Accepted

Solution code:
n = int(raw_input())
d,x = map(int, raw_input().split())
def f(ai,d): return 1 + (d-1)/(ai)
print x + sum([f(int(raw_input()),d)  for _ in range(n)] or [0])

Submission status: Accepted

Solution code:


n = int(raw_input())
d,x = map(int, raw_input().split())
ais = [int(raw_input()) for _ in range(n)]

def f(ai,d):
	return 1 + (d-1)/(ai)

print x + sum([f(ai,d) for ai in ais] or [0])

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
a_list = []
for _ in range(n):
    a_list.append(int(input()))
    
# print(f"{n} {d} {x}")
# print(a_list)

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

Submission status: Accepted

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

for i in A:
    if D%i ==0:
        cnt += D//i
    else:
        cnt += (D//i + 1)
    #print(cnt)
print(cnt+X)

Submission status: Accepted

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

ans = x
for a in A: ans += (d - 1) // 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())
  if D%A:
    X += D//A+1
  else:
    X += D//A
print(X)

Submission status: Accepted

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

for i in range(N):
    day = 1
    j = 0
    while day <= D:
        choco[day-1] += 1
        j += 1
        day = A[i] * j + 1

ans  = sum(choco) + X
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

a = []

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

for i in a:
    for _ in range(1,d+1,i):
        ans += 1
        
print(ans+x)

Submission status: Accepted

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

print(X + Eaten)

Submission status: Accepted

Solution code:
N=int(input())
D,X=map(int,input().split())
res = X
List = []
for i in range (N):
  List.append(int(input()))
for i in range(N):
  for i in range(1,D+1,List[i]):
    res += 1
print(res)

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:
N = int(input())
D, X = map(int, input().split())
ans = 0
for i in range(N):
    A = int(input())
    ans += (D-1)//A + 1

print(ans+X)

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()
    d, x = i_map()
    num_list = i_row(n)

    count = x

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

    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)]
for i in range(n):
    x += (d-1) // a[i] + 1
print(x)

Submission status: Accepted

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

Submission status: Accepted

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

print(x+ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = X

for a in A:
    eat_date = [1 + a * i for i in range(100) if 1 + a * i <= D]
    ans += len(eat_date)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
NN = input().split()
D = int(NN[0])
X = int(NN[1])
count = 0
list1 =[]
for i in range(N):
  a = int(input())
  list1.append(a)
for i in list1:
  x = 1
  while x <= D:
    count +=1
    x += i
print(count+X)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = int(s)

v = input().split()
d = int(v[0])
x = int(v[1])

eats = 0

for i in range(n):
    p = input()
    q = int(p)
    c = 1
    while (c <= d):
        eats += 1
        c += q

answer = eats + x
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    a=int(input())
    day=1
    while day<=d:
        ans+=1
        day+=a
    
print(ans+x)

Submission status: Accepted

Solution code:
N=int(input())
D,X=map(int,input().split())
A=[int(input()) for _ in range(N)]
ans=0
for i in range(N):
  for j in range(D):
    if D>A[i]*j:
      ans+=1
    else:
      break
print(ans+X)

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0
for i in range(1, N+1):
    A = int(input())
    for j in range(1, D+1):
        if (j - 1) * A + 1 <= D:
            count += 1
        else:
            break

result = count + X

print(result)

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    D, X = map(int, input().split())
    ans = X
    A = [int(input()) for _ in range(N)]
    for a in A:
        d = 1
        while d <= D:
            ans += 1
            d += a
    print(ans)



if __name__ == "__main__":
    solve()

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 range(N):
    ans += (D-1)//A[i] + 1

print(ans)

Submission status: Accepted

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

cnt = [1]*n
for i in range(n):
    num = (d-1)//a[i]
    cnt[i] += num

print(x + sum(cnt))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, d, x, *a = map(int, read().split())

cnt = 0
for i in a:
    if i == 1:
        cnt += d
    elif d % i == 0:
        cnt += d//i
    else:
        cnt += d // i + 1
print(cnt+x)

Submission status: Accepted

Solution code:
#23
N = int(input())
d,x = map(int,input().split())
an = []
num = 0
for i in range(N):
    a = int(input())
    #an.append(a)
    for i in range(101):
        if i*a+1 <=d:
            num += 1
        else:
            break

    
print(num+x)

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int, input().split())
ab = [int(input()) for _ in range(n)] #数字1*複数列入力

res = x
for i in range(n):
    c = ab[i]
    res += (d-1)//c +1

print(res)

Submission status: Accepted

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

total = 0
for a in al:
    i = 0
    while i * a + 1 <= d:
        i += 1
    total += i
print(total+x)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
A = [int(input()) for _ in range(N)]
E = 0 #食べた総数

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0

for i in range(N):
    Ai = int(input())
    for j in range(1, D + 1, Ai):
        ans += 1

ans += X

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
ans = 0
for i in range(N):
    A = int(input())
    j = 0
    while True:
        if 1 + A * j <= D: 
            ans += 1
            j += 1
        else:
            break

print(ans + X)

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) :
    day = 1
    while day <= d :
        ans += 1
        day += a[i]
print(ans)

Submission status: Accepted

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

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

print(n+x+ans)

Submission status: Accepted

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

for i in a:
    c += (d-1)//i+1

print(c+x)

Submission status: Accepted

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

choco = []
for i in range(n):
  j = 0
  count = 0
  while(True):
    if 1+an[i]*j <= d:
      count += 1
      j += 1
    else :
      choco.append(count)
      break
      
choco.append(x)
      
print(sum(choco))

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
ans = 0
for i in range(N):
    num = float(D)/int(input())
    if num.is_integer(): ans += int(num)
    else: ans += int(num)+1
print(ans+X)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import gcd

from math import factorial as f

from math import ceil, floor, sqrt
import math

import bisect
import re
import heapq

from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

yes = "Yes"
no = "No"


def main():
    n = ii()
    d, x = mi()
    a = []
    for i in range(n):
        tmp = ii()
        a.append(tmp)
    ans = 0
    for i in a:
        tmp = 1
        while tmp <= d:
            ans += 1
            tmp += i
    ans += x
    print(ans)


main()

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 = map(int,input().split())
A = [int(input()) for i in range(N)]

C = sum([(D-1)//a + 1 for a in A])

print(C+X)

Submission status: Accepted

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

ans = x

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

print(ans)

Submission status: Accepted

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

count = 0
for i in range(n):
  a = int(input())
  count += len([j for j in range(1, d + 1, a)])
print(count + x)

Submission status: Accepted

Solution code:
N = int(input())
D, X = input().split(' ')
D = int(D)
X = int(X)
count = 0
for i in range(N):
  a = int(input())
  count += 1
  for j in range(1, D, 1):
    if (D - 1) - a * j >= 0:
      count += 1   
print(count + X)

Submission status: Accepted

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

ans = x
for _ in range(n):
    a = int(input())
    cnt = 1
    
    tmp = a + 1
    if tmp <= d: cnt += 1
      
    while True:
        tmp += a
        if tmp <= d: cnt += 1
        else: break
        
    ans += cnt

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
d, X = map(int, input().split())
a = [int(input()) for _ in range(N)]
ans = 0
for i in range(N):
    cnt = 1
    for j in range(1,101):
        if a[i]*j + 1 <= d:
            cnt += 1
        else:
            ans += cnt 
            break

print(X+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 += (d - 1) // a + 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
A = [0] * N
ans = 0
for i in range(N):
    a = int(input())
    A[i] = a
sum = 1
for a in A:
    for i in range(1, 100):
        if 1 + (a * i) > D:
            break
        sum += 1
    ans += sum
    sum = 1
ans += X
print(ans)

Submission status: Accepted

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

n=int(input())
d,x = list(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:
n=int(input())
d,x=map(int,input().split())
ans=x
for i in range(n):
    a=int(input())
    c=int((d-1)/a)+1
    ans+=c
print(ans)

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

Solution code:
N = int(input())
D,X = map(int,input().split())
cnt = 0
for _ in range(N):
  A = int(input())
  for j in range (D):
    if A*j + 1 <= D:
      cnt += 1
    else:
      break
print(X+cnt)

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int,input().split())
a=[int(input()) for i in range(n)]
ans=[1+(d-1)//a[i] for i in range(n)]
print(x+sum(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 i in range(n):
    cnt=0
    while cnt*a[i]+1<=d:
        cnt+=1
    ans+=cnt
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D, X = list(map(int, input().split()))
cnt = 0
for i in range(N):
    a = int(input())
    j = 1
    d = 1
    while d <= D:
        cnt += 1
        d = j * a + 1
        j += 1
print(cnt + X)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n=ni()
d,x=nm()

cnt=0
for i in range(n):
  a = ni()
  for j in range(1,d+1,a):
    cnt+=1

print(cnt+x)

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    N = int(input())
    D, X = [int(item) for item in input().split()]
    As = [int(input()) for _ in range(N)]

    cnt = 0
    for i in range(N):
        day = 1
        while day <= D:
            day +=As[i] 
            cnt +=1

    print(cnt+X)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
N = int(input())
D,X = [int(i) for i in input().split()]
cho = [0]*D
for _ in range(N):
    for i in range(0,D,int(input())):
        cho[i] += 1
print(sum(cho)+X)

Submission status: Accepted

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

Submission status: Accepted

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

res = x
for v in a:
    res += (d - 1) // v + 1
print(res)