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:
import sys
import math

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    N = INT()
    minv = inf
    for i in range(5):
        minv = min(minv, INT())
    print(5 + math.ceil(N/minv) - 1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
# 最も少ない箇所がボトルネックになる（ので、5つ全部が最小値のときと結果が同じ
import math
n = int(input())
minn = min([int(input()) for _ in range(5)])
print(math.ceil(n/minn)+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
# N, K = map(int, input().split())
# line = list(map(int, input().split()))
# line = input()
N = int(input())
# print(N)
trans = [0] * 5
for i in range(5):
    trans[i] = int(input())

mini = min(trans)
ans = math.ceil((N / mini) + 4)
if N <= trans[0] and N <= trans[1] and N <= trans[2] and N <= trans[3] and N <= trans[4]:
    print(5)
else:
    print(ans)

Submission status: Accepted

Solution code:
from math import ceil
def main():
    n, *a = [int(input()) for i in range(6)]
    print(ceil(n/min(a))+4)

if __name__=="__main__": main()

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a,b,c,d,e]
l.sort()
import math
m = math.ceil(n / min(l))
print(m + 4)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC123 C
import math
L = [int(input()) for _ in range(6)]

N = L[0]
L.remove(L[0])
L.sort()
min = L[0]
print(math.ceil(N/L[0]) + 4)

Submission status: Accepted

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

mini=min(A,B,C,D,E)
if N%mini==0:
    print(N//mini+5-1)
else:
    print(N//mini+5)

Submission status: Accepted

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

from math import ceil
print(ceil(N/min(toll))+4)

Submission status: Accepted

Solution code:
from math import ceil

N = int(input())

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math, copy

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(math.ceil(N / min(A) + 4))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(string):
    n, *a_e = map(int, string.split())
    return str(5 + (n + min(a_e) - 1) // min(a_e) - 1)


if __name__ == '__main__':
    print(solve('\n'.join([input() for _ in range(6)])))

Submission status: Accepted

Solution code:
import math
n = int(input())
lst = list(map(int,[input() for i in range(5)]))

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

Submission status: Accepted

Solution code:
N = int(input())
mn = float('inf')
for i in range(5):
    a = int(input())
    mn = min(mn, a)
print((N+mn-1)//mn+4)

Submission status: Accepted

Solution code:
import numpy as np

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

move_p = [a, b, c, d, e]
# pos = np.zeros(6)
# pos_pre = np.zeros(6)
# move_n = np.zeros(5)
# pos[0] = n
# cnt = 0
# while sum(pos[: 6]) != 0:

#     for i in range(5):
#         if move_p[i] <= pos[i]:
#             move_n[i] = move_p[i]
#             pos[i] -= move_n[i]
#             pos_pre[i + 1] += move_n[i]
#         elif pos[i] < move_p[i]:
#             move_n[i] = pos[i]
#             pos[i] -= move_n[i]
#             pos_pre[i + 1] += move_n[i]

#     for i in range(5):
#         pos[i] += pos_pre[i]
#         pos_pre[i] = 0
#     cnt += 1

min_ = min(move_p)
cnt = int(np.ceil(n / min_) + 4)

print(cnt)

Submission status: Accepted

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

city = min(City)
amari = N % city
b = N // city + 1 if amari != 0 else N // city

print(b+len(City)-1)

Submission status: Accepted

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

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

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 = []
time = 5
for i in range(5):
    a.append(int(input()))

if min(a) < n :
    if n%min(a)!=0:
        time = time + n//min(a)
    else:
        time = time + n//min(a)-1

print(time)

Submission status: Accepted

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

Submission status: Accepted

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

num_ride = min(a)
num_arrive = 5-a.index(num_ride)
if num_ride < N:
    if 10 * N/num_ride % 10 == 0:
        
        print(5+int(N/num_ride)-1)
    else:
       print(5+int(N/num_ride))

else:
     print(5)

Submission status: Accepted

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

Submission status: Accepted

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

k = li.index(min(li))
if n%li[k] == 0:
  print(n//li[k] + 4)
else:
  print(n//li[k] + 5)

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(6)]
n = a.pop(0)
b = min(a)
print((n-1)//b+5)

Submission status: Accepted

Solution code:
import math

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

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

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

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

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

Submission status: Accepted

Solution code:
#解説AC
N = int(input())
min_cap = min([int(input()) for i in range(5)])
print(-(-N//min_cap)+4)

Submission status: Accepted

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

Submission status: Accepted

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

if N % min == 0:
    print(5+count-1)
else:
    print(5+count)

Submission status: Accepted

Solution code:
N, *C = [int(input()) for _ in range(6)]

print(4 + (N // min(C)) + (0 != N % min(C)))

Submission status: Accepted

Solution code:
n=int(input())
time=[]
  
for i in range(5):
  time.append(int(input()))
  
times,modul=n//min(time),n%min(time)

if modul == 0:
  print(times+5-1)
else:
  print(times+5)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

input_tmp = [int(input()) for _ in range(6)]

n = input_tmp[0]

a2e = input_tmp[1:]

min_value = min(a2e)

if n <= min_value:
    print(5)
else:
    if n % min_value != 0:
        print(n // min_value + 5)
    else:
        print(n // min_value - 1 + 5)

Submission status: Accepted

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

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//min(a,b,c,d,e))+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

min_ = int(input())
for i in range(4):
    min_ = min(min_, int(input()))

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

Submission status: Accepted

Solution code:

n1 = int(input())
na1 = []

for i1 in range(5):
    na1.append(int(input()))

n2 = min(na1)

r1 = n1 // n2

if n1 % n2 == 0 and n1 // n2 != 0:
    r1 -= 1

r1 += 5
print(r1)

Submission status: Accepted

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

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

Submission status: Accepted

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

import math

if __name__ == '__main__':
    n = int(input())
    b = [int(input()) for _ in range(5)]

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

Submission status: Accepted

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

Submission status: Accepted

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

m = min(abcde)
group = N//m if N%m==0 else N//m+1
print(5 + group - 1)

Submission status: Accepted

Solution code:
import sys
import math

input = sys.stdin.readline

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(4+max(math.ceil(n/a), math.ceil(n/b), math.ceil(n/c), math.ceil(n/d), math.ceil(n/e)))

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())
t=[int(input()) for i in range(5)]
m=min(t)
if n%m==0:
    a=n//m+4
else:
    a=n//m+5
print(a)

Submission status: Accepted

Solution code:
N = int(input())
lowest = float("inf")
for i in range(5):
    lowest = min(lowest, int(input()))


print(-(-N // lowest) + 4)

Submission status: Accepted

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

Submission status: Accepted

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

capacities = []
for i in range(0, 5):
    x = int(input())
    capacities.append(x)

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

Submission status: Accepted

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

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

ans = 4 + math.ceil(n / min(trans))

print(ans)

Submission status: Accepted

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

ans = 4 + ((n - 1) // min(trans) + 1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# n=int(input())
# a,b=map(int, input().split())
# c=list(map(int, input().split()))
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# a=100
# b=0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋めのときの出力
# 000100-0.987654

import numpy as np
import math
import copy

N = int(input())

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

trans_min = min(l)

bottle_neck = math.ceil(N / trans_min)

print(bottle_neck + 4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def resolve():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())

    speed = min([A, B, C, D, E])
    waittime = (N // speed) if N % speed == 0 else (N // speed) + 1
    return waittime + 4

if '__main__' == __name__:
    print(resolve())

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[17]:


N = int(input())
A = [int(input()) for i in range(5)]
"""
10000000007
2
3
5
7
11
"""


# In[19]:


ma = min(A)
if ma == 1:
    print(N//ma+4)
else:
    print(N//ma+5)


# In[11]:


#ppl = [0]*6
#ppl[0] += N


# In[13]:


"""
time = 0
while max(ppl[:5]) > 0:
    tmppl = ppl.copy()
    for i in range(len(A)):
        mina = A[i] if ppl[i]>=A[i] else ppl[i]
        tmppl[i] -= mina
        tmppl[i+1] += mina
    ppl = tmppl
    time += 1
    #print(ppl)
"""


# In[14]:


#print(time)


# In[ ]:

Submission status: Accepted

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

Bottoleneck=min(L)

if N%Bottoleneck==0:
    ans=4+N//Bottoleneck
else:
    ans=5+(N//Bottoleneck)

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=[I() for _ in range(5)]

  for i in range(len(l)):
    if l[i]==min(l):
      return -(-n//l[i])+len(l)-1

print(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())
time = 0
lists = [A,B,C,D,E]
MinMove = min(lists)
ans = math.ceil(N / MinMove) + 4
print(ans)

Submission status: Accepted

Solution code:
# PROXY

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

Submission status: Accepted

Solution code:
from math import ceil


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

    min_ = min([A, B, C, D, E])
    print(5 + ceil(N / min_)-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
inputstr1 = [int(input()) for _ in range(6)]

s = []
for i in range(1, 6):
    s.append(inputstr1[i])
ss = sorted(s)

if ss[0] == 1:
    maxtime = inputstr1[0] // ss[0] - 1
elif inputstr1[0] > ss[0]:
    maxtime = inputstr1[0] // ss[0]
else:
    maxtime = 0
print(maxtime + 5)

Submission status: Accepted

Solution code:
from math import ceil

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

print(ceil(N / c) + 4)

Submission status: Accepted

Solution code:
# ABC123C - Five Transportations
from math import ceil
cnd = list(map(int, [input().rstrip() for _ in range(6)]))
print(ceil(cnd[0] / min(cnd[1:])) + 4)

Submission status: Accepted

Solution code:
n = int(input())
pTrans = []
for _ in range(5):
        a = int(input())
        pTrans.append(a)
if n < min(pTrans) :
        print('5')
elif n%min(pTrans) == 0 :
        print(n//min(pTrans) + 4)
else :
        print(n//min(pTrans) + 5)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

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

min_num = a[0]

for i in a:
	if i < min_num:
		min_num = i
		
ans = -(-N // min_num) + 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())
F=min(A,B,C,D,E)
print((F+N-1)//F+4)

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

points = [A,B,C,D,E]
print(ceil(N / min(points)) + 4)

Submission status: Accepted

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

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())
a = [int(input()) for i in range(5)]
print(n//min(a)+4 if min(a) == 1 else n//min(a)+5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
tr = [int(input()) for i in range(5)]
# s = -(-N // tr[0])
# cnt = 5 + s - 1
# for i in range(1, 5):
#    # print(cnt, s, (-(-N // tr[i]) - s))
#    if (-(-N // tr[i]) - (-(-N // tr[i-1]))) > 0:
#        cnt += -(-N // tr[i]) - (-(-N // tr[i-1]))
print(-(-N // min(tr)) + 4)

Submission status: Accepted

Solution code:
import math

N = int(input())

a = []

for _ in range(5):
    aa = int(input())
    a.append(aa)

X = min(a)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = []
n = int(input())
for i in range(5):
  num.append(int(input()))
a = min(num)
t = n // a
if(n % a != 0):
  t += 5
else:
  t += 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())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

lst_A = []

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

lst_A.sort()

ans = N // lst_A[0]

if N % lst_A[0]:

    ans += 1

ans += 4

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os
#import math

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

pmin=min(p)
#g=math.ceil(N/pmin)
g=int(N/pmin)
if (N%pmin)==0:
    print(5+g-1)
else:
    print(5+g)

Submission status: Accepted

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

min_velosity = min(A)

print(math.ceil(N/min_velosity)+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:
n,a,b,c,d,e = [int(input()) for i in range(6)]
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())
x = [int(input()) for _ in range(5)]
print(int(-(-n/min(x) // 1) + 4))

Submission status: Accepted

Solution code:
# coding: utf-8

import math

II = lambda: int(input())


def main():
    N = II()
    return max(map(lambda p: math.ceil(N/p), [II() for _ in range(5)])) + 4


if __name__ == "__main__":
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, *x = map(int, open(0))
print(4 - (-N // min(x)))

Submission status: Accepted

Solution code:
import math
n = int(input())
a = []
lowest = 10**15
for i in range(5):
    a.append(int(input()))
    lowest = min(lowest, a[i])

ans = math.ceil(n / lowest) + 4

print(ans)

Submission status: Accepted

Solution code:
import math
N=int(input())
l=list(int(input()) for _ in range(5))
if N<=min(l):
    print(5)
else:
    print(math.ceil(N/min(l))-1+5)

Submission status: Accepted

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

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

print(4 + (N + min(A, B, C, D, E) - 1) // min(A, B, C, D, E))

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

    print(4 + ceil(N, min(C)))


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

m=[a,b,c,d,e]
m.sort()

ans=-(-n//m[0])
print(ans+4)

Submission status: Accepted

Solution code:
import math

def main():
    n = int(input())
    a = [int(input()) for i in range(5)]
    min_move = min(a)
    print(math.ceil(n/min_move)+4)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N =int(input())
l = [int(input()) for _ in range(5)]
l.sort()
ans = 4 + (N+l[0]-1)//l[0]
print(ans)

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

#find bottle neck (the smallest of A,B,C,D,E)
neck = min(A,B,C,D,E)

#find number of groups of neck. 
#(How many groups of neck people can be made)
groups = math.ceil(N / neck)

if groups <= 1:
    ans = 5
else:
    ans = 5 + (groups - 1)
    
print(ans)

Submission status: Accepted

Solution code:
def get_input():
    N = int(raw_input())
    A = int(raw_input())
    B = int(raw_input())
    C = int(raw_input())
    D = int(raw_input())
    E = int(raw_input())
    return N, A, B, C, D, E

def solve2():
    N, A, B, C, D, E = get_input()
    X = min(A, B, C, D, E)
    NdivX = (N  + X - 1) / X
    ret = 5 + NdivX - 1
    print ret

if __name__ == '__main__':
    solve2()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import math

input = sys.stdin.readline

def main():
    n = int(input())
    a, b, c, d, e = [int(input()) for _ in range(5)]
    print(math.ceil(n / min(a, b, c, d, e)) + 4)

main()

Submission status: Accepted

Solution code:
num = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
split_num = min(a,b,c,d,e)
extra = 0
if num % split_num != 0:
	extra = 1
print(int(num / split_num) + extra + 4)

Submission status: Accepted

Solution code:
import math
from collections import deque

N = int(input())
X = deque()
for i in range(5):
        X.append(int(input()))
m = min(X)
print(math.ceil(N/m)+4)

Submission status: Accepted

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

delay = 0
bottle_neck = trans[0]
for i in range(1,6):
    if bottle_neck > trans[i]:
        delay += int(trans[0] / trans[i]) - 1 - delay
        if trans[0]%trans[i] != 0:
            delay += 1
        bottle_neck = trans[i]

print(delay+5)

Submission status: Accepted

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

import math
print(math.ceil(N / min(map(int, list(abcde))) + 4))

Submission status: Accepted

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

b = min(l)
if b >= n:
    print(5)
else:
    t = (n - b) // b
    if (n -b) % b != 0:
        t += 1
    print(t + 5)

Submission status: Accepted

Solution code:
import sys
def II(): return int(sys.stdin.readline())

N = II()
li = []
for i in range(5):
    li.append(II())

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

min = min(a, b, c, d, e)
ans = (n-1)//min + 5
# ans = ceil(n/min)+4
print(ans)

Submission status: Accepted

Solution code:
from math import ceil
min_capacity = 10**16

N = int(input())
for i in range(5):
    x = int(input())
    min_capacity = min(min_capacity,x)
print(ceil(N/min_capacity)+4)

Submission status: Accepted

Solution code:
N=int(input())
A,B,C,D,E=[int(input()) for i in range(5)]
bn=min(A,B,C,D,E)
if N%bn==0:
    m=N//bn-1
else:
    m=N//bn
print(5+m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Coding: utf-8
N=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
import math
print(math.ceil(N/min(a))+4)

Submission status: Accepted

Solution code:
n = int(input())
transport = [int(input()) for x in range(0,5)]

trans_min_index = transport.index(min(transport))
if transport[trans_min_index] == 1 :
    time = 5-1 + int(n/transport[trans_min_index])
else:
    time = 5-1 + int(n/transport[trans_min_index] + 1)

print(time)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c = [0] * 6
data = [0] * 6
for i in range(6):
    data[i] = input()

n, a, b, C, d, e = list(map(int, data))

if n % min(a,b,C,d,e) != 0:
    score = (n // min(a,b,C,d,e)) + 1
else:
    score = n / min(a,b,C,d,e)
ans =int( score +4)
print(ans)

"""
c[0] = n
count = 0
print(n,a,b,C,d,e)
tem = [0] * 6
while c[5] != n:
    count += 1
    print(c)
    if c[0] == 0:
        pass
    elif c[0] <= a:
        tem[1] += c[0]
        c[0] = 0
    else:
        c[0] -= a
        tem[1] += a

    if c[1] == 0:
        pass
    elif c[1] <= b:
        tem[2] += c[1]

    else:
        c[1] -= b
        tem[2] += b

    if c[2] == 0:
        pass
    elif c[2] <= C:
        tem[3] += c[2]
        c[2] = 0
    else:
        c[2] -= C
        tem[3] += C
    
    if c[3] == 0:
        pass
    elif c[3] <= d:
        tem[4] += c[3]
        c[3] = 0
    else:
        c[3] -= d
        tem[4] += d

    if c[4] == 0:
        pass
    elif c[4] <= e:
        tem[5] += c[4]
        c[4] = 0
    else:
        c[4] -= e
        tem[5] += e
    for i in range(1,6):
        c[i] += tem[i]
        tem[i] = 0
    
print(count)
"""

Submission status: Accepted

Solution code:
import math

N, A, B, C, D, E = map(int, [int(input()) for i in range(6)])
MIN = min(A,B,C,D,E)
print(4+math.ceil(N/MIN))

Submission status: Accepted

Solution code:

import math 

N = int(input())
x =[int(input()) for _ in range(5)]
print(str(math.ceil(N / min(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())

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