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:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())
n = I()
D,X = readInts()
ans = 0
for i in range(n):
    a = I()
    ans += (D//a)+1 if D%a else D//a
print(X+ans)

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+=1
    for j in range(1,d+1):
        if 1+j*A[i] <= d:
            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)
q=x
for i in range(n):
    q+=1
    for j in range(1,d+1):
        if 1+j*A[i] <= d:
            q+=1
print(q)

Submission status: Accepted

Solution code:
_, D, X, *A = map(int, open(0).read().split())

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

print(ans)

Submission status: Accepted

Solution code:
def LI():
    return list(map(int, input().split()))


N = int(input())
D, X = LI()
ans = X
for _ in range(N):
    A = int(input())
    for i in range(100):
        if A*i+1 <= D:
            ans += 1
            continue
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from bisect import bisect_left,bisect_right
from math import sqrt,gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint
from statistics import mean,median,mode
import sys
sys.setrecursionlimit(10 ** 6)

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse=False):
    data.sort(key=lambda x:x[col],reverse=revese)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def mydictvaluesort(dictionary):
    return sorted( dictionary.items(), key=lambda x:x[1] )

def mydictkeysort(dictionary):
    return sorted( dictionary.items(), key=lambda x:x[0] )

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input()) for _ in range(n) ]

# ddict = defaultdict(lambda: 0)
# ddict = defaultdict(lambda: 1)
# ddict = defaultdict(lambda: int())
# ddict = defaultdict(lambda: list())
# ddict = defaultdict(lambda: float())

n = I()
d,x = MI()
a = CI(n)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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 x in A:
  ans += (D-1)//x+1
print(ans)

Submission status: Accepted

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

ans += x
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):
    a = A[i]
    X += (D-1)//a+1
print(X)

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    n = int(input())
    people=[]
    d,x = map(int,input().split())
    people=list([int(input()) for _ in range(n)])
    chocolates=[]
    choco=1

    for human in people:
        for day in range(1,d+1):
            if d >= human * day +1:
                choco+=1
        chocolates.append(choco)
        choco=1
    print(sum(chocolates)+x)

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import copy
N=int(input())
a=[int(c) for c in input().split()]
D=a[0]
X=a[1]
a = [int(input()) for i in range(N)]

choco = 0
for i in range(N):
    cnt=0
    while cnt*a[i]+1<=D:
        choco+=1
        cnt+=1

print(choco+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:
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:
n = int(input())
d, x = map(int, input().split())
a_l = [ int(input()) for _ in range(n) ]

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

Submission status: Accepted

Solution code:
N = int(input())
D,X = map(int,input().split())
con = 0
for i in range(N):
  a = int(input())
  if a != 1:
    for i in range(1 , D + 1):
      if i % a == 1:
        con += 1
  elif a == 1:
    con += D
print(X + con)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
d,x=map(int, input().split())
ans = x
for i in range(n):
    t = int(input())
    ans += d//t
    if d%t != 0:
        ans += 1
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())
    cnt = 0
    for j in range(100):
        if j*a + 1 <= d:
            cnt += 1
    ans += cnt
print(ans + x)

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int,input().split())
d = {}
for i in range(1,N+1):
  d[i] = int(input())

pieces = 0
for day in range(1,D+1):
  for person in range(1,N+1):
    if (day - 1) % d[person] == 0:
      pieces += 1
 
pieces += X
print(pieces)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().strip())
d, x = [int(x) for x in stdin.readline().split()]

a_lst = []
for _ in range(n):
  a_lst.append(int(stdin.readline().strip()))

print(sum([(d - 1) // a + 1 for a in a_lst]) + 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())
    for j in range(100):
        if a*j+1<=d:
            c+=1
        else:
            break
print(x+c)

Submission status: Accepted

Solution code:
def f(a, d):
    b = 1
    cnt = 1
    while True:
        b += a
        if d < b:
            break
        cnt += 1

    return cnt


def main():
    n = int(input())
    d, x = map(int, input().split())
    ans = 0

    for _ in range(n):
        a = int(input())
        ans += f(a, d)

    print(ans + 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)]

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

Submission status: Accepted

Solution code:
# B - Chocolate
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:
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
e=0
d=[int(input()) for i in range(a)]
for i in range(a):
  e=e+int((b-1)/d[i])+1
print(e+c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC092
# 参加者
N = int(input())
# D日間の合宿でX個のチョコが残った
D, X = map(int, input().split())
# 参加者iは,1,Ai+1,2Ai+1..目にチョコを一つ食べる
A = [int(input()) for _ in range(N)]

eaten = 0
for i in range(N):
    day = 0
    cnt = 0
    while True:
        day = A[i]*cnt + 1
        if day <= D:
            eaten += 1
            cnt += 1
        else:
            break
print(eaten+X)

Submission status: Accepted

Solution code:
from sys import stdin
def input():
    return stdin.readline().strip()

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:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    D, X = map(int, readline().split())
    ans = X

    for _ in range(N):
        a = int(readline())
        for i in range(1, D + 1, a):
            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 _ in range(n)]
c = 0
for i in range(n):
  c += (d - 1) // a[i] + 1
print(x + c)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    v = list(map(int, input().split()))
    d = v[0]
    x = v[1]
    a = []

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

    answer = 0

    for i in range(len(a)):
        eat = 0
        day = 1
        while day <= d:
            eat += 1
            day += a[i]
        answer += eat

    answer += x

    print(answer)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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:
#!/usr/bin/env python3

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

d -= 1
ans = 0
for i in a:
    ans += d//i+1

print(ans+x)

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:
n = int(input())
d,x = map(int, input().split())
a = [int(input()) for i in range(n)]
a_eat = []
for i in range(n):
    y = 1
    j = 1
    while j+a[i] <= d:
        y += 1
        j += a[i]
    a_eat.append(y)

print(sum(a_eat)+x)

Submission status: Accepted

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

choco = []
while True:
	try:
		choco.append(int(input()))
	except EOFError:
		break

choco = [i * x + 1 for i in range(d) for x in choco if i * x + 1 <= d]

print(x + len(choco))

Submission status: Accepted

Solution code:
N = int(input())
D, X = map(int, input().split())
A = [int(input()) for _ in range(N)]
eat = lambda x: (D-1)//x+1
ans = sum(eat(a) for a in A) + X
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):
    A = int(input())
    ans += math.ceil(D / A)

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

print(res)

Submission status: Accepted

Solution code:
N = int(input())

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

choco = 0

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

print(choco+X)

Submission status: Accepted

Solution code:
a=int(input())
b,c=map(int,input().split())
s=[]
total=a+c
for i in range(a):
    s.append(int(input()))
for i in s:
    for j in range(2,b+1):
        if i==1:
            total+=1
        elif j%i==1:
            total+=1
print(total)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
d, x = map(int, input().split())
ans = x
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())
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())
res = X
for _ in range(N):
    res += (D-1)//(int(input())) + 1
print(res)

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:
n, d, x, *a = map(int, open(0).read().split())
ans = x
for i in a:
  ans += (d - 1) // i + 1
print(ans)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    d, x = nm()
    ans = x
    for i in range(n):
        a = ni()
        ans += (d - 1) // a + 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    d, x = map(int, input().split())
    al = list()
    ans = 0
    for i in range(n):
        a = int(input())
        al.append(a)
    cl = list()
    for i in range(n):
        counter = 1
        day = 1
        while day + al[i] <= d:
            counter += 1
            day += al[i]
        cl.append(counter)
    ans = 0
    for i in cl:
        ans += i
    ans += x
    print(ans)
resolve()

Submission status: Accepted

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

a = [int(input()) for _ in range(n)]

sum = x

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

print(sum)

Submission status: Accepted

Solution code:
import sys
from collections import deque
#import numpy as np
import math
#sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    return

if __name__=='__main__':
    n = I()
    d,x = IL()
    days = 0
    for _ in range(n):
        a = I()
        tmp = 1
        count = 1
        while tmp<=d:
            days += 1
            tmp = count*a + 1
            count += 1
    ans = days + x
    print(ans)
    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+a[i]-1)//a[i])
print(ans)

Submission status: Accepted

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

total = 0

for i in range(N):
  day = 1
  while 1:
    if day > D:
      break
    else:
      total += 1
      day += A[i]
else:
  print(X + total)

Submission status: Accepted

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

c = 0

for i in range(n):
  cd = 0
  count = 1
  for j in range(d):
    if cd + a[i] <= d - 1:
      cd = cd + a[i]
      count += 1
  
  c = c+count
    
print(c + x)

Submission status: Accepted

Solution code:
n = int(input())
d, x = list(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())
c = [0 for i in range(d)]
a = []
for i in range(n):
  a.append(int(input()))

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

Submission status: Accepted

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

choco = []
for a in A:
    for d in range(100):
        choco.append(a*d+1)

print(len([i for i in choco if i <= D])+X)

Submission status: Accepted

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

sum = 0
for i in range(N):
    a = A[i]
    sum += ((D - 1) // a) + 1

print(sum + X)

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

Submission status: Accepted

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

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.ceil(d/num)
  
print(ans+x)

Submission status: Accepted

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

ans=0

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
import numba
from numba import jit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@jit
def main(n, d, x, a):
  ans = n + x
  for i in a:
    ans += (d-1)//i
  return ans

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

Submission status: Accepted

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

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]+1
print(x)

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
INF = float('inf')


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

    N = ii()
    D, X = il()
    ret = X

    for n in range(N):
        A = ii()
        ret += (D - 1) // A + 1
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
INF = float('inf')


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

    N = ii()
    D, X = il()
    ret = X

    for n in range(N):
        A = ii()
        d, m = divmod(D, A)
        if m == 0:
            ret += D // A
        else:
            ret += D // A + 1
    print(ret)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

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

print(x)

Submission status: Accepted

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

for i in range(len(a)):
    t = d // a[i]
    for j in range(t+1):
        if d >= j*a[i]+1:
            cnt += 1
            
print(cnt+x)

Submission status: Accepted

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

Submission status: Accepted

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

count_chocolate_list = []

for i in range(N):
    k = 0
    chocolate_day_list = []

    while (k*A_list[i] + 1 <= D):
        chocolate_day_list.append(k*A_list[i] + 1)
        chocolate_count = len(chocolate_day_list)
        k += 1
        
    count_chocolate_list.append(chocolate_count)
        
    i += 1
    
ans = sum(count_chocolate_list) + X

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans + k)

Submission status: Accepted

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

ans = X

for j in range(1, D + 1):
    for i in range(N):
        if I[i] == j:
            ans += 1
            I[i] += A[i]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

for i in range(N):
    for j in range(1, D + 1, A[i]):
        X += 1

print(X)

Submission status: Accepted

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

sum = 0
for i in participants:
  choco = (d-1)//i + 1
  sum += choco

ans = sum + x
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())
    ans += (D-1)//(A)+1
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())
  res = (d-1)//a
  ans += res+1
  
print(ans)

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())
sum = X

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

Submission status: Accepted

Solution code:
def choco(d,ai):
    day = 1
    ans = 0
    while day<=d:
        ans += 1
        day += ai
    return ans

n = int(input())
d,x = map(int,input().split())
ans = 0
for i in range(n):
    a = int(input())
    ans += choco(d,a)
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 + N
for i in A:
    day = 1
    while True:
        day += i
        if day <= D:
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

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