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

import sys
import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    L = [ii() for _ in range(5)]
    min_ind = 0
    minimum = inf
    for i in range(5):
        if L[i] < minimum:
            min_ind, minimum = i, L[i]
    print(min_ind + math.ceil(n / minimum) + (4 - min_ind))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def main():
    n = int(stdin.readline().rstrip())
    a = int(stdin.readline().rstrip())
    b = int(stdin.readline().rstrip())
    c = int(stdin.readline().rstrip())
    d = int(stdin.readline().rstrip())
    e = int(stdin.readline().rstrip())
    m = min(a,b,c,d,e)
    u = math.ceil(n/m)
    print(4 + u)

main()

Submission status: Accepted

Solution code:
n = int(input())
l = [int(input()) for _ in range(5)]
bottle = min(l)
print(4 + (n // bottle) + (n % bottle != 0))

Submission status: Accepted

Solution code:
import math
n = int(input())
trans = [int(input()) for _ in range(5)]
print(math.ceil(n/min(trans)) + 4)

Submission status: Accepted

Solution code:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
def main():
    n=I()
    trans=[I(),I(),I(),I(),I()]
    trans.sort()
    print(n//trans[0]+5 if n/trans[0]%1!=0 else n//trans[0]+4)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
t_list = [int(input()) for nesya in range(5)]
z = min(t_list)
for t in t_list:
  if z == t:
    if n%t == 0:
      t_ = n//t
    else:
      t_ = n//t+1
    print(t_ + 4)
    break

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

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):
    print(-(-N // min(A, B, C, D, E)) + 4)


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:
import math
N = int(input())
l = [int(input()) for _ in range(5)]
print(math.ceil(N/min(l))+4)

Submission status: Accepted

Solution code:

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

m=min(l)

print(-(-n//int(m))+4)

Submission status: Accepted

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

p_min = min(p_list)
n = N // p_min
if N % p_min == 0:
    n -= 1
ans = n + 5

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
capacity = []
for i in range(5):
    c = int(input())
    capacity.append(c)

print(-(-n//min(capacity))+4)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')
# ----------------------------------------------------------- #

n = I()
A = IR(5)
m = min(A)
print(4+ceil(n/m))

Submission status: Accepted

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

Submission status: Accepted

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

#n = int(input())
#l = list(map(int, input().split()))

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
root = [a, b, c, d, e]
minn=min(root)
#for i in range(5):
#    if root[i]==minn:
#        cnt=i+1
#        break

#print(cnt)
#print(5+(n//minn))
#print(5+math.floor(n/minn))
print(4+math.ceil(n/minn))

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    N = int(readline())
    A, B, C, D, E = [int(readline()) for _ in range(5)]
    res = -(-N // min(A, B, C, D, E)) + 4
    print(res)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
nums = [int(input()) for _ in range(5)]
from math import ceil
print(ceil(N/min(nums))+4)

Submission status: Accepted

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

def main():
    N = int(input())
    T = [int(input()) for _ in range(5)]

    """
    最も定員人数が少ない乗り物を考える。（複数ある場合は一番左側にあるものを見る）
    それが定員x人で[i, i+1]区間を結んでいるとして、[0, i]区間の乗り物がどうなって
    いるかを無視しても、
        ・ある時間以降i+1の街にはx人ずつ降り立ち、
        ・i+1の街以降では乗り物待ちは発生しない。
    ことが分かる。

    よって求める時間は
        ・i街に誰かが来るまでの時間（i分）
        ・[i, i+1]区間でN人全員を送り出す時間（ceil(N / x)分）
        ・最後の人がi+1街から最後の町に到着するまでの時間（5 - i - 1分）
    を合計して
        i + ceil(N / x) + (5 - i - 1) = ceil(N / x) + 4
    となる。
    """

    print(4 + ceil(N / min(T)))


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):
  print(5)
elif n%min(a,b,c,d,e)==0:
  print(4+int(n/min(a,b,c,d,e)))
else:
  print(5+int(n/min(a,b,c,d,e)))

Submission status: Accepted

Solution code:
N=int(input())
A = [int(input()) for _ in[0]*5]
#ボトルネック通過時間
bn=-(-N//min(A))
#START to BN + BN to GOAL = 4
print(bn+4)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,*A=map(int,open(0));print(5+(N-1)//min(A))

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

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

Submission status: Accepted

Solution code:
n,*a=map(int,open(0));print(0--n//min(a)+4)

Submission status: Accepted

Solution code:
n, *a = map(int, open(0))
print(0--n//min(a)+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A,B,C,D,E = map(int,[input() for i in range(5)])
ans = 0
def mymax(s):
    res = N//s
    if N%s==0:
        return res
    else:
        return res+1

k = max(mymax(A),mymax(B),mymax(C),mymax(D),mymax(E))
print(k+4)

Submission status: Accepted

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]
m=min(l)
index=l.index(m)
print((n-1)//m+1+4)

Submission status: Accepted

Solution code:
import math

n = int(input())
times = []
for i in range(5):
    inp = int(input())
    times.append(inp)
mini = min(times)
print(math.ceil(n / mini) + 4)

Submission status: Accepted

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

l = [None] * 5

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

print(4 + ceil(N/min(l)))

Submission status: Accepted

Solution code:
n = int(input())
abcde = [int(input()) for i in range(5)]
minabcde = 10**16
for i in abcde:
         if minabcde > i:
                  minabcde = i
print((n+minabcde-1)//minabcde + 4)

Submission status: Accepted

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

print(-(-n//min(trans)) + 4)

Submission status: Accepted

Solution code:
n = int(input())
trans = [ int(input()) for i in range(5) ]
trans = [ (n + i - 1) // i for i in trans]
print(max(trans) + 4)

Submission status: Accepted

Solution code:
import math


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import itertools
import math

n = int(input())
p = []
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))


time = math.ceil(n / min(p))

print(4+time)

Submission status: Accepted

Solution code:
import math

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

neck = min(s)
time = 0
time += s.index(neck)#ボトルネックに到達するまでの時間
time += math.ceil(n/neck)#全員がボトルネックを通り抜けるまでの時間
time += 4-s.index(neck)#最後の人がゴールするまでの時間

print(time)

Submission status: Accepted

Solution code:
import math

N = int(input())
numbers = list(int(input()) for _ in range(5))

M = min(numbers)

A = 5 + math.ceil(N / M) -1
print(A)

Submission status: Accepted

Solution code:
n=int(input())
import math
lis=[]
for i in range(5):
  lis.append(int(input()))
mi=min(lis)
print(math.ceil(n/mi)+4)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n=I()
u=[I() for i in range(5)]
ans=5-1+ceil(n/min(u))
#print(min(u))
print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
ma = 0
for i in range(5):
    a = int(input())
    if ma < math.ceil(n/a):
        ma = math.ceil(n/a)
print(ma+4)

Submission status: Accepted

Solution code:
import math

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

    capa = [A, B, C, D, E]
    time = math.ceil(N / min(capa)) + len(capa) - 1
    print(time)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N, A, B, C, D, E = eval("int(input())," * 6) 
print(4 + math.ceil(N / min(A, B, C, D, E)))

Submission status: Accepted

Solution code:
import math
n = int(input())
l = []
for i in range(5):
  l.append(int(input()))
if min(l)>=n:
  print(5)
else:
  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())
num = min(a, b, c, d, e)
cnt = n // num if n % num == 0 else n // num + 1
print(cnt + 4)

Submission status: Accepted

Solution code:
import math
n = int(input())
n_list = [int(input()) for i in range(5)]
#print(n_list)
n_min = min(n_list)
ans = math.ceil(n/n_min) + 4
print(ans)

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())
l = [a, b, c, d, e]
print(ceil(n / min(l)) + 4)

Submission status: Accepted

Solution code:
import math
n = int(input())
#n, m = list(map(int, input().split()))
# a, b, c = list(map(int, input().split()))
abc = [int(input()) for i in range(5)]
_min = min(abc)
min_idx = abc.index(min(abc))
count = math.ceil(n/_min)
count += min_idx+(4-min_idx)
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

costs.sort()
ans = 5
# 一番収容能力が低いところがボトルネックになる
if costs[0] < n:
    if n % costs[0] == 0:
        ans += n // costs[0] - 1
    else:
        ans += n // costs[0]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ABCDE = [A,B,C,D,E]

min_abcde = min(ABCDE)

if N % min_abcde == 0:
    X = N // min_abcde
else:
    X = (N // min_abcde) + 1

print(X+4)

Submission status: Accepted

Solution code:
import math

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

x = min(l)

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

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())
ans = 0


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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
people_restriction = [0]*5
for i in range(5):
    people_restriction[i] = int(input())
min_restriction = min(people_restriction)
city = people_restriction.index(min_restriction)

if n % min_restriction == 0:
    count = n//min_restriction
else:
    count = n//min_restriction + 1
ans = count + 4
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = [int(input()) for _ in range(5)]
ans = 0 - -n//min(l) + 4
print(ans)

Submission status: Accepted

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


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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [0] * 5
for i in range(5):
    a[i] = int(input())
ans = [[0,0] for i in range(5)]
ans[0] = [0,(n + a[0] -1)//a[0]]
for i in range(1,5):
    if a[i] < a[i - 1]:
        ans[i] = [ans[i-1][0]+1, max(ans[i-1][0]+1 + (n + a[i] -1 )//a[i],ans[i-1][1] + 1)]
    else:
        ans[i] = [ans[i-1][0]+1,ans[i-1][1] + 1]
print(ans[4][1])

Submission status: Accepted

Solution code:
from math import ceil
n, a, b, c, d, e = [int(input()) for i in range(6)]
print(ceil(n / min([a, b, c, d, e])) + 4)

Submission status: Accepted

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

MIN = min(Z)
ans = (N+MIN-1)//MIN + 4
print(ans)

Submission status: Accepted

Solution code:
import math

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

MIN = min(Z)
ans = math.ceil(N/MIN) + 4
print(ans)

Submission status: Accepted

Solution code:

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

print((n-1)//min(a,b,c,d,e)+1+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
temp_list = [int(input()) for _ in range(6)]
n = temp_list.pop(0)
print(4 + ceil(n / min(temp_list)))

Submission status: Accepted

Solution code:
n=int(input())
trans=[int(input()) for i in range(5)]
d=min(trans)
 
if n%d == 0:
    print(n//d +4)#(n//d +(0 or 1))最も運べる人数が少ない交通機関がn人を運ぶのにかかる時間
else:
    print((n//d +1) +4)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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 math
N = int(input())
nums = [int(input()) for _ in range(5)]
print(4 + math.ceil(N / min(nums)))

Submission status: Accepted

Solution code:
N = int(input())
neck = 10 ** 16
for _ in range(5):
    neck = min(neck, int(input()))
print(((N + neck - 1) // neck) - 1 + 5)

Submission status: Accepted

Solution code:
import math
import sys

input = sys.stdin.readline

def main():
    N = int(input())
    t = []
    for _ in range(5):
        t.append(int(input()))
    wait = [math.ceil(N/x) for x in t]
    maxwait = max(wait)
    ans = 5 + maxwait - 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import stdin
import math


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    dist = []
    for i in range(5):
        _ = int(_in[i+1])  # type:int
        dist.append(_)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    t = [0] * 5
    num = N
    for i in range(5):
        t[i] = math.ceil(num/dist[i])
        if i<4:
            num = num%dist[i]+max((N-num%dist[i])-dist[i+1]*(sum(t)-i-1),0)
    cnt = sum(t)
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)



if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    dist = []
    for i in range(5):
        _ = int(_in[i+1])  # type:int
        dist.append(_)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = math.ceil(N/min(dist))+4
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    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())


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

Submission status: Accepted

Solution code:
from math import ceil
P = [int(input()) for _ in range(6)]
N,A,B,C,D,E = P[0],P[1],P[2],P[3],P[4],P[5]
N2,N3,N4,N5,N6 = ceil(N/A),ceil(N/B),ceil(N/C),ceil(N/D),ceil(N/E)

ans = max(N2,N3,N4,N5,N6) + 4
print(ans)

Submission status: Accepted

Solution code:
# Problem C - Five Transportations

import math

# input
N = int(input())
trans = [0]*5
for i in range(5):
    trans[i] = int(input())

# initialization
min_pos = 0
for i in range(5):
    if trans[min_pos]>trans[i]:
        min_pos = i

# calc
time_1 = min_pos
time_2 = math.ceil(N/trans[min_pos])
time_3 = 6 - (min_pos + 2)
ans = time_1 + time_2 + time_3

# output
print(ans)

Submission status: Accepted

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

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

def calc(A):
    if N%A==0:
        return N//A
    else:
        return N//A+1
a=calc(A)
b=1+max(a, calc(B))
c=2+max(b-1,calc(C))
d=3+max(c-2, calc(D))
e=4+max(d-3, calc(E))
print(e)

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())
L = [A,B,C,D,E]
m = min(L)
print(4+ceil(N/m))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(input()) for i in range(5)]
    print(0--N//min(A) + 4)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
n = [int(input()) for _ in range(6)]
print(math.ceil((n[0]/ min(n[1:]))) + 4)

Submission status: Accepted

Solution code:
N,*I=[int(input()) for _ in range(6)]
mn=min(I)
print(5+(N+mn-1)//mn-1)

Submission status: Accepted

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

Submission status: Accepted

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

max_ = -1
for l in L:
    if n <= l:
        continue
    else:
        q, r = divmod(n, l)
        if r == 0:
            max_ = max(max_, q-1)
        else:
            max_ = max(max_, q)
if max_ != -1:
    ans += max_
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

tmp = min(ABCDE)

ans = (N + tmp - 1) // tmp + 4

print (ans)

Submission status: Accepted

Solution code:
n,a,b,c,d,e = [int(input()) for i in range(6)]
m = min(a,b,c,d,e)
k = 0--n//m
print(k+4)

Submission status: Accepted

Solution code:
from math import ceil


def main():
    n = int(input())
    required_times = [int(input()) for _ in range(5)]
    groups = ceil(n / min(required_times))
    print(groups + 4)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(5)]
a = min(A)
n=N//a
if N%a>0:
    n += 1
print(5+n-1)

Submission status: Accepted

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

Submission status: Accepted

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

m = min(arr)
ans = n//m + 5

r = n%m
if r == 0 : ans-=1
print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
a_e_list = []
for i in range(5):
  a_e_list.append(int(input()))
score = 0  
for i in range(5):
  if i == 0:
    score += math.ceil(n /a_e_list[0])
  else:
    s = n - a_e_list[i] * (score - i)
    if s <= 0:
      score += 1
    else:
      score += math.ceil(s/a_e_list[i])

      
print(score)

Submission status: Accepted

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

tmp = min(A, B, C, D, E)
res = N // tmp + int(N % tmp != 0) + 4

print(res)

Submission status: Accepted

Solution code:
# C - Five Transportations / 

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

m = min(t)
print((n+m-1)//m - 1 + 5 )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a_ls = [int(input()) for _ in range(5)]
neck_times = -(-n // min(a_ls))
ans = 4 + neck_times
print(ans)

Submission status: Accepted

Solution code:
n, a, b, c, d, e = map(int, open(0).read().split())
small = min(a, b, c, d, e)
print(-(-n // small) + 4)

Submission status: Accepted

Solution code:
import math
n=int(input())
list=[(int(input())) for _ in range(5)]
print(4+math.ceil(n/min(list)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
S=[int(input()) for i in range(6)]
ans=math.ceil(S[0]/min(S[1:]))+4
print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
cs = []
for i in range(5):
  city = int(input())
  cs.append(city)
m = min(cs)
if m >= n:
  ans = 5
elif m != 1:
  ans = (n + m - n%m) / m + 4
elif m == 1:
  ans = n + 4
print(int(ans))

Submission status: Accepted

Solution code:
import math
n = int(input())
bottleneck = 10**100
for i in range(5):
    x = int(input())
    if x <= bottleneck:
        bottleneck = x
print(4 + math.ceil(n / bottleneck))

Submission status: Accepted

Solution code:
import math
people = int(input())
lst = []
for i in range(5):
  lst.append(int(input()))
temp = min(lst)
time = 5 + math.ceil(people/temp) - 1
print(time)

Submission status: Accepted

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