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:
def sub():
    items = [int(input()) for _ in range(6)]
    N = int(items[0])
    ds = [int(e) for e in items[1:]]
    k = min(ds)
    
    nb_pack, m = divmod(N, k)
    if m != 0:
        nb_pack = nb_pack + 1
    wait = nb_pack - 1 + 5
    print(wait)

sub()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
from math import ceil

#  def solve(nums):
    #  num_person, *caps = nums
    #  caps = caps + [0]
    #  #  (人数, 乗り物のキャパシティ) のタプルの配列
    #  cities = list(zip([num_person] + ([0] * (len(caps) - 1)), caps))
    #  time = 0

    #  # 最後の都市に全員が移動したら終了
    #  while cities[-1][0] < num_person:
        #  print('|'.join([str(n) for n, cap in cities[:-1]]))
        #  mov_nums = [min(*city) for city in cities[:-1]]
        #  for i, mov_num in enumerate(mov_nums):
            #  city = cities[i]
            #  next_city = cities[i + 1]
            #  cities[i] = (city[0] - mov_num, city[1])
            #  cities[i + 1] = (next_city[0] + mov_num, next_city[1])
        #  time = time + 1
    #  return time


def solve(nums):
    num_person, *caps = nums
    return 4 + ceil(num_person / min(*caps))


def main():
    nums = [int(l) for l in stdin.readlines()]
    ans = solve(nums)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

suf = 1 if N%min_ != 0 else 0
print(N//min_+4+suf)

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 N%X == 0:
    print(N//X + 4)
else:
    print(N//X + 5)

Submission status: Accepted

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


m = min(n)

if t < m:
    t = m

tmp = t//m

if t % m != 0:
    tmp += 1

print(tmp+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math                                                                                                                                                  
                                                                                                                                                             
N = int(input())                                                                                                                                             
CN = 6                                                                                                                                                       
                                                                                                                                                             
TC = [0] * (CN-1)                                                                                                                                            
for i in range(CN-1):                                                                                                                                        
    TC[i] = int(input())                                                                                                                                     
                                                                                                                                                             
                                                                                                                                                             
time = CN - 1                                                                                                                                                
                                                                                                                                                             
min_TC = min(TC)                                                                                                                                             
print(4+ math.ceil(N/min_TC))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
min_num = min(int(input()) for _ in range(5))

print((n-1)//min_num + 5)

Submission status: Accepted

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

a = min(x)
if a >= N:
	print(5)
else:
	if N % a == 0:
		print(int(N // a) + 4)
	else:
		print(int(N // a) + 5)

Submission status: Accepted

Solution code:
N=int(input())
M=min(int(input()) for _ in [0]*5)
print((N+M-1)//M+4)

Submission status: Accepted

Solution code:
N=int(input())
M=min(int(input()) for _ in [0]*5)
print(N//M+(5 if N%M else 4))

Submission status: Accepted

Solution code:
N,A,B,C,D,E =[int(input()) for _ in [0]*6]
M = min(A,B,C,D,E)
print(N//M+ (5 if N%M else 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())

a=min(A,B,C,D,E)

print(math.ceil(N/a)+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())

transport = [A, B, C, D, E]
bottleneck = min(transport)
time = 0
reached = 0

time = math.ceil(N / bottleneck) + 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())

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
C - Five Transportations
https://atcoder.jp/contests/abc123/tasks/abc123_c

"""
import sys

from math import ceil

def solve(N, passengers):
    passengers.insert(0, 0)
    res = [-1] * 7
    res[0], res[1] = 0, 0
    res[2] = ceil(N / passengers[1])
    for i in range(3, 7):
        if passengers[i-1] >= passengers[i-2]:
            res[i] = res[i-1] + 1
        else:
            res[i] = max((i-2) + ceil(N / passengers[i-1]), res[i-1] + 1)
    return res[-1]


def main(args):
    N = int(input())
    passengers = [int(input()) for _ in range(5)]
    ans = solve(N, passengers)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 13:29:57 2019

@author: avina
"""

n= int(input())
l = []
for i in range(5):
    l.append(int(input()))
k = min(l)
o = l.index(k)
sums = 4
if n%k != 0:
    sums+= n//k + 1
else:
    sums+= n//k

print(sums )

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

Solution code:
from math import ceil

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

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

Submission status: Accepted

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

index = 0
v = l[0]
for i in range(len(l)):
    if l[i] < v:
        index = i
        v = l[i]

result = index + n // v + len(l) - index
if (n % v == 0):
    result -=1
print(result)

Submission status: Accepted

Solution code:
from math import ceil

#n=10
#X=[123,123,123,123,123]

#n=5
#X=[ 3 ,2 ,4 ,3 ,5 ]

#n=10000000007
#X=[2,3,5,7,11]

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

print(5 + ceil(n / min(X)) - 1)

Submission status: Accepted

Solution code:
def count(inA, inB, before, total):
  if inB >= inA:
    count = before
  else:
    if inA%inB==0:
      count = int(total / inB)
    else:
      count = int(total / inB) + 1
  
  return count

num = []
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))

total_count = 0
for i in range(0, len(num)-1):
  if i==0:
    total_count = count(num[0], num[i+1], 1, num[0])
  else:
    total_count = count(min(num[1:i+1]), num[i+1], total_count, num[0])

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

Submission status: Accepted

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

m_r = min(r)
print(math.ceil(N/m_r) + 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())

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
trafic = [a, b, c, d, e]
ans = 5

if min(trafic) >= n:
    print(ans)
    exit()
else:
    if n % min(trafic) == 0:
        group = n//min(trafic) - 1
    else:
        group = n//min(trafic)

print(ans+group)

Submission status: Accepted

Solution code:
print((int(input())-1)//min(int(input())for _ in range(5))+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())
T = [int(input()) for _ in range(5)]

print(((N+min(T)-1)//min(T))+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]
ans = 5
min_take = min(l)

if min(l) >= n:
    ans = 5
else:
    if n % min_take != 0:
        group = n // min_take
    else:
        group = n // min_take - 1
    ans += group

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())
m = min(A, B, C, D, E)
if N % m == 0:
    print(N // m + 4)
else:
    print(N // m + 5)

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, b, c, d, e)

if m >= n:
    cnt = 1
elif n % m != 0:
    cnt = n // m + 1
else:
    cnt = n // m

print(cnt + 4)

Submission status: Accepted

Solution code:
N = int(input())

#各都市に行くためのコスト
lift = [int(input()) for i in range(5)]
#各都市にいる人数
city = [0] * 6


print(int((N + min(lift) - 1)  / min(lift) + 4))

Submission status: Accepted

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

max_div = 0
for i in abcde_list:
  div = (N+i-1)//i
  if max_div < div:
    max_div = div 
  
print(max_div+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())

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
c=list(map(int,[input() for _ in range(5) ]))

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


else:
    print(5)

Submission status: Accepted

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

t = [int]*5

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

print(5 + math.ceil(n/min(t)) - 1)

Submission status: Accepted

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

Submission status: Accepted

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

mi = min(li)
print ( 4 + N//mi + (0 if (N%mi==0) else 1) )

Submission status: Accepted

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

min_traffic = min(A, B, C, D, E)
print((-(-S // min_traffic))+4)

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = min([a,b,c,d,e])

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

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:
# -*- coding: utf-8 -*-
from math import ceil

def f1(n,a,b,c,d,e):
    m = min(a,b,c,d,e)
    if m==1:
        s = n
    elif n>m:
        s = ceil(n/m)
    else:
        s = 1
    return 5+s-1

def f2(n,a,b,c,d,e):
    op = [a,b,c,d,e]
    l = [0]*6
    l[0] = n
    res = 0
    flag = True
    while flag:
        flag = False
        for i in [4,3,2,1,0]:
            if l[i]>0:
                m = min(op[i],l[i])
                l[i] -= m
                l[i+1] += m
                flag = True
        res += 1
        if l[5]==n:
            flag = False
    return res

if __name__ == '__main__':
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    print(f1(n,a,b,c,d,e))

    # from random import randint
    # for _ in range(100):
    #     n = randint(1,100)
    #     a = randint(1,20)
    #     b = randint(1,20)
    #     c = randint(1,20)
    #     d = randint(1,20)
    #     e = randint(1,20)
    #
    #     r1 = f1(n,a,b,c,d,e)
    #     r2 = f2(n,a,b,c,d,e)
    #     if r1!=r2:
    #         print(r1,r2)
    #         print(n,a,b,c,d,e)
    #         break

Submission status: Accepted

Solution code:
n = int(input())
x = 10**20
for i in range(5):
    x = min(x, int(input()))
print((n+x-1)//x+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
state = [n, 0, 0, 0, 0, 0]
capacities = [int(input()) for _ in range(5)]
for i in range(1, 5):
    if capacities[i - 1] < capacities[i]:
        capacities[i] = capacities[i - 1]
print(4+math.ceil(n/capacities[4]))

Submission status: Accepted

Solution code:
TRANSPORTATION_COUNT = 5

people_count = int(input())
capacity_counts = [int(input()) for i in range(TRANSPORTATION_COUNT)]
result = people_count // min(capacity_counts)

if people_count % min(capacity_counts) > 0:
    result += TRANSPORTATION_COUNT
else:
    result += TRANSPORTATION_COUNT - 1
    
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

# ceil
if n%s is 0:
  n = n//s
else:
  n = n//s + 1
  
print(n+4)

Submission status: Accepted

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


def main():
    n = int(input())
    sizes = [int(input()) for _ in range(5)]
    min_size = min(sizes)
    if min_size < n:
        if n % min_size == 0:
            times = int(n / min_size)
        else:
            times = int(n / min_size) + 1
        print(5 + times - 1)
    else:
        print(5)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

time = 4
print(time + math.ceil(N/min(ABCDE)))

Submission status: Accepted

Solution code:
from math import ceil


def main(N, A, B, C, D, E):
    loads = [A, B, C, D, E]
    min_val = min(loads)
    min_index = loads.index(min_val)

    res = min_index + ceil(N / min_val) + (5 - (min_index + 1))

    return res


if __name__ == "__main__":
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    print(main(N, A, B, C, D, E))

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, B, C, D, E)
X = N // M
if N % M == 0:
    X = X - 1
print(5 + X)

Submission status: Accepted

Solution code:
N = int(input())
cost = [0,0,0,0,0]
for i in range(5):
    cost[i] = int(input())
mini = min(cost)

if mini >= N:
    print(5)
elif N % mini == 0:
    print(4+N//mini)
else:
    print(6+(N-mini)//mini)

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
minimum = min(a, b, c, d, e)

if a == minimum:
    ans = -(-n//a) + 4
elif b == minimum:
    ans = -(-n//b) + 4
elif c == minimum:
    ans = -(-n//c) + 4
elif d == minimum:
    ans = -(-n//d) + 4
elif e == minimum:
    ans = -(-n//e) + 4
print(ans)

Submission status: Accepted

Solution code:
import math

n, a, b, c, d, e = map(int, [input() for i in range(6)])

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

Submission status: Accepted

Solution code:
n, a, b, c, d, e = list(int(input()) for _ in range(6))

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

Submission status: Accepted

Solution code:
N = int(input())
List = list(map(int, [input() for _ in range(5)]))

ans = 0
List.sort()
m = List[0]
if N % m == 0:
    ans = 4 + (N // m)
else:
    ans = 5 + N // m
print(ans)

Submission status: Accepted

Solution code:
import sys

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

h.sort()
wh = h[0]
ww = n % wh
if ww == 0:
    wn = int(n / wh) - 1 + 5
else:
    wn = int(round((n / wh) + 0.5)) - 1 + 5

print(wn)

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

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

Submission status: Accepted

Solution code:
###############################################################################

from bisect import bisect_left as binl

def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * sy) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


###############################################################################


def main():
    n = intin()
    capalist = intinl(5)

    time = n // min(capalist) + (1 if n % min(capalist) else 0)
    print(time + 4)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
ary = []
for i in range(5):
  ary.append(int(input()))

min_num = np.array(ary).min()

ans = np.ceil(N/min_num) + 4
print(int(ans))

Submission status: Accepted

Solution code:
N = int(input())
T = [int(input()) for _ in range(5)]
MI = min(T)
if N % MI != 0:
    print(4 + N//MI + 1)
else:
    print(4 + N//MI)

Submission status: Accepted

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

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

if n_min >= n:
    print(5)

else:
    if n%n_min ==0:
        print(5 -1 + n//n_min)
    else:
        print(5 + n//n_min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Q = [int(input()) for i in range(5)]
 
min_value = min(Q)
min_index = Q.index(min_value)
if N%min_value == 0:
  print(N//min_value + 5 - 1)
else:
  print(N//min_value + 5)

Submission status: Accepted

Solution code:
import math

n = int(input())

capa = []
for i in range(5):
    capa.append(int(input()))
    
bneck = min(capa)
time = math.ceil(n / bneck) - 1 + 5


print(time)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = [int(input()) for i in range(5)]
c = min(b)
if a > c:
    if a%c == 0:
        d = int(a/c) + 4
        print(d)
    else:
        d = int(a/c) + 5
        print(d)
else :
    print(5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = []
MAX = 10**15+1
a_min = MAX

for i in range(5):
    a = int(input())
    A.append(a)
    if a_min > a:
        a_min = a

print(N//a_min-1+(1 if N%a_min>0 else 0)+5)

Submission status: Accepted

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

m = min(a)
idx = a.index(m)
t = (n + (m-1)) // m + 4
print(t)

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

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

Submission status: Accepted

Solution code:
import math
N = int(input())
norimono_list = [int(input()) for i in range(5)]
# print(norimono_list)

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

Submission status: Accepted

Solution code:
a=[]
for i in range(0,6):
  a.append(int(input()))
j=1
for i in range(1,6):
  if a[i]<a[j]:
    j=i
import math
print(math.ceil(a[0]/a[j])+4)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
cap = []
for n in range(5):
    cap.append(int(input()))

min_cap = min(cap)

print(int((N + min_cap - 1) / min_cap) + 4)

Submission status: Accepted

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

Submission status: Accepted

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

from math import ceil
m = ceil(N / min(T))

result = m + 4

print(result)

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np
import math

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

time = 4 + math.ceil(N/min(A))
print(time)



"""
# 題意をそのまま表したコード（超遅い）
place = np.zeros(6)
place[0] = N
cnt = 0
while(True):
  cnt += 1
  place[5] += min(A[4], place[4])
  place[4] += min(A[3], place[3]) - min(A[4], place[4])
  place[3] += min(A[2], place[2]) - min(A[3], place[3])
  place[2] += min(A[1], place[1]) - min(A[2], place[2])
  place[1] += min(A[0], place[0]) - min(A[1], place[1])
  place[0] -= min(A[0], place[0])
  if int(place[5]) == N:
    break
    
ans = cnt  
print(ans)
"""

Submission status: Accepted

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

#print ("N:",N)
#print ("cities:",cities)

ans = 0

people = [N,0,0,0,0,0]
latest = 0

# maybe O(N)
'''
while True:
	if (people[-1] == N):
		break
	else:
		for i in reversed(range(len(cities))):
			tmp = people[i]
			people[i] = max(0, people[i] - cities[i])
			people[i+1] += tmp - people[i]


	ans += 1
'''

critical = (N - 1) // min(cities) 


print (5 + critical)

Submission status: Accepted

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

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

ans = ceil(n / min(transport_times)) + 4
print(ans)

Submission status: Accepted

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

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)
print(((N-1) // m) + 5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 123
# https://atcoder.jp/contests/abc123
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

import math
def main():
    N = i2n()
    ABCDE = ii2nn(5)
    m = min(ABCDE)
    n = int(math.ceil(N / m)) + 4
    print(n)

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

P = [A, B, C, D, E]
p = min(P)
if p>=N:
    print(5)
else:
    ans = 4+math.ceil(N/p)
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())
cap_list = [int(input()) for i in range(5)]
min_cap = min(cap_list)
c = (n + min_cap - 1) // min_cap
print(c + 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_cost = min(A, B, C, D, E)
#print(min_cost)

if N % min_cost == 0:
    g_num = N // min_cost
else:
    g_num = N // min_cost + 1

print(5 + g_num - 1)

Submission status: Accepted

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

v = (N-1) // min(X)
print(v + 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(5 + int(max((n-0.1)//a,(n-0.1)//b,(n-0.1)//c,(n-0.1)//d,(n-0.1)//e)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import math

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

a = math.ceil(n/l[0])+4
print(a)

Submission status: Accepted

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

print(4 + -(-N//min(ABCDE)))

Submission status: Accepted

Solution code:
n=int(input())
time=[]
for i in range(5):
  time.append(int(input()))
time.append(0)
mini=time[0]
for i in range(5):
  mini=min(mini,time[i])
delay=(n-1)//mini+5
print(delay)

Submission status: Accepted

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

n = int(input())
num = []
town = [0, 0, 0, 0, 0, 0]
time = 0
for i in range(5):
    num.append([int(input()),i])
town[0] = n
#print(num)
#print(type(min(num)))
#print(type(min(num)[1]))
time = (n-1) // min(num)[0] + 5  #1 + (5-min(num)[1])
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())

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

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
arr = [int(input()) for _ in range(5)]

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
l = []
for _ in range(5):
    l.append(int(input()))
l = np.array(l)
l_min = np.min(l)
if N < l_min:
    print(5)
else:
    if l_min == 1:
        result = 5 + (N//l_min) - 1
    else:
        result = 5 + (N//l_min)
    print(result)

Submission status: Accepted

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

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

trans.sort()

if N % trans[0] == 0:
    print(N // trans[0] + 4)
else:
    print(N // trans[0] + 5)