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.

Solution (Python):
n=int(input())
x=min([int(input())for i in range(5)])
print((n+x-1)//x+4)

Solution (Python):
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)
print(4 + math.ceil(n/m))

Solution (Python):
import math

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

twn = [0] * 6
twn[0] = N


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



answer = ans[0] + ans[1] - 1 + ans[2] - 1 + ans[3] - 1 + ans[4]


print(max(ans) + 4)

Solution (Python):
import math

N = int(input())
rcvr = [0, 0, 0, 0, 0]
i = 0
while (i < 5):
    rcvr[i] = int(input())
    i += 1

narrow = min(rcvr)
ans = (N / narrow)
if (ans < 1):
    ans = 1
ans = math.ceil(ans)
ans += 4

print(ans)

Solution (Python):



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 n % minimum != 0:
    diff = n // minimum + 1
else:
    diff = n // minimum

print(diff+4)

Solution (Python):
import math

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

bottleneck = min(cities)
groups = math.ceil(n/bottleneck)

print(groups + 4)

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A, B, C, D, E):
    m  = min((A, B, C, D, E ))
    return math.ceil(N/m) + 4


def main():
    N = read_int()
    A = read_int()
    B = read_int()
    C = read_int()
    D = read_int()
    E = read_int()

    print(slv(N, A, B, C, D, E ))


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
l=[int(input())for i in range(5)]
print((n+min(l)-1)//min(l)+4)

Solution (Python):

N = int(input())

s = [0] * 5
for i in range(5):
    s[i] = int(input())


min_i = s.index(min(s))
min = min(s)
time = 0
if N%min != 0:
    time = N//min + 1 + 4
else:
    time = N//min + 4


print(time)

Solution (Python):
from math import ceil

n = int(input())
array = []
for i in range(5):
    array.append(int(input()))
base = min(array)
print(5 + ceil(max(n-base, 0) /base))

Solution (Python):
n = int(input())

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

min_ = min(l)


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

Solution (Python):
import numpy as np
import math

diff_rate = [0] * 5

N = int(input())

for i in range(5):
    diff_rate[i] = int(input())

min_rate = np.min(diff_rate)



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

Solution (Python):
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 != 1:
    print(5 + n // x)
else:
    print(4 + n)

Solution (Python):
import math
N = int(input())
a = [int(input())for i in range(5)]
a_min =min(a)

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

Solution (Python):
import math
n=int(input())
time=[]
for i in range(5):
    time.append(int(input()))
mn=min(time)
critic=math.ceil(n/mn)
print(critic+4)

Solution (Python):
import math

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

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

Solution (Python):
from sys import stdin

def main():
    I = [int(input()) for _ in [0] * 6]

    min_ = min(I[1:])
    idx = I[1:].index(min_)
    n = (I[0] - 1) // min_
    print(5 + n)

input = lambda: stdin.readline()
main()

Solution (Python):
import math

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(math.ceil(n/mini)))

print(4+i)

Solution (Python):


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

mi = min(li)

group_num = n//mi + int(bool(n%mi))

print(group_num + 4)

Solution (Python):
import math

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

neck = min(capa)

t = math.ceil(n/neck)

print(t+4)

Solution (Python):
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
r = (N//min([a,b,c,d,e]))+4
if N%min([a,b,c,d,e]) != 0:
    print(r+1)
else:
    print(r)

Solution (Python):

import sys


def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    x = min(A,B,C,D,E)
    ans = 5+int(N/x)
    if(N%x == 0):
        ans -= 1
    print(ans)
    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))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    D = int(next(tokens))  
    E = int(next(tokens))  
    solve(N, A, B, C, D, E)

if __name__ == '__main__':
    main()

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

div = min(a,b,c,d,e)
ans = (n+div-1)//div + 4

print(ans)

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

if(min(tl) == 1):
  a = n // min(tl) - 1
else:
  a = n // min(tl)

print(a + 5)

Solution (Python):
N = int(input())
L = [int(input()) for _ in range(5)]
minL = 10**16
minIndex = -1
for i in range(5):
  if L[i] < minL:
    minIndex = i
    minL = L[i]
ans = 4 + N//minL
if N%minL != 0: ans += 1
print(ans)

Solution (Python):
n = int(input())

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

location = [n, 0, 0, 0, 0, 0]
cap = [a, b, c, d, e]


min_cap = min(cap)
if min_cap >= n:
	print(5)

else:
	total = int((n-1)/min_cap) + 5
	print (total)

Solution (Python):
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(int((N / n[0]) + 4))
else:
    print(int((N // n[0]) + 5))

Solution (Python):
N = int(input())
trans = []
for i in range(5):
  trans.append(int(input()))
count = 5
yusou_min = min(trans)

if N % trans[0] == 0:
  count += (N // yusou_min - 1)
else:
  count += (N // yusou_min)
  
print(count)

Solution (Python):
n=int(input())
l=[]
for i in range(5):
  l.append(int(input()))
l = sorted(l)

print(int((n-1)/min(l))+5)

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

m = min(t)
dN = N//m
rN = N%m
if rN != 0:
    dN += 1
ans = 5 + dN - 1

print(ans)

Solution (Python):

import math

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

time = 4 + math.ceil(n/min(a))

print(time)

Solution (Python):
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]
m = min(l)
ans = 5 - 1 + math.ceil(N/m)
print(ans)

Solution (Python):
import sys
def p(*a):
  s=" ".join(map(str,a))
  
  sys.stderr.write(s+"\n")


N=int(input())

cost=10**15

import math
for _ in range(5):
  cost = min(cost, int(input()))

ans=5
ans+= max(0, math.ceil(N/cost)-1)

print(ans)

Solution (Python):
import math

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

S = [A,B,C,D,E]

ans = math.ceil(N/min(S))

print(ans+4)

Solution (Python):


import sys
input = sys.stdin.readline

N = int(input())
min = sorted([int(input()) for _ in range(5)])[0]

times = int((N / min + 0.9) * 10 // 10)

if times == 0:
    times = 1

print(5 + (times - 1))

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

Solution (Python):
from math import ceil

n = int(input())
x = sorted([int(input()) for _ in range(5)])

print(ceil(n / x[0]) + 4)

Solution (Python):
import numpy as np
import math

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

X = [A, B, C, D, E]

min_idx = np.argsort(X)[0]

res = 0
res = res + math.ceil(N / X[min_idx])
res = res + 4

print(res)

Solution (Python):
import math
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
capacity = [a, b, c, d, e]

min = capacity[0]
for i in range(0, 5):
    if capacity[i] < min:
        min = capacity[i]


print("{}".format(math.ceil(N/min)+4))

Solution (Python):
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.ceil(n/x) + 5 - 1
else:
        ans = 5
print(ans)

Solution (Python):

 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
 
N, *num = [int(input()) for i in range(6)]
min = sorted(num)[0]

if N % min == 0:
    print(N//min + 4)
else:
    print(N//min + 5)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(5)]
mina = min(a)
if mina >= n:
    print(5)
elif n % mina == 0:
    print(n//mina + 5 - 1)
else:
    print(n//mina + 5)

Solution (Python):
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]

tmp = i[0] % minimum
if tmp == 0:
  group = i[0] // minimum
else:
  group = (i[0] // minimum) + 1

print(group + 4)

Solution (Python):
N = int(input())
cost = [0]*5
for i in range(5):
  cost[i] = int(input())
bottleneck = sorted(cost,key = lambda x: N / x,reverse = True)
result = N // bottleneck[0]
if N % bottleneck[0] == 0:
  result -= 1
print(5+result)

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
L = [A,B,C,D,E]
L.sort()
if N%L[0] == 0:
  print(4+N//L[0])
else:
  print(5+N//L[0])

Solution (Python):
N = int(input())
info = [int(input()) for _ in range(5)]
ans = 5
small = N
info_p = []
for x in info:
    if x < small:
        info_p.append(x)
        small = x
k = -((small-N)//small)
ans += k
print(ans)

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

time = []
time.append(int(N/capacity_list[0])+1 if N%capacity_list[0] != 0 else int(N/capacity_list[0]))
for i in range(0,4):
    if capacity_list[i]>capacity_list[i+1]:
        time.append(int(N/capacity_list[i+1])+1 
        if N%capacity_list[i+1] != 0 
        else int(N/capacity_list[i+1]))
    else:
        time.append(1)
rate_limit = max(time)
print(rate_limit+4)

Solution (Python):
import numpy as np


def read():
    n = int(input().strip())
    capacities = np.empty((5, ), dtype=np.int64)
    for i in range(5):
        capacities[i] = int(input().strip())
    return n, capacities


def solve(n, capacities):
    n_groups = (n - 1) // np.min(capacities)
    return 5 + n_groups


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

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

Solution (Python):
import sys
import io
import math
import re

menu_num = 5
menu_sum = 0
menu_time_divided = 9
flag_a = 0
flag_b = 0

time_info_min = 10000000000000000

data_info = input().split()
passenger_info = int(data_info[0])

for num in range(menu_num):
    data_info = input().split()
    time_info = int(data_info[0])
    if time_info < time_info_min:
        time_info_min = time_info

if time_info_min != 1:
    print( 5 + math.floor(passenger_info/time_info_min))
else:
    print( 5 + math.floor(passenger_info/time_info_min) -1)

Solution (Python):
import numpy as np
N = int(input())
ABC = [int(input()) for _ in range(5)]
ABC = np.array(ABC)

check = 0
def counter(ABC, check):
    count = 0
    minABC = min(ABC)
    minidx = np.argmin(ABC)
    amari = N%minABC
    tmp = int(N/minABC) - int(amari==0)
    if check == 0:
        count = len(ABC) - minidx + tmp
    else:
        count = len(ABC) - minidx
    if minidx != 0:
        count += counter(ABC[:minidx], 1)
    return count

count = counter(ABC, 0)
print(count)

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

m = min(A)

if m == 1:
    times = 5 + (N - 1)
else:
    times = 5 + (N // m)

print(times)

Solution (Python):


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

neck = min(capacity)
num_group = N // neck + (0 if N % neck == 0 else 1)
print(5 + num_group - 1)

Solution (Python):
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)

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

Solution (Python):
N = int(input())
transes = list()

for _ in range(5):
    transes.append(int(input()))

print((N-1)//min(transes)+5)

Solution (Python):

import math
N=int(input())
A=[int(input())for i in range(5)]
print(4+math.ceil(N/min(A)))

Solution (Python):
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
bottom=min(A,B,C,D,E)
print(4+(N+bottom-1)//bottom)

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

Solution (Python):
n = int(input())
a = []

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

ans = n // min(a) + 1 + 4 if n % min(a) != 0 else n // min(a) + 4
print(ans)

Solution (Python):
import math
n = int(input())
a = list()
for i in range(5):
    a.append(int(input()))

min_a = min(a)

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

Solution (Python):
import math
N = int(input())
transporter = [0]*5
for i in range(5):
    transporter[i] = int(input())
min_trans = min(transporter)
ans = math.ceil(N/min_trans) - 1 + 5
print(ans)

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    N = int(input().rstrip())
    S = []
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    min_s = min(S)
    if(N % min_s == 0):
        print(N//min_s -1 + 5)
    else:
        print(N//min_s + 5)
    
if __name__ == '__main__':
    main()

Solution (Python):
import math
N = int(input())
LIST = [int(input()) for _ in range(5)]
MINval = min(LIST)

cnt = math.ceil(N / MINval)
print(cnt + 4)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(5)]
print(5+(n-1)//min(a))

Solution (Python):
import math
n=int(input())
x=[int(input()) for i in range(5)]
move=[]
for i in x:
    move.append(math.ceil(n/i))
print(max(move)+4)

Solution (Python):
import sys
import math

def main():

    lst = []

    for line in sys.stdin:
        line = line.rstrip()
        a = int(line)
        lst.append(a)

    n = lst[0]
    a_to_e = lst[1:]

    
    bottle = min(a_to_e)

    
    ind = a_to_e.index(bottle)

    if n <= bottle:
        print(5)
        return 0

    ans = 5 + (n // bottle) - 1

    if n % bottle != 0:
        ans += 1
    print(ans)
    return 0

if __name__ == '__main__':
    sys.exit(main())

Solution (Python):
N, trans = int(input()), [int(input()), int(input()), int(input()), int(input()), int(input())]

min_trans = min(trans)
print(int((N-1)/min_trans) + 1 + 4)

Solution (Python):
n = int(input())
a = []
su = 0
for i in range(5):
    k = int(input())
    a.append([k,-(-1*n//k)])

for i in range(5):
    if i == 0:
        su += a[i][1]
    else:
        if i + a[i][1] > su + 1:
            su = i + a[i][1]
        else:
            su += 1

print(su)

Solution (Python):
import sys
import math

N = int(sys.stdin.readline())

amount = []
for i in range(5):
    amount.append(int(sys.stdin.readline()))

min_index = 0
min_amount = amount[0]
for i in range(5):
    if min_amount > amount[i]:
        min_index = i
        min_amount = amount[i]

total_time = math.ceil(N/min_amount)
total_time += 4
print(total_time)

Solution (Python):
import math

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

limit = min(limits)

min_time = 5
min_time += math.ceil((n - limit) / limit)

print(min_time)

Solution (Python):
N=input()
L=[ input() for i in range(5) ]
m=min(L)

if N<=m:
	print 5
else:
	if N%m!=0:
		print 5+N/m
	else:
		print 5+N/m-1

Solution (Python):
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
lst = [A, B, C, D, E]
mn = min(lst)
print(5+math.ceil(N / mn) - 1)

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

bottleneck = min(caps)

if bottleneck >= N:
    print(5)
    exit()

t_start2bn = 0
sepnum = 0
t_bn2goal = 0

for idx,item in enumerate(caps):
    if item == bottleneck:
        t_start2bn = idx
        sepnum = N // bottleneck if N % bottleneck == 0 else + N // bottleneck + 1
        t_bn2goal = 5 - idx
        print(t_start2bn + t_bn2goal + sepnum - 1)
        exit()

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [tuple(map(int, l.split())) for l in sys.stdin]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = sorted([I() for _ in range(5)])
    r = (n+a[0]-1) // a[0]

    return r + 4

print(main())

Solution (Python):
import numpy as np


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

minV = min([a, b, c, d, e])
q = int(N / minV)
r = int(N % minV)
if q != 0 and r != 0:
    print(5 + q)
elif q != 0 and r == 0:
    print(5 + q - 1)
else :
    print(5)

Solution (Python):
import math
n=int(input())
l=[int(input()) for i in range(5)]
ans=5
ans+=math.ceil((n-min(l))/min(l))
print(ans)

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

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

ans = 4 + n // min(lis)
if n % min(lis) is not 0:
    ans += 1
print(ans)

Solution (Python):
import sys
import math


def main():
    inp = [int(line)  for line in sys.stdin.readlines()]
    num = inp.pop(0)
    inp_min = min(inp)
    if inp_min >= num:
        print(5)
    else:
        a = math.ceil(num / inp_min) + 4
        print(a)


if __name__ == '__main__':
    sys.exit(main())

Solution (Python):
N = int(input())

start = 0
end = 0

person = N

cap = [10 ** 15 + 1]

for _ in range(5) :
    cap.append(int(input()))

for i in range(1, 6) :
    person = N - (end - start) * cap[i]
    if person <= 0 :
        person = 1
    end += - (- person // cap[i])
    start += 1
print(end)

Solution (Python):
n = int(input())
mi = 10**15+1
def kiri(n):
  if n == int(n):
    return n
  else:
    return int(n)+1
for i in range(5):
  xi = int(input())
  if xi < mi:
    mi = xi
print(int(kiri(n/mi) + 4))

Solution (Python):
import numpy as np

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)

if n<=m:
    print(5)
else:
    if n%m==0:
        print(n//m+4)
    else:
        print(n//m+5)

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
L=[n//a,n//b,n//c,n//d,n//e]
M=[a,b,c,d,e]
if L[L.index(max(L))]*M[L.index(max(L))] == n:
  print(max(L)+4)
else:
  print(max(L)+5)

Solution (Python):
import numpy as np
from math import ceil
N = int(input())
cap = np.array([int(input()) for _ in range(5)])
min_cap = cap.min()
dur = ceil(N / min_cap) + 4
print(dur)

Solution (Python):
import math

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

list1 = [math.ceil(N/i) for i in [A,B,C,D,E]]

max_index = list1.index(max(list1))

print(max(list1) + 4)

Solution (Python):
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()

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)

Solution (Python):
import math
n=int(input())
a=[]
for i in range(5):
  a.append(int(input()))

ans=0
ans=math.ceil(n/min(a))+4
print(ans)

Solution (Python):
n = int(input())
lst = [int(input()) for _ in range(5)]

def calcu(a, b):
    if a % b == 0:
        return a//b
    else:
        return a//b + 1

ans = calcu(n, lst[0])
pace = min(n, lst[0])

for i in range(1,5):
    if pace > lst[i]:
        ans = calcu(n, lst[i]) + i
        pace = lst[i]
    else:
        ans += 1
print(ans)

Solution (Python):
N=int(input())
A,B,C,D,E=[int(input()) for i in range(5)]
time = 0

time = ((N-1)//A)+1

time = time+1 if A<=B else ((N-1)//B)+2

time = time+1 if min(A,B)<=C else ((N-1)//C)+3

time = time+1 if min(A,B,C)<=D else ((N-1)//D)+4

time = time+1 if min(A,B,C,D)<=E else ((N-1)//E)+5

print(time)

Solution (Python):
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)

Solution (Python):
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)




step += max(steps) + 4

print(max(5, step))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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(int((N-1)/min(time))+5)

Solution (Python):
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)

Solution (Python):
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)))

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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()