Problem:


Score: 300 points

Problem Statement

In 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!

There are five means of transport in this empire:

Train: travels from City 1 to 2 in one minute. A train can occupy at most A people.

Bus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.

Taxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.

Airplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.

Ship: travels from City 5 to 6 in one minute. A ship can occupy at most E people.

For each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).

There is a group of N people at City 1, and they all want to go to City 6.

At least how long does it take for all of them to reach there? 
You can ignore the time needed to transfer.  

Constraints

1 \leq N, A, B, C, D, E \leq 10^{15}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A
B
C
D
E

Output

Print the minimum time required for all of the people to reach City 6, in minutes.

Sample Input 1

5
3
2
4
3
5

Sample Output 1

7

One possible way to travel is as follows.
First, there are N = 5 people at City 1, as shown in the following image:

In the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.

In the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.

In the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.

From then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.

There is no way for them to reach City 6 in 6 minutes or less.

Sample Input 2

10
123
123
123
123
123

Sample Output 2

5

All kinds of vehicles can occupy N = 10 people at a time.
Thus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.  

Sample Input 3

10000000007
2
3
5
7
11

Sample Output 3

5000000008

Note that the input or output may not fit into a 32-bit integer type.



Sample input:
5
3
2
4
3
5


Sample output:
7

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
A = []

A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))


neck = A.index(min(A))
ans = (math.ceil(n/min(A))+4-neck)

print(ans)
print(neck)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [int(input()) for i in range(5)]
tmp = 0
for i in range(5):
  if l[i] > N:
    tmp = 1
if tmp == 1:
  print(5)
else:
  ans = 0
  ans += (N//min(l))+1
  ans += 5-l.index(min(l))
  if l.index(min(l))==0:
    ans-=1
  print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ps = [int(input()) for _ in range(5)]
min_p = min(ps)
times = n // min_p
print(times + 5)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
if N < min(A,B,C,D,E):
    print(5)
else:
    print(5 + N //min(A,B,C,D,E)-1)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = []
for i in range(5):
  a = int(input())
  A.append(a)
  
#最後尾に着目
#i -> i+1 の移動にかかる時間: iに最後尾の人がついた時点でのiの人数 Pi とすると
#time = Pi//A[i] + 1 (Pi%A[i] != 0) ,Pi//A[i]  (Pi%A[i] == 0)
t = 0
p = N
for i in range(5):
  if(p%A[i] != 0):
    t += p//A[i] + 1
  else:
    t += p//A[i]
  if(i != 4):
   p = p - A[i+1]*(t-i-1)
   if(p <= 0):
     p = 1
print(t)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

if min(a,b,c,d,e) == a:
  if N % a == 0:
    print(N/a + 4)
  else:
    print(N//a + 5)
elif min(a,b,c,d,e) == b:
  if N % b == 0:
    print(N/b + 4)
  else:
    print(N//b + 5)
elif min(a,b,c,d,e) == c:
  if N % c == 0:
    print(N/c + 4)
  else:
    print(N//c + 5)
elif min(a,b,c,d,e) == d:
  if N % d == 0:
    print(N/d + 4)
  else:
    print(N//d + 5)
elif min(a,b,c,d,e) == e:
  if N % e == 0:
    print(N/e + 4)
  else:
    print(N//e + 5)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
input_list = [a,b,c,d,e]
input_list.sort()
print(n // input_list[0] +5)

Submission status: Wrong Answer

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


def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    x = min(A,B,C,D,E)
    print(5+int(N/x))
    return


# Generated by 1.1.3 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
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    solve(N, A, B, C, D, E)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

transp = []

for i in range(5):
    transp.append(int(input()))
    
transp_ordered = sorted(transp)

print(int(n/transp_ordered[0]) + 5) if transp[4] != transp_ordered[0] else print(int(n/transp_ordered[0]) + 4)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
x=[a,b,c,d,e]
ans=n//(min(x))+5
print(ans)

Submission status: Wrong Answer

Solution code:
ninzu = int(input())
ps = [ninzu,0,0,0,0,0]

able = []
for i in range(5):
    able.append(int(input()))

rissoku = min(able)
print(ninzu//rissoku + 5)

Submission status: Wrong Answer

Solution code:
import numpy as np

n = float(input())
list = [int(input()) for i in range(5)]

l = np.array(list)
print(n//l+5)

Submission status: Wrong Answer

Solution code:
N = int(input())
city = []
for i in range(5):
    city.append(int(input()))
gate = min(city)
if N <= gate:
    print(5)
else:
    print(5 + N//gate)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[]
for i in range(5):
    b=int(input())
    a.append(b)
a.sort()
if n==a[0]:
    print("5")
    exit()
    
b=int(n/a[0])
if (n%a[0])>0:
    b=b+1
print(b+5)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
for i in range(5):
  l.append(int(input()))
l = sorted(l)
print(int((n-1)/min(l)))
print(int((n-1)/min(l))+5)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

aa = math.ceil(n / a)
bb = math.ceil(n / b)
cc = math.ceil(n / c)
dd = math.ceil(d / d)
ee = math.ceil(e / e)

lag = max([aa, bb, cc, dd, ee]) - 1

print(5 + lag)

Submission status: Wrong Answer

Solution code:
import numpy as np

n = []
s = 0
l = int(input())

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

n = np.array(n)
for idx in range(len(n)-1):
    k = int(np.floor(l/n[idx])+1)
    s += k
    if n[idx]/n[idx+1] < 1:
        l = l % n[idx]
    else:
        l -=n[idx+1]*(k-1)
s += int(np.floor(l/n[4])+1)
print(s)

Submission status: Wrong Answer

Solution code:
inp = []
for i in range(6):
    inp.append(int(input()))
n = inp[0]
inp.pop(0)

a = sorted(inp)

resu = n//a[0] + 1 + 4
print(resu)

Submission status: Wrong Answer

Solution code:
inputs = [int(input()) for i in range(6)]
N = inputs[0]
A = inputs[1]
B = inputs[2]
C = inputs[3]
D = inputs[4]
E = inputs[5]

T = 5

def func(T, x, y):
    val = x // y 
    remain = x % y
    T += val
    if remain==0:
        T -= 1
    return T

for x,y in zip([N,A,B,C,D],[A,B,C,D,E]):
    T = func(T, x, y)

print(T)

Submission status: Wrong Answer

Solution code:
li = []
n = int(input())
for i in range(5):
    li.append(int(input()))
print(5 + n // min(li))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
list = []
for i in range(5):
    list.append(int(input()))
#print(list)
twn = [0] * 6
twn[0] = N
#print(twn)

ans = []
for i in range(5):
    ans.append(math.ceil(N / list[i]))
#print(ans)
#print(sum(ans))

answer = ans[0] + ans[1] - 1 + ans[2] - 1 + ans[3] - 1 + ans[4]
#print(answer)
print(max(sum(ans),answer))

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[]
for i in range(5):
    l.append(int(input()))
m=min(l)
k=[]
if m<N:
    if N%2!=0:
        b=N//m
        print(b+5)
    else:
        b=N//m
        print(b+5-1)
else:
    print(5)

Submission status: Wrong Answer

Solution code:
n = int(input())

l = []
for _ in range(5):
    l.append(int(input()))

min_ = min(l)


print(n//min_ + 5)

Submission status: Wrong Answer

Solution code:
mod = 0
civil = [0]*6
for i in range(6):
    civil[i] = int(input())
for i in range(5):
    thtime = civil[i] // civil[i+1]
    if civil[i] % civil[i+1] != 0:
        mod = mod + 1
        if thtime == 0:
            civil[i+1] = civil[i]
    mod = mod + thtime 

print(mod)

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

min_limit = np.min([a, b, c, d, e])

if n== min_limit:
  wait = 0
else:
  wait = n//min_limit

print(5+wait)

Submission status: Wrong Answer

Solution code:
N = int(input())
numbers = [int(input()) for _ in range(5)]
flag = True

for number in numbers:
    if number < N:
        flag = False
        
if flag:
    print(5)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

A=[]
A.append(a)
A.append(b)
A.append(c)
A.append(d)
A.append(e)

A.sort()
m=A[0]
ans = int(n/m) + 4 + 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

capa = [a,b,c,d,e]


min_capa = min(capa)


print(max(1, int(n / min_capa + 0.5)) + 4)

Submission status: Wrong Answer

Solution code:
nums = []
N = int(input())
for _ in range(5):
    nums.append(int(input()))
neck = min(nums)
print(5+N//neck)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

array = [a,b,c,d,e]

if n==min(array): print(5)
else: print(5 + (n//min(array)))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

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

time = 0
n = N

for i in range(5):
  time += math.ceil(n / abcde[i])
  last = n % abcde[i] # 最後の1回で移動する人数
  if last == 0:
    last = min(abcde[i], n)
  if i < 4: # 次の駅でまだ残っている人数
    n = last + max((N-last) - (time-1) * abcde[i+1], 0)

print(time)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(input()),int(input()),int(input()),int(input()),int(input())]
m=min(l)
t= (n-1)//m + 5 -1
print(t)

Submission status: Wrong Answer

Solution code:
N = int(input())
trans = [int(input()) for i in range(5)]
t = min(trans)
if N == t:
    print(5)
else:
    print(N//t + 5)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

m = min(a, b, c, d, e)
print(5 + n // m)

Submission status: Wrong Answer

Solution code:
N = int(input())
city = []
for i in range(5):
    city.append(int(input()))
gate = min(city)
if N >= gate:
    print(5)
else:
    print(5 + N//gate)

Submission status: Wrong Answer

Solution code:
a=[0,0,0,0,0]
n=[0,0,0,0,0]
N=int(input())
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
n[0]=N
for i in range(5):
  n[i]=-(-N // a[i])
time=n[0]  
for i in range(4):
  if n[i]>=n[i+1]:
    time+=1
  else:
    time+=n[i+1]+1-n[i]
print(time)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

a = N // A + 1
b = 1
bita = 0
bkuru = A
bkita = A

c = 1
cita = 0
ckuru = B
ckita = B

d = 1
dita = 0
dkuru = C
dkita = C

e = 1
eita = 0
ekuru = D
ekita = D

if A > B:
    bita = ( A - B ) * ( a - 1 )
    bkita = N % A
    b = (bita + bkita) // B + 1
else:
    ckuru = bkuru

if B > C:
    cita = ( ckuru - C ) * ( b - 1 )
    ckita = (bita + bkita) % B
    c = (cita + ckita) // C + 1
else:
    dkuru = ckuru

if D > C:
    dita = ( dkuru - D ) * ( c - 1 )
    dkita = (cita + ckita) % C
    d = (dita + dkita) // D + 1
else:
    ekuru = dkuru

if E > D:
    eita = ( ekuru - E ) * ( d - 1 )
    ekita = (dita + dkita) % D
    e = (eita + ekita) // E + 1

print(a+b+c+d+e)

Submission status: Wrong Answer

Solution code:
from math import ceil
from itertools import permutations
N=int(input())
A=[]
B=[]
mi=10**10
T=False
for i in range(5):
    a=float(input())
    A.append(a)
B.append(ceil(N/A[0]))
mi=A[0]

for i in range(4):
    if A[i+1]<mi:
        B.append(B[i]-ceil(N/A[i])+ceil(N/A[i+1])+1)
        mi=A[i+1]
    else:
        B.append(B[i]+1)

print(B[-1])

Submission status: Wrong Answer

Solution code:
N=int(input())
S=[]
for i in range(5):
    S.append(int(input()))
    
S.sort()
count=0
count=5+(N//S[0])
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
x=n//min(l)
print(5+x-1)

Submission status: Wrong Answer

Solution code:
N = int(input())
city = []
for i in range(5):
    city.append(int(input()))
gate = min(city)
if N == gate:
    print(5)
else:
    print(5 + N//gate)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(5):
    inp = int(input())
    a.append(inp)
mini = min(a)
time = int(n/mini) +1
print(time+4)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []

for i in range(5):
    a = int(input())
    li.append(a)

kaisuu = 0

for i in range(5):
    if i == 0:
        if N % li[i] == 0:
            kaisuu = N // li[i]
        else:
            kaisuu = N // li[i] + 1
    else:
        # もし前の部分全部見て自分より小さい数があれば + 1
        flg = 0
        minsuu = float("inf")
        for j in range(i):
            if li[j] <= li[i]:
                flg = 1
                break

            if minsuu > li[j]:
                minsuu = li[j]

        if flg == 1:
            kaisuu += 1
        else:
            # もしその一番小さい数よりも小さい数が来たら
            if N < minsuu:
                minsuu = N

            if minsuu % li[i] == 0:
                kaisuu += N // li[i] - 1  # minsuu // li[i]
            else:
                kaisuu += N // li[i]   # minsuu // li[i] + 1

print(kaisuu)

Submission status: Wrong Answer

Solution code:
li=[0]*6
for i in range(6):
  li[i]=int(input())
cnt=li[1] 
ans=(li[0]-1)//li[1]+1
#print(ans)
for i in range(4):
  if li[i+2]<cnt:
    ans+=(li[0]-1)//li[i+1]+1
    cnt=li[i+1]
  else:
    ans+=1 
  #print(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
pas = [0]*5
for i in range(5):
  pas[i] = int(input())
min_pas = min(pas)
times = N//min_pas
times += 5
print(times)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
if n%a==0:
  A=1
else:
  A=int(n//a)+1
if n%b==0:
  B=0
else:
  B=int(n//b)+1
if n%c==0:
  C=1
else:
  C=int(n//c)+1
if n%d==0:
  D=1
else:
  D=int(n//d)+1
if n%e==0:
  E=1
else:
  E=int(n//e)+1
f=A
listA=[A,B,C,D,E]
for i in range(1,5):
    if listA[i-1]-1>=listA[i]:
        f=f+1
    elif listA[i-1]-1<listA[i]:
        f=f+listA[i]-listA[i-1]+1
print(f)

Submission status: Wrong Answer

Solution code:
N = int(input())
t = [int(input()) for i in range(5)] 

m = min(t)
dN = N//m
ans = 5 + dN
if m == 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

m = min(a, b, c, d, e)
print(5 + n//m)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = [int(input()) for i in range(5)]
#print(li)
mn = min(li)
#print(mn)
gn = n//mn+1
#print(gn)
print(5+gn-1)

Submission status: Wrong Answer

Solution code:
capacity = []
n = int(input())
for i in range(5):
    num = int(input())
    capacity.append(num)
print(int(n/min(capacity))+5)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

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

time = 0
n = N

for i in range(5):
  time += math.ceil(n / abcde[i])
  last = n % abcde[i] # 最後の1回で移動する人数
  if last == 0:
    last = min(abcde[i], n)
#  print(last, abcde[i], n)
  if i < 4: # 次の駅でまだ残っている人数
    n = last + max(N - time * abcde[i+1], 0)

print(time)

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[]
for i in range(5):
    l.append(int(input()))
m=min(l)
k=[]
if m<5:
    b=N//m
    print(b+5)
else:
    print(5)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[]
for i in range(5):
    data.append(int(input()))
    
ans=(N//sorted(data)[0])+5
if set(data)=={N}:
    ans=5
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(input()),int(input()),int(input()),int(input()),int(input())]
m=min(l)
t= (n-1)//m + 5 -1
if (n%m) : t+=1
print(t)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

if N //  min(a,b,c,d,e) == 0:
  	print(N // min(a,b,c,d,e) + 4)
else :
	print(N // min(a,b,c,d,e) + 5)

Submission status: Wrong Answer

Solution code:
import sys
import math

def main(inp):
    N=int(next(inp).split()[0])
    cap = [int(next(inp).split()[0]) for _ in range(5)]
    
    time=math.ceil(N/cap[0])
    
    for i in range(1,5):
        if(cap[i-1]<=cap[i]):
            time+=1
        elif(cap[i-1]>=N):
            time+=math.ceil(N/cap[i])
        else: time+=math.ceil(N/cap[i])-1
            
    return time
  
print(main(sys.stdin))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
mi = 0
mA = 1e16
for i in range(5):
    if (A[i] < mA):
        mA = A[i]
        mi = i
print((N // A[mi]) + (5 - mi) + mi)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = []
for i in range(5):
    x.append(int(input()))
minx = min(x)
if n <= minx:
    print(5)
else:
    w = n // minx
    print(w + 5)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[]
for i in range(5):
    b=int(input())
    a.append(b)
a.sort()
b=int(n/a[0])
if (n%a[0])>0:
    b+1
print(b+5)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = [int(input()) for i in range(5)]
n.sort()
if N <= n[0]:
    print(5)
elif N % n[0] == 0:
    print((N / n[0]) + 4)
else:
    print((N // n[0]) + 5)

Submission status: Wrong Answer

Solution code:
N = int(input())
t = [int(input()) for _ in range(5)]
min_t = min(t)
index = t.index(min_t)
num = N // min_t
if N % min_t != 0:
    num += 1
print(num + 4-index)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [int(input()) for _ in range(5)]
min_n = min(lst)
x = n//min_n
y = len(lst)
print(x+y)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

list_t = [A,B,C,D,E]
lowest = np.argmin(list_t)
a = N // list_t[lowest]
print(a + 5)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
num = [int(input()) for i in range(5)]

count = 0
for i in range(len(num)):
    if i == 0:
        if n > num[i]:
            count += math.ceil(n / num[i]) - 1
        else:
            count += 1
    else:
        if num[i-1] > num[i]:
            count += math.ceil(num[i-1] / num[i])
        else:
            count += 1

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
trans = [int(input()) for i in range(5)]
t = min(trans)

print(N//t + 5)

Submission status: Wrong Answer

Solution code:
N = int(input())
city = []
for i in range(5):
    city.append(int(input()))
gate = min(city)
print(5 + N//gate)

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[]
for i in range(5):
    l.append(int(input()))
m=min(l)
k=[]
if m<N:
    b=N//m
    print(b+5)
else:
    print(5)

Submission status: Wrong Answer

Solution code:
n=int(input())
limit=[]
for i in range(5):
  a=int(input())
  limit.append(a)
time=n//min(limit)
if min(limit)%10==0:
  time-=1
print(time+5)

Submission status: Wrong Answer

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

people = int(input())
capacities = [int(input()) for i in range(5)]
capacities = sorted(capacities)
print(5 + int(people/capacities[0]))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(input())for _ in range(5)]
A.sort()
if A[0]==N:
    print(5)
else:
    print(N//A[0]+5)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

min = min(a,b,c,d,e)

if min != 0:
    s = n // min
    ans = s + 5
else:
    ans = 0

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = [int(input()) for x in range(5)]
B = []
cnt=0
for i in range(5):
    if A[i]%n==0 or A[i]>n:
        B.append(int(n/A[i]))
        cnt+=1
    else:
        B.append(int(n/A[i])+1)
if cnt==5:
    print(5)
else:
    print(max(B)+4)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(5)]

res = N // min(A) + 5

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for i in range(5)]
A.sort()
cnt = N//A[0]
if cnt>1:
    print(cnt+5)
else:
    print(5)

Submission status: Wrong Answer

Solution code:
n = int(input())
tl=[int(input()) for i in range(5)]

a = n // min(tl)

print(a + 5)

Submission status: Wrong Answer

Solution code:

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

key = min(c)

ans = 0

if N % key == 0:
    ans = N / key
else:
    ans = N // key + 1

print(ans + 4)

Submission status: Wrong Answer

Solution code:
n = int(input())

transp = []

for i in range(5):
    transp.append(int(input()))
    
transp.sort()

print(int(n/transp[0]) + 5)

Submission status: Wrong Answer

Solution code:
i = [int(input().strip()) for i in range(6)]


for s in range(1,6):
  if s == 1:
    minimum = i[s]
  else:
    if minimum > i[s]:
      minimum=i[s]

group = (i[0] // minimum) + 1
print(group + 4)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [n,a,b,c,d,e]
mi = n
wait = 0
for t in [a,b,c,d,e]:
  w = int((mi-0.001) / t)
  if 0 < w:
    mi = t
    wait += w

print(5 + wait)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

print(N // min(a,b,c,d,e) + 5)

Submission status: Wrong Answer

Solution code:
l = [int(input()) for _ in range(6)]
N = l[0]
l = l[1:]

c = [0] * 5
for i in range(len(l)):
    if N > l[i]:
        c[i] = N - l[i]
        N = l[i]

res = 0
for i in range(len(c)):
    if c[i] > 0 and i == 0:
        res += int(c[i]/l[i]) + 1
    elif c[i] > 0:
        if int(c[i]/l[i])+1 >= i:
            nokori = c[i] - int(c[i]/l[i])*l[i]
            res += int((c[i]+nokori)/l[i])

print(5+res)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
A=[int(input()) for i in range(5)]

flag=True
for i in A:
  if i<n:
    flag=False
if flag==True:
  print(5)
  exit()
ans=0
for a in A:
  if n>a:
    ans+=(n//a)
    n=a
print(ans+5)

Submission status: Wrong Answer

Solution code:
#a,b,c = map(int,inpput().split(" "))
n = int(input())
#print(a,b,c)
t=[]

for i in range(5):
    t.append(int(input()))
#n = int(input())
long = min(t)

ti = int(n/long)
if ti*n == long:
    pass
else:
    ti+=1

print(ti+4)

Submission status: Wrong Answer

Solution code:
N = int(input())
abcde = [int(input()) for i in range(5)]
x = min(abcde)
y = N//x if N % x != 0 else N/x - 1
print(5+y)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

import math

transport = [a, b, c, d, e]
time = 0
n_people = n
for i in range(5):
    if i >= 1:
        if transport[i - 1] > transport[i]:
            n_people  = left + transport[i - 1] % transport[i]
        else:
            n_people = left
    time += math.ceil(n_people / transport[i])
    left = n_people % transport[i]

print(time)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

res = [n, 0, 0, 0, 0, 0]
res = [n-a, a, 0, 0, 0, 0]
res = [n-2*a, 2*a-b, b, 0, 0, 0]
res = [n-3*a, 3*a-2*b, 2*b-c, c, 0, 0]
res = [n-4*a, 4*a-3*b, 3*b-2*c, 2*c-d, d, 0]
res = [n-5*a, 5*a-4*b, 4*b-3*c, 3*c-2*d, 2*d-e, e]

sum_time = 0

def calc_time(num, n, x):
    if n % x == 0:
        res = n // x - num
        if res < 1:
            res = 1
        else:
            pass
    else:
        res = n // x - num + 1
        if res < 1:
            res = 1
        else:
            pass
    return res

sum_time += calc_time(0, n, a)
if a <= b:
    sum_time += 1
else:
    sum_time += calc_time(1, n, b)
if b <= c:
    sum_time += 1
else:
    sum_time += calc_time(2, n, c)
if c <= d:
    sum_time += 1
else:
    sum_time += calc_time(3, n, d)
if d <= e:
    sum_time += 1
else:
    sum_time += calc_time(4, n, e)
print(sum_time)

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

wait = n//np.min([a, b, c, d, e])
print(5+wait)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

v = [N, A, B, C, D, E]
m = min(v[1:])
index = v.index(m)
ans = N // m + index

for i in range(index+1, len(v)):
  ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

def std_input():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    return N, A, B, C, D, E


N, A, B, C, D, E = std_input()

arr = (np.array([np.ceil(N/A), np.ceil(N/B), np.ceil(N/C), np.ceil(N/D), np.ceil(N/E), 0]).astype(int))

diff = arr[1:6] - arr[0:5]


print(max(arr)+np.sum(diff[diff>0])+4-np.where(arr==np.max(arr))[0][0])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a,b,c,d,e]
mi = l.index(min(l))

if n < l[mi]:
  print(5)
else:
  print(5 + n//l[mi])

Submission status: Wrong Answer

Solution code:
N = int(input())
a= int(input())
b= int(input())
c= int(input())
d= int(input())
e= int(input())

min_i = -1
min_kazu = 10**20
for i, p in enumerate([a, b, c, d, e]):
    if p < min_kazu:
        min_kazu = p
        min_i = i

nokori = 5-min_i
print(5+N//min_kazu)

Submission status: Wrong Answer

Solution code:
def trans(x1, A):
    if x1 > A:
        return A
    elif x1 - A < 0:
        return 0
    else:
        return x1
      
N = int(input())
t = []
for i in range(5):
  t.append(int(input()))

 
x1 = N
x2, x3, x4, x5, x6 = 0, 0, 0, 0, 0

time = 0
for i in range(1000):
    x2add = trans(x1, t[0])
    x3add = trans(x2, t[1])
    x4add = trans(x3, t[2])
    x5add = trans(x4, t[3])
    x6add = trans(x5, t[4])

    x1 -= x2add
    x2 += x2add
    x3 += x3add
    x4 += x4add
    x5 += x5add
    x6 += x6add
    
    time += 1
    if x6 == N:
        break

print(time)

Submission status: Wrong Answer

Solution code:
a=[int(input()) for _ in range(6)]
analMEGA =min(a[1],a[2],a[3],a[4],a[5])
print(5 + a[0] // analMEGA)

Submission status: Wrong Answer

Solution code:
import numpy as np

num = [] #５個の料理の必要時間

n=input()
n=int(n)

for i in range(5): #入力
    a = input()
    a = int(a)
    num.append(a)



mini=min(num)
i=max(0,int(n/mini))
if mini >=n:
    print(5)
else:
    print(5+i)

Submission status: Wrong Answer

Solution code:
N = int(input())
AtoE = [int(input()) for _ in range(5)]
print(5+N//min(AtoE))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n=int(input())
d=[0 for i in range(5)]
for i in range(5):
    d[i]=int(input())
j=0
mn=999999999999
for i in range(5):
    if mn>d[i]:
        j=i
        mn=d[i]
print(5+max(int((n-1)/mn),0))

Submission status: Wrong Answer

Solution code:
import sys
import math

def main(inp):
    N=int(next(inp).split()[0])
    cap = [int(next(inp).split()[0]) for _ in range(5)]
    
    time=math.ceil(N/cap[0])
    
    for i in range(1,5):
        if(cap[i-1]<=cap[i]):
            time+=1
        else:
            time+=math.ceil(N/cap[i])-1
            
    return time
  
print(main(sys.stdin))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

min = min(a,b,c,d,e)

s = n // min

ans = s + 5

print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input().strip())
a = int(input().strip())
b = int(input().strip())
c = int(input().strip())
d = int(input().strip())
e = int(input().strip())
l = [a,b,c,d,e]
x = min(l)
if n > x:
        ans = math.floor(n/x) + 5
else:
        ans = 5
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
trans = []
for i in range(5):
  trans.append(int(input()))
tmp_list = []
if N % trans[0] == 0:
  tmp_list.append(N // trans[0] - 1)
else:
  tmp_list.append(N // trans[0])

for i in range(1,4):
  if trans[i] % trans[i+1] == 0:
    tmp_list.append(trans[i] // trans[i+1] - 1)
  else:
    tmp_list.append(trans[i] // trans[i+1])

print(5+sum(tmp_list))

Submission status: Wrong Answer

Solution code:
n = int(input())

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

array = [a,b,c,d,e]

print(5 + (n//min(array)))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(input())for _ in range(5)]
A.sort()
print(N//A[0]+5)

Submission status: Wrong Answer

Solution code:
N = int(input())
trans = [int(input()) for i in range(5)]
t = min(trans)
print(N//t + 5)

Submission status: Wrong Answer

Solution code:
N = int(input())
abcde = [int(input()) for i in range(5)]
x = min(abcde)
y = N//x if N % x != 0 else N/x
print(5+y)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(input()) for _ in range(5)]

print(n//min(l)+5)

Submission status: Wrong Answer

Solution code:
N = int(input())
t = [int(input()) for i in range(5)] 

m = min(t)
dN = N//m
ans = 5 + dN
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

temp = [a,b,c,d,e]
temp.sort()
group = 0

ans = 0
if N > temp[0]:
    if N%temp[0]!=0:
        ans = 4 + N//temp[0] + 1
    else:
        ans = 4 + N/temp[0]
else:
    ans = 5

print(ans)