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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

bottle = min(l)

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import ceil
def main():
    n, a, b, c, d, e = map(int, readlines())
    mint = min(a, b, c, d, e)
    if n <= mint:
        r = 5
    else:
        r = 4 + ceil(n / mint)
    print(r)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# 最短でも5分、んで最小値がボトルネック
from math import ceil
n = int(input())
minx = min([int(input()) for _ in range(5)])
print(4 + ceil(n / minx))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n = int(input())
    ans = 0
    m = float('inf')
    for i in range(5):
        x = int(input())
        m = min(m, x)
    xd = (n + m - 1) // m
    print(xd + 4)



    




        
    

    
    

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

2 2 2 2 2

"""

Submission status: Accepted

Solution code:
import math
n = int(input())
transportation = [int(input()) for i in range(5)]
bottleneck = min(transportation)
ans = 0
if bottleneck >= n:
	ans = 5
else:
	ans = math.ceil((n-bottleneck)/bottleneck)+5
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math


def input():
    return sys.stdin.readline().rstrip()


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

    time =0

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







if __name__ == "__main__":
    main()

Submission status: Accepted

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

M = min(W)
print(int(numpy.ceil(N / M) + 4))

Submission status: Accepted

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

def main():
    N = int(input())
    City = [int(input()) for i in range(5)]
    cnt = (N-1)//min(City)+5
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import math
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    people = [int(input()) for _ in range(5)]
    print(math.ceil(n/min(people))+4)
            
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
num = int(input())
min_power = 100000000000000000000000

for i in range(5):
  tmp = int(input())
  if min_power > tmp:
    min_power = tmp

x = math.ceil(num/min_power) + 4
print(x)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
import math
N = int(input())
Cap = [int(input()) for X in range(0,5)]
print(int(math.ceil(N/min(Cap))+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, min(b, min(c, min(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())
m = min(A, B, C, D, E)
print(math.ceil(N / 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())

m = [a, b, c, d, e]
max_t = -1
for i in range(5):
  t = math.ceil(n / m[i])
  max_t = max(max_t, t)

print(max_t+4)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, *a = [ri() for _ in range(6)]
print(math.ceil(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())

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

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

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 sys
import math
import itertools
import bisect
from copy import copy,deepcopy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(map(int,input().split()))
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
  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)
  ans = (n + x - 1) // x + 4
  print(ans)

  return

if __name__ == "__main__":
  resolve()

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())
k=min(a,min(b,min(c,min(d,e))))
i=math.ceil(n/k)
while i*k<n:
  i+=1
print(4+i)

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=int(input())
city=min([int(input()) for _ in range(5)])
if n%city==0:
  print(5+n//city-1)
else:
  print(5+n//city)

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))+5-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

div = min(A, B, C, D, E)
ans = (N-1)//div + 5
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)

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

import math

neck = min(a2e)

ans = 5

t_neck = math.ceil(n/neck)

ans += t_neck-1

print(ans)

Submission status: Accepted

Solution code:
import sys
import math
def I(): return int(sys.stdin.readline().rstrip())

def Main():
    n,a,b,c,d,e = I(),I(),I(),I(),I(),I()
    mini = min(a,b,c,d,e)
    tn = math.ceil(n/mini)
    print(tn+4)
    return

if __name__=='__main__':
    Main()

Submission status: Accepted

Solution code:

def solve():
    ABCDEmin = min(ABCDE)
#    print(ABCDEmin)
    if N % ABCDEmin == 0:
        t = N//ABCDEmin + 4
    else:
        t = N//ABCDEmin + 4 + 1
    print(t)

        

if __name__ == "__main__":
    N = int(input())
    ABCDE = [int(input()) for _ in range(5)]
    solve()

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = k()
A = k()
B = k()
C = k()
D = k()
E = k()

if A >= N and B >=N and C>=N and D>=N and E >=N:
    print(5)
    sys.exit()

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

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    trans = [I(), I(), I(), I(), I()]
    ans = 0
    if n%min(trans) == 0:
        ans = n//min(trans) + 4
    else:
        ans = n//min(trans) + 5
    print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [0]*5
for i in range(5):
    L[i]=-(-N//int(input()))
print(max(L)+4)

Submission status: Accepted

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

#print(lst)
#print(min(lst),N//min(lst))
'''
if min(lst) >= N:
    print(5)
else:
    print(N//min(lst)+5)
'''

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

Submission status: Accepted

Solution code:
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)))

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)

k = (N + m - 1) // m
print(k + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b,c,d,e = map(int,open(0).read().split())
m = min(a,b,c,d,e)
ans = n//m+4
if n%m == 0:
  print(ans)
else:
  print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 初期入力
import sys
import math
input = sys.stdin.readline
N = int(input())
a_max =[] #移動手段の最大乗車人数
num =[0]*5 #各移動機関の稼働回数
for i in range(5):
    x = int(input())
    a_max.append(x)
    num[i] =math.ceil(N /x)

#ボトルネックを過ぎれば、時間は距離に比例
max_value = max(num)
max_index = num.index(max_value)
ans =num[max_index] +6-2
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())
t=min(a,b,c,e,d)
if n%t==0:
    print(n//t+4)
else:
    print(n//t+5)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
time_array = np.array([int(input()) for _ in range(5)])
N_array = np.ones(5, dtype=np.int)*N

count_array = np.ceil(N_array / time_array)
answer = int(count_array.max() + 4)

print(answer)

Submission status: Accepted

Solution code:
from math import ceil
n = int(input())
st = set()
for i in range(5):
  st.add(int(input()))
print(ceil(n / min(st)) + 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())

f = min(a, b, c, d, e)
ans = (math.ceil(n / f) - 1) + 5
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from math import ceil
n, a, b, c, d, e = map(int, open(0).read().split())
s = min(a, b, c, d, e)
print(4 + ceil(n/s))

Submission status: Accepted

Solution code:
import math

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

for l in li:
  if l < div:
    div = l
    
print(math.ceil(n/div)+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def main2():
    n=int(input())
    l = []
    for i in range(5):
        s = int(input())
        l.append(s)
    print(math.ceil((n)/min(l))+4)
if __name__ == '__main__':
    main2()

Submission status: Accepted

Solution code:
import math

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

print(math.ceil(n/mina)+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 sys
input = sys.stdin.readline
def main():
    N = int(input())
    P = [int(input()) for i in range(5)]
    NEC = min(P)
    ans = (N+NEC-1)//NEC + 4
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

import math

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

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:
# https://atcoder.jp/contests/abc123/tasks/abc123_c

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])
if n % MIN == 0:
    ans = 5 + n // MIN - 1
else:
    ans = 5 + n // MIN
print(ans)

Submission status: Accepted

Solution code:
n= int(input())
b=10**15+1
for i in range(5):
    b=min(b,int(input()))
    
if n%b==0:
    print(4+n//b)
else:
    print(5+n//b)

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

Submission status: Accepted

Solution code:
n,*L = map(int,open(0).read().split())
min1 = min(L)
ri = 0
if n <= min1:
    print(5)
    exit()
if n%min1 == 0:
    ri = n//min1
else:
    ri = n//min1 +1
        
print(ri +4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
m=10**15+1
mi=0
for i in range(5):
  a=int(input())
  if a<m:
    m=a
    mi=i
print((n-1)//m+1+5-1)

Submission status: Accepted

Solution code:
l=[int(input()) for _ in range(6)]
m=min(l[1:6])
if l[0]%m==0: ans=l[0]//m
else: ans=l[0]//m+1
print(ans+4)

Submission status: Accepted

Solution code:
N = int(input())


max_ = -1
min_flow = float('inf')
for i in range(5):
    x = int(input())
    min_flow = min(min_flow, x)

    q, r = divmod(N, min_flow)

    if r != 0:
        q += 1

    max_ = max(max_, i + q)


print(max_)

Submission status: Accepted

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

N = I[0]
M = min(I[1:])

T = -(-N // M) + 4

print(T)

Submission status: Accepted

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

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

N = int(sys.stdin.readline())
A = int(sys.stdin.readline())
B = int(sys.stdin.readline())
C = int(sys.stdin.readline())
D = int(sys.stdin.readline())
E = int(sys.stdin.readline())

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

Submission status: Accepted

Solution code:
import math

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

M = 4
W = math.ceil(N/min(C))

print(M+W)

Submission status: Accepted

Solution code:
n = int(input())
m = float("inf")

for i in range(5):
    m = min(m,int(input()))
    
print(-(-n//m) + 4)

Submission status: Accepted

Solution code:
import collections
n = int(raw_input())
ais = map(int,[raw_input() for _ in range(5)])
m = min(ais)
print (n + m -1) / m  + 4

Submission status: Accepted

Solution code:
#解説確認後

import math
N = int(input())
Carry = []
for i in range(5):
    Carry.append(int(input()))
min_num = min(Carry)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np


def main():
    n = int(input())
    abcde = [int(input()) for _ in range(5)]
    min_abcde = min(abcde)
    ans = int(np.ceil(n/min_abcde) + 4)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

q, r = divmod(n, min(t))

if r > 0:
    q += 1
    
print(q+4)

Submission status: Accepted

Solution code:
import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, *l = map(int, read().split())

cost = math.ceil(n / min(l))
cost += 4

print(cost)

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

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

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

Submission status: Accepted

Solution code:
n,*m = map(int,open(0))

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
n = int(input())
buses = [int(input())for i in range(5)]
buses.sort()
capa = n//buses[0] if n/buses[0] != n//buses[0] else n//buses[0]-1
print(5+capa)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readline_s = sys.stdin.readline
readlines = sys.stdin.buffer.readlines


def main():

    N = int(readline())
    num = []
    for i in range(5):
        num.append(int(readline()))

    q, r = divmod(N, min(num))
    ans = q + 4
    ans += 1 if r else 0
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readline_s = sys.stdin.readline
readlines = sys.stdin.buffer.readlines


def main():

    N = int(readline())
    num = []
    for i in range(5):
        num.append(int(readline()))

    q, r = divmod(N, min(num))
    ans = q + (not (not r)) + 4
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
from math import ceil
n, a, b, c, d, e = [int(input()) for _ in range(6)]
neck = min(a, b, c, d, e)
ans = ceil(n / neck) + 4
print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, *A = map(int, open(0).read().split())

bottleneck = min(A)

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

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

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

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

Submission status: Accepted

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

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

if n % t[0] == 0:
    p = n // t[0]
else:
    p = n // t[0] + 1
    
print(4+p)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    num = [int(input()) for _ in range(5)]
    num.sort()
    temp = 0
    temp = N // num[0]
    if N%num[0] == 0:
        ans = temp
    else:
        ans = temp + 1

    ans += 4
    return ans

print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
p = []
for _ in range(5):
    p.append(int(input()))
m = min(p)
idx = p.index(m)
ans = (idx - 1) + n // m + (5 - idx)
if n % m:
    ans += 1
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())

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

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

Submission status: Accepted

Solution code:
import math

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

minL = min(L)
print((N+minL-1)//minL + 4)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from math import ceil
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])
ans = ceil(N/X) + 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n=int(input())
a=list(int(input()) for _ in range(5))
print(math.ceil(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())

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

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

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

N=int(input())
arr=[int(input()) for i in range(5)]
mm=arr.index(min(arr))


time=4+math.ceil(N/arr[mm])

print(time)

Submission status: Accepted

Solution code:
import math

def main():
    n = int(input())             
    a = [int(input()) for _ in range(5)]
    m = min(a)
    print(math.ceil(n/m) + 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())
limit = min(a,b,c,d,e)
r,q = divmod(n, limit)

print(5+r+min(q,1)-1)

Submission status: Accepted

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

minc = min(cost)

print((N-1)//minc + 5)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    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)
    q, r, = divmod(N, X)
    num = q + int(r > 0)

    ans = 5 + (num - 1)
    print(ans)


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())
MIN = min(A,B,C,D,E)
d,m = divmod(N,MIN)
if m == 0:
    d -= 1
print(5+d)

Submission status: Accepted

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

X = min(ABCDE)

#ボトルネックに通れる人の数でグループ分けする。
group = math.ceil(N/X)

#3グループに分けられる場合、最後のグループは2分待ってから5分で6に到着する。
ans = (group-1) + 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())

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

import math

point = 4

point += math.ceil(n/m)

print(point)

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())
    cost = [A, B, C, D, E]

    f = lambda x : int((N//x))
    t = [f(A), f(B), f(C), f(D), f(E)]

    idx = 0
    ma = 0

    for i in range(len(t)):
        if t[i] > ma:
            ma = t[i]
            idx = i
    ma += idx

    ans = ma + (5 - idx)

    if N % cost[idx] == 0:
        ans -= 1

    print(ans)

if __name__ == "__main__":
    main()