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: Runtime Error

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

ans = X
for j in range(N):
    a = int(input())
    for i in range(D):
        if i*a + i+1 <= D:
            ans += 1

print(ans)

Submission status: Runtime Error

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

ans = X
for i in range(N):
    a = int(input())
    for i in range(D):
        if i*a + i+1 <= D:
            ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n, d, x;
  cin >> n >> d >> x;
  int tot = x;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    tot += (d - 1) / a + 1;
  }
  cout << tot << '\n';
  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

X = 0
D = 0

def loop():
    i=1
    a = int(input())
    while i*a+1 <= D:
      	yield 1
        i += 1

def readlines():
    global X, D
    N = int(input())
    D, X = map(int, input().split())
    for _ in range(N):
        yield 1+sum(loop())

def main():
    return sum(readlines()) + X
	
if __name__ == "__main__":
    print(main())

Submission status: Runtime Error

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

for i in range(n):
    num.append((d - 1) // a[i] + 1)
#print(num)

ans = x
for i in range(n):
    ans += num[i]
print(ans)

Submission status: Runtime Error

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

choco = 0

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

print(choco)

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

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: Runtime Error

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

cnt=0
for i in range(a,b):
    if str(i) == str(i)[::-1]:
        cnt+=1

print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
from typing import List

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: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
d,x=map(int,input().split())
s=0
for i in range(n):
    w=0
    while d>=w*int(input())+1:
        s+=1
        w+=1
print(s+x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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(1, D+1):
    for j in A:
        if j == 1:
            ans += 1
        eliaf i % j == 1:
            ans += 1

print(ans)

Submission status: Runtime Error

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

A = []
for _ in range(N):
    A.append(int(input().split()))

ans = X

for i in range(1, D+1):
    for j in A:
        if i % j == 1:
            ans += 1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

    
Total = X + B

print(Total)

Submission status: Runtime Error

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

    
Total = X + B

print(Total)

Submission status: Runtime Error

Solution code:
#標準入力
N = int(input())
D, X = list(map(int, input().split()))
A = []
for i in range(N):
    A.append(input())
    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)

Submission status: Runtime Error

Solution code:
#標準入力
N = int(input())
D, X = list(map(int, input().split()))

A = []
for i in range(N):
    a.append(input()) 

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

    
Total = X + B

print(Total)

Submission status: Runtime Error

Solution code:
#標準入力
N = int(input())
D, X = list(map(int, input().split()))

A = []
for i in range(N):
    a.append(input()) 

    
B=[]
for i in range(N):
    B[i] = 1 + A[i]//(D-1)
    
Total = X + sum(B)

print(Total)

Submission status: Runtime Error

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

count = 0
for k in range(n):
    count += int(d/times[k]) + 1

print(count + x)

Submission status: Runtime Error

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

print(res+x)

Submission status: Runtime Error

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

#print(N,D,X,A)
print(sum(A)*D(D+1)/2 + N*D + X)

Submission status: Runtime Error

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

print(ans + d)

Submission status: Runtime Error

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

for A in a:
    choco += int((d-1)/A)
print(c)

Submission status: Runtime Error

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

c = n+x
for A in a:
    choco += int((d-1)/A)
print(c)

Submission status: Runtime Error

Solution code:

n = int(input())
#日
d = int(input())
#合宿終了後のチョコレートの個数
x = int(input())




#i人目のA日目に食べた数を数える
num = 0

#配列
a = []

#３人分
for i in range(n):
    a.append(int(input()))
    for j in range(d):
        if a[i]*j +1 <= d:
            num += 1
    
    
    
    
            
print(num+x)

Submission status: Runtime Error

Solution code:

n = int(input())
#日
d = int(input())
#合宿終了後のチョコレートの個数
x = int(input())




#i人目のA日目に食べた数を数える
num = 0

#配列
a = []

#３人分
for i in range(n):
    a.append(int(input()))

for i in range(n):
    for j in range(d):
        if a[i]*j +1 <= d:
            num += 1
        
    
    
    
    
            
print(num+x)

Submission status: Runtime Error

Solution code:
print(min(int(input()), int(input()))+min(int(input()), int(input())))

Submission status: Runtime Error

Solution code:
import sys
std = sys.stdin.read()
std_arr = std.split('\n')
persons = int(std_arr[0])
li = std_arr[1].split()
day = int(li[0])
mod = int(li[1])
patici = {}
p = 0
for i in range(2, len(std_arr)): 
    patici[p] =  int(std_arr[i])
    p += 1

if p != persons:
    print('lack of argument!!!')
    exit()

choko = 0
for i in patici.keys():
    for x in range(0, 100):   
        if (x + 1) * patici[i] + 1 < day :
            print((x + 1) * patici[i] + 1 )
            choko += 1

print(choko + mod)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n,d,x,y=0;
    cin>>n>>d>>x;
    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    for(int i=0;i<n;i++){
            int j=0;
            while((j*a[i])+1<=d){
                    y++;
                    j++;
            }
    }
    cout<<x+y;
return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
DX = list(int(i) for i in input().split())
A = []
for i in range(N):
     A.append(input())


ai =[]
ans = N + DX[1]
for i in range(N):
    for n in range(DX[0]):
        if n*A[i]+1 <= DX[0]:
            ai.append(n)
    ans += max(ai)
    ai = []
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
DX = list(int(i) for i in input().split())
A = []
for i in range(N):
     A.apend(input())
ai =[]
ans = N + DX[1]
for i in range(N):
    for n in range(DX[0]):
        if n*A[i]+1 <= DX[0]:
            ai.append(n)
    ans += max(ai)
    ai = []
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
DX = list(int(i) for i in input().split())
A = []
for i in range(N):
     a.apend(input())
ai =[]
ans = N + DX[1]
for i in range(N):
    for n in range(DX[0]):
        if n*A[i]+1 <= DX[0]:
            ai.append(n)
    ans += max(ai)
    ai = []
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b,c=map(int,input().split())
d=0
while d<a:
  e=int(input())
  if e>0: 
    f=b//e+1
  else:
    f=b//e
  c+=f
print(c)

Submission status: Runtime Error

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

total = X + sum(A)
print(total)

Submission status: Runtime Error

Solution code:
a=int(input())
b,c=map(int,input().split())
d=0
f=0
while d<a:
  e=(b//int(input()))
  if e==0:
    f+=e
  else:
    f+=(e+1)
    c+=f
    d+=1
    print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
b,c=map(int,input().split())
d=0
while d<a:
  e=(b//int(input()))
  if e==0:
    f+=e
  else:
    f+=(e+1)
    c+=f
    d+=1
    print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
d, x = map(int, input().split())
a = []
s = 0

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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