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: Accepted

Solution code:
N=int(input())
A,B,C,D,E=[int(input()) for i in range(5)]
time = 0
#0->1
time = ((N-1)//A)+1
#1->2
time = time+1 if A<=B else ((N-1)//B)+2
#2->3
time = time+1 if min(A,B)<=C else ((N-1)//C)+3
#3->4
time = time+1 if min(A,B,C)<=D else ((N-1)//D)+4
#4->5
time = time+1 if min(A,B,C,D)<=E else ((N-1)//E)+5

print(time)

Submission status: Accepted

Solution code:
import numpy as np
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

root = np.array([a,b,c,d,e])
min_crew = np.min(root)
first_wait = n//min_crew
if  n%min_crew == 0:
    first_wait-=1
print(first_wait+5)

Submission status: Accepted

Solution code:
from math import floor, ceil

from numpy import argmax

t = []
for each in range(6):
    t.append(int(input()))
n = t[0]
arrivals = [0] * 6
arrivals[0] = t[0]
limits = t[1:]
step = 0

steps = [0] * 5

for i, (num, limit) in enumerate(zip(arrivals, limits)):
    if n > min(limit, min(limits[:i + 1])):
        steps[i] = ceil(n / limit)



# print(steps)
step += max(steps) + 4

print(max(5, step))

Submission status: Accepted

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

bt = min(a)
bt_i = a.index(bt)
t = N // bt + (0 if N % bt == 0 else 1) + 4
print(t)

Submission status: Accepted

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

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

num_s = sorted(num)
if N % num_s[0] == 0:
    print(int(N / num_s[0] + 4))
else:
    print(int(N / num_s[0]) + 5)

Submission status: Accepted

Solution code:
import math

A=[int(input()) for i in range(6)]
m=min(A[1],A[2],A[3],A[4],A[5])
if A[0]%m != 0:  
  print(math.floor(A[0]/m)+5)
else:
  print(math.floor(A[0]/m)+4)

Submission status: Accepted

Solution code:
t = [0]*5
N = int(input())
for i in range(5):
    t[i] = int(input())
tgt = min(t)
if( N % tgt == 0 ):
  add = N // tgt - 1
else:
  add = N // tgt
print( 5 + add)

Submission status: Accepted

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

list = {n,0,0,0,0,0}
i = a
for j in {b,c,d,e} :
  if i>j :
    i = j
print(5+-(-n//i)-1)

Submission status: Accepted

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

paths = [a, b, c, d, e]
min_path = min(paths)
if n % min_path == 0:
    time = n // min_path + 4
else:
    time = n // min_path + 5

print(time)

Submission status: Accepted

Solution code:
import numpy as np
import math

N = int(input())
num = []
for i in range(5):
    num.append(int(input()))
if(N <= min(num)):
    print(5)
else:
    print(math.ceil(N/min(num)) + (4 - np.argmin(num)) + np.argmin(num))

Submission status: Accepted

Solution code:
import math

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

def main():
    print(int(math.ceil(N / min([A, B, C, D, E]))) + 4)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
capa = [0]*5
for i in range(5):
    capa[i] = int(input())

P = [0]*5
P[0] = capa[0]
No_G = [0]*5
No_G[0] = math.ceil(N/capa[0])
time = 4 + No_G[0]
for j in range(4):
    if capa[j+1]<capa[j] and P[j]>capa[j+1]:
        No_G[j+1] = math.ceil(N/capa[j+1])
        P[j+1] = capa[j+1]
        time += No_G[j+1] - No_G[j]
    else:
        P[j+1] = P[j]
        No_G[j + 1] = No_G[j]
print(time)

Submission status: Accepted

Solution code:
import math

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

nummin = min(A, B, C, D, E)
print(4 + math.ceil(N/nummin))

Submission status: Accepted

Solution code:
import math

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

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


print(math.ceil(n/min(l))+4)

Submission status: Accepted

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

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

hun.sort()

risso=hun[0]
if n<=risso:
  print(5)
else:
  if n%risso==0:
    print(5+(n//risso)-1)
  else:
    print(5+(n//risso)+1-1)

Submission status: Accepted

Solution code:
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
time = [a, b, c, d, e]
#print(min(time))
#if N/min(time)==1:
 # print(int(N/min(time))+4)
#else:
 # print(int(N/min(time))+5)
print(int((N-1)/min(time))+5)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, [input() for i in range(5)]))
minn = min(L)
sum1 = 0
sum2 = 0
if minn < N:
    sum1 = N // minn
    sum2 = N % minn
    if sum2 == 0:
        print(sum1+5-1)
    else:
        print(sum1+5)
else:
    print(5)

Submission status: Accepted

Solution code:
import math

n = float(input())
min = 0
for i in range(5):
    a = input()
    if min == 0:
        min = a
    elif a < min:
        min = a

print(4 + int(math.ceil(n / min)))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    M = []
    for _ in range(5):
        M.append(int(input()))
    x = min(M)
    if x > N:
        print(5)
    else:
        if N % x == 0:
            print(N // x - 1 + 5)
        else:
            print(N // x + 5)


main()

Submission status: Accepted

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

mn = min(a)
for i in range(5):
    if a[i] == mn:
        cnt += 1

if n % mn == 0:
    ans = 4 + n // mn
else:
    ans = 4 + n // mn + 1

print(ans)

Submission status: Accepted

Solution code:
N,A,B,C,D,E = [int(input()) for _ in range(6)]
times = [A,B,C,D,E]
for i in range(4):
    if times[i] < times[i+1]:
        times[i+1] = times[i]
A,B,C,D,E = times
l = -(-N//A)
m = -(-(N - (l-1)*B)//B)
n = -(-(N - (l+m-2)*C)//C)
p = -(-(N - (l+m+n-3)*D)//D)
q = -(-(N - (l+m+n+p-4)*E)//E)
print(l+m+n+p+q)

Submission status: Accepted

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

w = a[0]
for i in range(1,5):
    if w >= a[i]:
        w = a[i]

ans = 4 + int(n/w)
if n%w != 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math
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())
min_a=min(a)
min_index=a.index(min(a))
print(math.ceil(n/a[min_index])+4)

Submission status: Accepted

Solution code:
n=int(input())
pt=[int(input()) for _ in range(5)]
if n%min(pt)==0:
  print(n//min(pt)+4)
else:
  print(n//min(pt)+5)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(input()) for _ in range(5)]
min_a = min(a)
idx = a.index(min_a)
if N % min_a == 0:
    print(4+int(N/min_a))
else:
    print(5+int(N//min_a))

Submission status: Accepted

Solution code:
import math

n = int(input())
ls = []
dic = {}
for i in range(5):
    ls.append(int(input()))
for i in range(5):
    dic[ls[i]] = i+1
print(int(math.ceil(n / min(dic.keys()))) + 4)

Submission status: Accepted

Solution code:
n = int(input()) - 1
lst = [int(input()) for i in range(5)]
m = min(lst)
print(n//m + 5)

Submission status: Accepted

Solution code:
import math

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

least_trans = min(A, B, C, D, E)
if least_trans < N:
    ans = math.ceil(N / least_trans) + 4
else:
    ans = 5

print(ans)

Submission status: Accepted

Solution code:
from operator import itemgetter
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
minmam = min(a,b,c,d,e)
print(max(math.ceil(n/minmam)-1,0)+5)

Submission status: Accepted

Solution code:
A = []
N = int(input())
for i in range(5):
    a = int(input())
    A.append(a)
min_t = min(A)
if N % min_t == 0:
    a = N // min_t
else:
    a = N // min_t + 1
print(a + 4)

Submission status: Accepted

Solution code:
import itertools
import collections
import bisect
import math

def main():
    N = int(input())
    last = N
    for i in range(5):
        s = int(input())
        last = min(last, s)

    ans = math.ceil(N / last) + 4
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

an = []
for i in range(6):
    temp = input()
    an.append(int(temp))

N = an[0]
an.pop(0)

print(math.ceil((N / min(an)) + 4))

Submission status: Accepted

Solution code:
N = int(input())

min_val = int(input())

for i in range(4):
    tmp = int(input())
    if min_val > tmp:
        min_val = tmp

wait = N//min_val
if min_val*wait==N:
    wait -= 1
print(wait+5)

Submission status: Accepted

Solution code:
n=int(input())
peoplelist=[]
for i in range(5):
  num=int(input())
  peoplelist.append(num)
bottle=min(peoplelist)
bottleindex=peoplelist.index(bottle)
if n<=bottle:
  print(5)
else:
  totaltime=0
  if n%bottle==0:
    totaltime+=int(n/bottle)
  else:
    totaltime+=int(n/bottle)+1
  totaltime+=4
  print(totaltime)

Submission status: Accepted

Solution code:
A = [0,0,0,0,0]
B = [0,0,0,0,0]
N = int(input())
for i in range(5):
    A[i] = int(input())
    B[i] = -(-N // A[i])
print(max(B)  - 1 + 5)

Submission status: Accepted

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

ans = -(-N // min(T))
print(ans+4)

Submission status: Accepted

Solution code:
import numpy as np
import math
N=int(input())
people_pm=[]
a=int(input())
people_pm.append(a)
b=int(input())
people_pm.append(b)
c=int(input())
people_pm.append(c)
d=int(input())
people_pm.append(d)
e=int(input())
people_pm.append(e)
wait_time = math.ceil(N/min(people_pm))
print(wait_time+4)

Submission status: Accepted

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

if N%min(T) == 0:
	rissoku = N//min(T)-1
else:
	rissoku = N//min(T)

ans = rissoku + 5
print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
a = []
ans = 0
count = [0] * 5
for i in range(5):
    a.append(int(input()))
    count[i] = math.ceil(n / a[i])

for i in range(1, 5):
    if count[i] < count[i - 1]:
        count[i] = count[i - 1]

print(count[4] + 4)

Submission status: Accepted

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

print((5 + math.ceil((n - min(trans)) / min(trans)))) if n > min(trans) else print(5)

Submission status: Accepted

Solution code:
import sys
import math
A = [int(input()) for _ in range(6)]

if min(A) >= A[0]:
    print(5)
    sys.exit()
    
B = list(A)
count = math.ceil(A[0]/min(B))-1
print(count+5)

Submission status: Accepted

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

lim = [a,b,c,d,e]
mint = min(lim)
if n%mint ==0:
  print(n//mint+4)
else:
  print(n//mint+5)

Submission status: Accepted

Solution code:
import math
N = int(input())
p = []
for _ in range(5):
    p.append(int(input())) 

print(math.ceil(N / min(p)) + 4)

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random
import math
import bisect #bisect_left　これで二部探索の大小検索が行える

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

traffic_time.sort()

wait_time = math.ceil(n/traffic_time[0])
# print(wait_time)
# if wait_time <= 1:
#     wait_time = 0
wait_time -= 1
# if n%traffic_time[0] == 0:
#     wait_time -= 1

wait_time = max(wait_time,0)

print(wait_time+5)

Submission status: Accepted

Solution code:
import math


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

mintime = min(A,B,C,D,E)
print(math.ceil(N/mintime)+4)

Submission status: Accepted

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

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


print(m + n//neck if n%neck != 0 else m + n//neck -1)

Submission status: Accepted

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

min_num=min(nums)
if min_num==1:
  print(N//min_num+4)
elif min_num==N:
  print(5)
else:
  print(N//min_num+5)

Submission status: Accepted

Solution code:
import math
N = int(input())

method = [int(input())for _ in [0]*5]
min_div = min(method)

print(4+math.ceil(N/min_div))

Submission status: Accepted

Solution code:
input_lines = input().split()
N = int(input_lines[0])
min_value = 10 ** 15
for i in range(5):
    input_lines = input().split()
    value = int(input_lines[0])
    if value < min_value:
        min_value = value
if min_value != 1:
    print(int(N / min_value) + 5)
else:
    print(int(N / min_value) + 4)

Submission status: Accepted

Solution code:
N = int(input())
cmin = 10 ** 15 + 1
for i in range(5):
    c = int(input())
    cmin = min(c, cmin, N)
#print("cmin={}".format(cmin))
t = 4 + N // cmin
if(N % cmin != 0):
    t += 1
print(t)

Submission status: Accepted

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

if n <= min(A):
    print(5)
elif n % min(A) == 0:
    print(n // min(A) + 4)
else:
    print(n // min(A) + 5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i=[int(input()) for _ in range(6)]
m=min(i[1:])
print((i[0]-1)//m+5)

Submission status: Accepted

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

d = min(cap)
ans = 5 + ((N-1)//d + 1) - 1

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
transportations = list(map(int, [input() for _ in range(5)]))

min_trans = min(transportations)

print(4 + math.ceil(n / min_trans))

Submission status: Accepted

Solution code:
n=int(input())
inn=[]

times=0

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

mini=min(inn)

if n/mini==int(n/mini):
    print(n//mini + 4)
else:
    print(int(n//mini)+1 + 4)

Submission status: Accepted

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

N = int(input())
a = [0]*5
for i in range(5):
    a[i] = int(input())
    
if N % min(a) == 0:
    ans = N // min(a)
else:
    ans = (N // min(a))+1
print(ans+4)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import math

N = int(input())
A = [int(input()) for i in range(5)]
m = min(A)
if m >= N:
    print(5)
else:
    print(math.ceil(N/m) + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdout = sys.stdout
rr = lambda: input().strip()
rri = lambda: int(rr())
rrm = lambda: list(map(int, rr().split()))


n = rri()
a = rri()
b = rri()
c = rri()
d = rri()
e = rri()

tiny = min([a,b,c,d,e])
plus = n // tiny
if n % tiny == 0:
    plus -= 1
print(5 + plus)

Submission status: Accepted

Solution code:
import math
N = int(input())
tran = [int(input()) for i in range(5)]
move = min(tran)
print(math.ceil(N/move)+4)

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
li = [a, b, c, d, e]
#exist = [N, 0, 0, 0, 0, 0]
cnt = []
for i in range(5):
    cnt.append(ceil(N / li[i]))
print(max(cnt)+4)

Submission status: Accepted

Solution code:
n = int(input())
v = min([int(input()) for i in range(5)])
if n % v == 0:
  time = n // v + 4
else:
  time = n // v + 5
print(time)

Submission status: Accepted

Solution code:
import math

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

times = [a, b, c, d, e]
counts = [math.ceil(n/a)-1, math.ceil(n/b)-1, math.ceil(n/c)-1, math.ceil(n/d)-1, math.ceil(n/e)-1]
ans = 0
for i in range(5):
    ans += max((counts[i]-ans),0)

ans += 5

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
n = int(input())
l = [int(input()) for i in range(5)]
ans = math.ceil(n / min(l))+4
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
a = [0 for i in range(5)]
n = int(input())
for i in range(5):
    a[i] = int(input())
if n % a[0] == 0:
    time = n // a[0]
else:
    time = n // a[0] + 1
min = a[0]
for i in range(4):
    if min > a[i+1]:
        if n % min == 0:
            time1 = n // min
        else:
            time1 = n // min + 1
        if n % a[i+1] == 0:
            time2 = n // a[i+1]
        else:
            time2 = n // a[i+1] + 1
        time += (time2 - time1)
        min = a[i+1]
    time += 1
print(time)

Submission status: Accepted

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

m = min(A)
min_i = A.index(m)
t = N // m
if N % m != 0:
    t += 1
print(t + 4)

Submission status: Accepted

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

a = n // min(trans)
if n % min(trans):
    a += 1

print(a + 5 - 1)

Submission status: Accepted

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

print(4 -(-N//min(data)))

Submission status: Accepted

Solution code:
import math

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)

s = (math.floor(N / m) if N % m != 0 else (math.floor(N/m) - 1)) + 5
print(s)

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    A = []
    input_raw = read_func().strip().split()
    N = long(input_raw[0])
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))

    min_A = min(A)
    if min_A > N :
        print 5
        return
    x = (N / min_A) + (1 if N % min_A != 0 and N > min_A else 0)
##    for i in range(5):
##        x = (min_A / N) + (1 if min_A % N != 0 else 0)
##        min_A = min(min_A, x)
    print x + 4




if __name__ == '__main__':
    main()

Submission status: Accepted

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

array = [math.ceil(n/a),
         math.ceil(n/b),
         math.ceil(n/c),
         math.ceil(n/d),
         math.ceil(n/e)]
ans = max(array)+4
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(5)]
min_a = min(a)
i_a = a.index(min_a)
ans = 5
if n%min_a==0:
    ans += n//min_a-1
else:
    ans += n//min_a
print(ans)

Submission status: Accepted

Solution code:
import math
a = []
ans = 0
for i in range(6):
  po = int(input())
  a.append(po)
m = 1000000000000000
for i in range(5):
  if a[i+1] < m:
    m = a[i+1]

delay = math.ceil(a[0]/m) -1
print(5+delay)

Submission status: Accepted

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




minimum=min(A,B,C,D,E)
if minimum>=N:
    print(5)
else:
    if N%minimum==0:
        print(N//minimum+4)
    else:
        print(N//minimum +5)

Submission status: Accepted

Solution code:
N = int(input())
ABCDE = [int(input()) for _ in range(5)]
ABCDE_sort = sorted(ABCDE)
minimum = ABCDE_sort[0]
print(-(-N//minimum)+4)

Submission status: Accepted

Solution code:
N = int(raw_input())
cost = list()
for i in xrange(5):
    cost.append(int(raw_input()))

min_cost = 10 ** 16
for i in xrange(5):
    if cost[i] < min_cost: min_cost = cost[i]

if N <= min_cost: print '5'
elif N % min_cost == 0: print (4 + int(N / min_cost))
else:
    print (4 + int(N / min_cost) + 1)

Submission status: Accepted

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

mt = min(t)
if N%mt!=0:
    print(int(N / mt) + 5)
else:
    print(int(N/mt) + 4)

Submission status: Accepted

Solution code:
import math
N=int(input())
*A,=[int(input()) for i in range(5)]
x=min(A)
print(4+math.ceil(N/x))

Submission status: Accepted

Solution code:
n = int(input())
l = []
for i in range(5) :
    l.append(int(input()))
if n % min(l) == 0 :
    print(n // min(l) + 4)
else :
    print(n // min(l) + 5)

Submission status: Accepted

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

cnt = 0
neck = float("inf")
for t in time:
  times = int(N / t)
  if N % t != 0:
    times += 1
  times_n = int(N / neck)
  if N % neck != 0:
    times_n += 1
  if times > times_n:
    cnt += times - times_n + 1
    neck = t
  else:
    cnt += 1
print(cnt)

Submission status: Accepted

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

def count(n, m):
    if n % m == 0:
        return int(n / m)
    else:
        return int(n / m + 1)

def max(c, t):
    if c < t:
        return t
    else:
        return c

m = 0
m = max(m, count(N, A))
m = max(m, count(N, B))
m = max(m, count(N, C))
m = max(m, count(N, D))
m = max(m, count(N, E))

print(4 + m)

Submission status: Accepted

Solution code:
import math

N = int(input())

transportation = [0]*5
for i in range(5):
    transportation[i] = int(input())
    
answer = 5
bottleneck = min(transportation)

print(answer + math.ceil(N/bottleneck)-1)

Submission status: Accepted

Solution code:
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n = I()
lis = []
for i in range(5):
    lis.append(I())
print(4+math.ceil(n/min(lis)))

Submission status: Accepted

Solution code:
a=[]
N = int(input())
for i in range(5):
    buf = int(input())
    a.append(buf)
Min = min(a)
if N%Min == 0:
    print(N//min(a)+4)
else:
    print(N//min(a)+5)

Submission status: Accepted

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

for i in range(5):
  if N//lst[i] == 0:
    div_lst.append(1)
  elif N % lst[i] == 0:
    div_lst.append(N//lst[i])
  else:
    div_lst.append(N//lst[i]+1)

ans = max(div_lst) + 4
    
#print(div_lst)
print(ans)

Submission status: Accepted

Solution code:
s = []
for i in range(6):
    s.append(int(input()))
n = s.pop(0)
human = min(s)
time = -(-n//human) + 4
print(time)

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
lists=[]
lists.append(a)
lists.append(b)
lists.append(c)
lists.append(d)
lists.append(e)
lists.sort()
s=lists[0]
#5分後以降、6にs人送る
import math
k=math.floor((n-1)/s)
print(5+k)

Submission status: Accepted

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


def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    R = [A, B, C, D, E]
    mn = min(R)
    ret = max(5, 5 + (N - 1) // mn)
    print(ret)
    return


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: Accepted

Solution code:
from math import ceil as c;n=int(input());d=min([int(input())for i in range(5)]);print(c(n/d)+4)

Submission status: Accepted

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

    # 最低これだけは利用しないといけない
    A_count = N // A + (0 if N % A == 0 else 1)
    B_count = N // B + (0 if N % B == 0 else 1)
    C_count = N // C + (0 if N % C == 0 else 1)
    D_count = N // D + (0 if N % D == 0 else 1)
    E_count = N // E + (0 if N % E == 0 else 1)

    # 利用順序は関係ないので, 最大のところがボトルネックとなる
    max_count = max([A_count, B_count, C_count, D_count, E_count])

    # これにこれを最後に置くとして, 4回だけ増やす
    print(max_count + 4)


if __name__ == '__main__':
    main()

Submission status: Accepted

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:
    rissoku = N//(min(A,B,C,D,E))-1
else:
    rissoku = N//(min(A,B,C,D,E))
print(5 + rissoku)

Submission status: Accepted

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

x=min(A,B,C,D,E)
if x<N:
    if N%x==0:
        print(N//x+4)
    else:
        print(N//x+5)
else:
    print(5)

Submission status: Accepted

Solution code:
N = int(input())
a=[]
for i in range(5):
    a.append(int(input()))
a_min = min(a)
if N%a_min == 0:
    print(5 + int(N/a_min) -1)
else:
    print(5+ int(N/a_min))

Submission status: Accepted

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

div_list = []
for i in range(5):
    data.append(int(input()))
    if N%data[i] == 0:
        div_list.append(int(N/data[i]))
    else:
        div_list.append(int(N/data[i])+1)
count = max(div_list)+4
print(count)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = IR(5)
    k = II()
    if max(a) - min(a) > k:
        print(":(")
    else:
        print("Yay!")
    return

#B
def B():
    a = IR(5)
    b = a[0]
    ans = 0
    for a_ in a:
        if a_ % 10 != 0:
            if b % 10> a_ % 10:
                b = a_
    flg = 0
    for a_ in a:
        if a_ != b or flg:
            ans += math.ceil(a_ / 10) * 10
        else:
            ans += b
            flg = 1
    print(ans)
            
    
    return

#C
def C():
    n = II()
    ai = IR(5)
    print(math.ceil(n / min(ai)) + 4)
        
        
    return

#D
def D():
    x, y, z, k = LI()
    a = LI()
    a.sort(reverse = True)
    b = LI()
    b.sort(reverse = True)
    c = LI()
    c.sort(reverse=True)
    ans = [0, 0, 0]
    print(a[ans[0]]+b[ans[1]]+c[ans[2]])
    for _ in range(k-1):
        ansa = a[ans[0] - 1] + b[ans[1]] + c[ans[2]]
        ansb = a[ans[0]] + b[ans[1] - 1] + c[ans[2]]
        ansc = a[ans[0]] + b[ans[1]] + c[ans[2] - 1]
        if ansa > ansb:
            if ansa > ansc:
                ans = [ans[0] - 1, ans[1], ans[2]]
            else:
                ans = [ans[0], ans[1], ans[2] - 1]
        else:
            if ansb > ansc:
                ans = [ans[0], ans[1] - 1, ans[2]]
            else:
                ans = [ans[0], ans[1], ans[2] - 1]

        print(a[ans[0]]+b[ans[1]]+c[ans[2]])
                    

    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()

Submission status: Accepted

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

set = [a,b,c,d,e]
min_t = min(a,b,c,d,e)

time = (n-1) // min_t + 1

time += 4

print(time)

Submission status: Accepted

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

Submission status: Accepted

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_ = np.array([a, b, c, d, e])

list_min = list_.min()

if n % list_min == 0:
  min_ = n // list_min
else:
  min_ = n // list_min + 1
print(min_+4)

Submission status: Accepted

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