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

chocolates = X
for a in A:
    for _ in range(1, D + 1, a):
        chocolates += 1
print(chocolates)

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
a = [int(input()) for i in range(n)]
ans = x + n
for i in range(n):
    for z in range(1, d):
        if a[i] * z + 1<= d:
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	N = int(input())
	D, X = map(int, input().split(" "))
	
	A = []
	for i in range(N):
		tmp = int(input())
		A.append(tmp)
		
	ans = X	
	for i, val in enumerate(A):
		#print("ddd")
		for j in range(1, D+1, val):
			#print(j)
			ans += 1
		
	print(ans)
			
	
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)]

s=0
k=0
j=0

for i in range(1,n+1):
    k=a[i-1]
    while k*j+1<=d:
        s+=1
        j+=1     
    j=0        
    k=0
ans=s+x
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 a in A:
    i = 0
    while 1+i*a<=D:
        count += 1
        i += 1
print(count+X)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int,input().split()))

for i in range(a):
  c = int(input())
  b[1]+=1+(b[0]-1)//c
else:
  print(b[1])

Submission status: Accepted

Solution code:
N = int(input())
days, leftover = map(int, input().split())
a = []
ans = N
for i in range(N):
    j = 1
    a.append(int(input()))
    while a[i]*j+1 <= days:
        ans += 1
        j += 1
print(ans+leftover)

Submission status: Accepted

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

ans=n
for i in a:
	cnt=1
	t=1
	while  t<=d:
		t=cnt*i+1
		cnt+=1
		if t<=d:
			ans+=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)]
v=0
for i in range (d):
    for j in range(n):
        if a[j]*i+1<=d:
            v+=1
        else:
            pass

print(v+x)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
D, X = map(int, input().split())
arr = [int(input()) for i in range(N)]
ctr = 0

for i in range(N):
    if D % arr[i] == 0:
        ctr += D // arr[i]
    else:
        ctr += D // arr[i] + 1
print(ctr + 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())
    day = 1
    while day <= d:
        res += 1
        day += a

print(res)

Submission status: Accepted

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

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

num = 0
for n in range(N):
    plus = A[n]
    comp = 0
    while True:
        if 1 + comp > D:
            break
        else:
            num += 1
            comp += plus

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

Submission status: Accepted

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

num = 0
list = []
for a in A:
    num = 1 + (D - 1) // a
    list.append(num)
    num = 0

print(X + sum(list))

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+=-(-d//a[i])
print(x)

Submission status: Accepted

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

mans=[]
for i in range(n):
    mans.append(int(input()))

#print(mans)
cho=[]

for j in mans:
    cnt=1
    y=1+j
    while True:
        if y<=d:
            y+=j
            cnt+=1
        else:
            break
            
    cho.append(cnt)
print(sum(cho)+x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    n = int(input())
    d, x = map(int, input().split())
    al = [int(input()) for i in range(n)]

    sum = 0
    for a in al:
        sum += 1 + (d-1) // a

    print(sum+x)

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    n = int(input())
    d, x = map(int, input().split())
    al = [int(input()) for i in range(n)]

    sum = 0
    for a in al:
        i = 0
        while True:
            if i * a + 1 > d:
                break

            sum += 1
            i += 1

    print(sum+x)

Submission status: Accepted

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

choco = 0
for _ in range(n):
    ai = int(input())
    choco += (d - 1) // ai + 1

print(choco + x)

Submission status: Accepted

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

choco = 0
for _ in range(n):
    ai = int(input())

    day = 0
    while ai * day + 1 <= d:
        choco += 1
        day += 1

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

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
D, X = nl()

count = X
for i in range(N):
    count += 1
    A = n()
    day = A + 1
    while day <= D:
        count += 1
        day += A
print(count)

Submission status: Accepted

Solution code:

N = int(input())

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

for i in range(N):

    A = int(input())

    cnt = 0
    while True:

        if cnt * A + 1 <= D:
            X += 1
            cnt += 1
        else:
            break

    
print (X)

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input())
    D,X = (int(_) for _ in input().split())
    ans = X
    for i in range(N):
        ans += math.ceil((D/int(input())))
    
    print(ans)
    
if __name__ == '__main__':
    main()

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())
A = [int(input()) for i in range(N)]
answer = 0
for j in range(N):
  answer += int((D - 1) / A[j]) + 1
answer += X
print(answer)

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 + ((D - 1) // A)

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()))

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

print(ans)

Submission status: Accepted

Solution code:
def abc():
    n = int(input())
    d, x = map(int, input().split())
    e = 0
    for i in range(n):
        a = int(input())
        j = 0
        while j * a + 1 <= d:
            e += 1
            j += 1
    print(e + x)


abc()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

# N, M, X = list(map(int, sys.stdin.readline().split()))
# A = np.array(list(map(int, sys.stdin.readline().split())))
#
# print(min(len(A[A > X]), len(A[A<X])))

# A, B, K = list(map(int, sys.stdin.readline().split()))
#
# arr = list(range(A, B + 1))
#
# print('\n'.join(map(str, list(sorted(set(arr[:K] + arr[-K:]))))))


N = int(sys.stdin.readline())
D, X = list(map(int, sys.stdin.readline().split()))
A = [int(sys.stdin.readline()) for _ in range(N)]

c = 0
for a in A:
    c += len(range(1, D + 1, a))
print(c + X)

Submission status: Accepted

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

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

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:
    cur=0
    while a*cur+1<=D:
        ans+=1
        cur+=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)]

cnt = 0

for i in range(N):
    flag = True
    n = 0
    while flag:
        if n*A[i] + 1 <= D:
            cnt += 1
            n += 1
        else:
            flag = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int,input().split())
num = 0
for i in range(n):
  a = int(input())
  b = 1
  while b <= d:
    num += 1
    b += a
print(num+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()))

ans = 0
for i in range(N):
    d = 1
    c = 0
    while True:
        d = (1+A[i]*c)
        if d > D:
            break
        ans += 1
        c += 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())
    for j in range(101):
        if j*a+1 <= d:
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans+x)

Submission status: Accepted

Solution code:
import math
N=int(input())
D,X=map(int,input().split())
for i in range(N):
  A=int(input())
  if A >=D:
    X=X+1
  else:
    X=X+math.ceil(D/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)]

choco = 0

for i in A:
    for j in range(1,D+1,i):
        choco += 1
print(choco + X)

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 a in A:
    for i in range(0,d,a):
        c+=1
print(c+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 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 = list(int(input())for i in range(N))
for i in A:
    for j in range(1,D+1,i):
        X += 1
print(X)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
d, x = map(int, input().split())
day = []
choco = 0
for _ in range(n):
    day.append(int(input()))
for i in day:
    tmp = []
    day_calc = 1
    while day_calc <=d:
        tmp.append(day_calc)
        day_calc += i
    choco += len(tmp)
print(x+choco)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

dateCnt = 0
for ai in a:
  dt = 0
  cnt = 0
  while dt < d:
    dt = 1 + ai * cnt
    if dt <= d:
      dateCnt = dateCnt + 1
    else:
      break
    cnt  = cnt + 1

print(dateCnt + x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
people = int(input())
day, rest = map(int, input().split())

intervals = [int(input()) for _ in range(people)]

eaten = sum(1 + (day - 1) // interval for interval in intervals)

print(rest + eaten)

Submission status: Accepted

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

eaten = 0
for i in a:
    num = 1
    while num <= d:
        eaten += 1
        num += i
print(x+eaten)

Submission status: Accepted

Solution code:
n = int(input())
d, x = [ int(v) for v in input().split() ]

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

Submission status: Accepted

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

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

total = X

for ai in A:
    for d in range(1, D + 1):
        if (d - 1) % ai == 0:
            total += 1

print(total)

Submission status: Accepted

Solution code:
N = int(input())
days, remain = [int(x) for x in input().split()]
A = [int(input()) for _ in range(N)]

for a in A:
    remain += sum(1 for i in range(1, days+1, a))
print(remain)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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


def solve(N: int, D: int, X: int, A: "List[int]"):
    res = X

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

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, D, X, A)

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())
    ans += 1 + (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)]
choco = [0] * n

for i in range(n):
    count = d
    while count > 0:
        count -= a[i]
        choco[i] += 1

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

Submission status: Accepted

Solution code:
N = int(raw_input())
D, X = map(int, raw_input().split())
sum = 0
for i in range(0, N):
	A = int(raw_input())
	day = 1
	while day <= D:
		sum += 1
		day += A
print X+sum

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
A = []
for _ in range(N):
    A.append(int(input()))
ans = X
for aa in A:
    num = 0
    while num * aa + 1 <= D:
        ans += 1
        num += 1

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

Submission status: Accepted

Solution code:
n = int(input())
d,x = map(int, input().split())
sum = 0
for i in range(n):
    a = int(input())
    for j in range(100):
        day = 1 + j*a
        if day <= d:
            sum += 1
        else:
            break
print(x + sum)

Submission status: Accepted

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


def choco(cday):
    sum = 0
    for i in range(day):
        if cday * i + 1 <= day:
           sum += 1
    return sum


csum = sum(list(map(choco, a))) + x
print(csum)

Submission status: Accepted

Solution code:
number = int(input())
date,remaining = map(int,input().split())
A = [int(input()) for i in range(number)]
consume = 0

for i in range(number):
    d = A[i]
    date_spot = 1
    count = 0
    while True:
        if date_spot > date:
            consume += count
            break
        count += 1
        date_spot += d

print(consume+remaining)

Submission status: Accepted

Solution code:
N = int(input())
D,X = map(int,input().split())
g = 0
for _ in range(N):
    a = int(input())
    c = 1
    while c <= D:
        g += 1
        c += a
print(g+X)

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())
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)]
choco = 0
for i in range(N):
    choco += (D - 1) // A[i] + 1
choco += X
print(choco)

Submission status: Accepted

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


def main():
    n = intin()
    d, x = intin()
    alist = intinl(n)

    ans = x

    for a in alist:
        if d % a:
            ans += d // a + 1
        else:
            ans += d // a

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
D,X=[int(x) for x in stdin.readline().rstrip().split()]

data=[]
for i in range(N):
    data.append(int(input()))

ans=X
for j in data:
    if D % j == 0:
        ans += (D/j)
    else:
        ans += 1
        ans += (D//j)

print(int(ans))

Submission status: Accepted

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

count = x

for i in range(n):
    ai = a[i]
    for j in range(1, d+1, ai):
        count += 1

print(count)

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)]

def count(a):
    tmp,cnt,i = 1,0,1
    while tmp <= D:
        cnt += 1
        tmp = a*i+1
        i+=1
    return cnt

cnt = 0
for a in A:
    cnt += count(a)
print(cnt+X)

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

ans = x
for i in a:
    for j in range(1, d + 1, i):
        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)]

sum=0

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

print(x+sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    num = int(input())
    day_num, ans = map(int, input().split())

    day_num -= 1

    for i in range(num):
        data = int(input())
        ans += 1
        ans += day_num // data

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

def eat(freq):
    return (D - 1) // freq + 1

ans = X
for i in range(N):
    ans += eat(int(input()))

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=0
for i in range(n):
  ans+=(d-1)//a[i]+1
print(ans+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()))
    X=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)]
for i in range(1,d+1):
    for j in range(n):
        if a[j]==1:
            x+=1
        elif i%a[j]==1:
            x+=1
print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ipt(N=0):
    if N == 0:
        return list(map(int,input().split()))
    else:
#        return [list(map(int,input().split())) for _ in range(N)]
        return [int(input()) for _ in range(N)]

N=int(input())
D,X=ipt()
A=ipt(N)
cnt=0

for a in A:
    i=0
    while(i * a + 1 <= D):
        cnt+=1
        i += 1
print(cnt+X)

Submission status: Accepted

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

eat = 0
for i in range(1, N+1):
    for n in range((D-1)//A[i]+1):
        eat += 1

print(eat + X)

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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