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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


def main():
    N = int(input())
    capacity = []

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,A,B,C,D,E=map(int,[input() for i in range(6)])
a=min(A,B,C,D,E)
minute=N//a + (N%a>=1) + 4
print(minute)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)
print((n + mi - 1) // mi + 4)

Submission status: Accepted

Solution code:
def k(a,b):
  if a%b!=0 or a<=b:
    return a//b+1
  else:
    return a//b

n=int(input())
a=[int(input()) for _ in range(5)]
print(4+k(n,min(a)))

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

Submission status: Accepted

Solution code:
import math

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

if a < N:
	ans = math.ceil(N/a) + 4
else:
	ans = 5

print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())
M=10**20
for i in range(5):
    M=min(M,int(input()))

if(M>=N):
    print(5)
else:
    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())

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

cnt = 5 + math.ceil(n / neck) - 1

print(cnt)

Submission status: Accepted

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

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

if n%p==0:
    q=n//p
else:
    q=n//p+1

print(5+q-1)

Submission status: Accepted

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

al = []

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


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

Submission status: Accepted

Solution code:
import math
a=[]
b=[]

for i in range(0,6):
  a.append(int(input()))

for j in range(1,6):
  b.append(math.ceil(a[0]/a[j]))
  
print(max(b)+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())

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

Submission status: Accepted

Solution code:
import math

n = int(input())

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

min_trans = min(trans)

t = math.ceil(n/min_trans) + 4

print(t)

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

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

Submission status: Accepted

Solution code:
import math

def main():
    array = [int(input()) for _ in range(6)]
    n = array[0]
    array = array[1:]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(int(input()) for i in range(5))
preC = N
for a in A:
   preC = min(preC, a)
T = 4 + N // preC
if N % preC:
   T+=1
print(T)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,*a=open(0);print(-(-int(n)//min(map(int,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())
m = min(a,b,c,d,e)
print(math.ceil(n/m) + 4)

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
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:
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(math.ceil(n/min(abcde))+4)

Submission status: Accepted

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

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math

n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(5)]
biri_kai = math.ceil(n/min(li))

total_time = biri_kai+4
print(total_time)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import math
#import copy
#import sys
#import bisect
#input = sys.stdin.readline
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
def lcm(a, b):
    return((a*b)//gcd(a,b))
def div(x):#約数配列
    div=[1]
    check=2
    while(x!=1 and check <= int(x**0.5)+2):
        if(x%check==0):
            div.append(check)
            while(x%check==0):
                x=x//check
        check+=1
    if x != 1:
      div.append(x)
    return div
def div2(x):#素因数分解配列
    div2=[]
    check=2
    while(x!=1 and check <= int(x**0.5)+2):
        while x%check==0:
            div2.append(check)
            x/=check
        check+=1
    if x != 1:
      div2.append(x)
    return div2

def main():
    # x,y = map(int,input().split())           x=1,y=2
    # a = input().split()                      a=['1','2','3',...,'n']
    # a = list(map(int,input().split()))       a=[1,2,3,4,5,...,n]
    # li = input().split('T')	              FFFTFTTFF => li=['FFF', 'F', '', 'FF']
    # 複数行の「1 2 3 4」型の入力を一配列に
    # x = sorted([list(map(int, input().split())) for _ in range(n)])
    # ソート x.sort(key=lambda y:y[1])
    # print("Yes")  print("No")  x=[[0 for _ in range(n)] for _ in range(n)]
    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)
    mm=n//m
    if n%m!=0:
        mm+=1
    print(mm+4)
main()

Submission status: Accepted

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

Submission status: Accepted

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

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

    mi = min(A)
    print(5 + -(-N // mi) - 1)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

min_a = min(a)
min_i = a.index(min_a)

print(4 - (-n//min_a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b,c,d,e = [int(input()) for i in range(6)]
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:
import math
n = int(input())
rid = [int(input()) for i in range(5)]

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

Submission status: Accepted

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

ans = 4 + -(-N//min(X))

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

p = [a, b, c, d, e]
if n%min(p) != 0:
    print(n//min(p)+5)
else:
    print(n//min(p)+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

minuites = math.ceil(N / narrow) + 4
  
print(minuites)

Submission status: Accepted

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

min_ = min(move_num_list)
print(-(-N//min_)+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)
time = 4 + math.ceil(N / a)
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())

import math
ans=0
lista=[a,b,c,d,e]

if min(lista)>=n:
	ans=5
	
else:
	ans=math.ceil(n/min(lista))+4
	
print(ans)

Submission status: Accepted

Solution code:
def main():
    N, A, B, C, D, E = map(int, open(0).read().split())
    print(-(-N // min(A, B, C, D, E)) + 4)
    return


main()

Submission status: Accepted

Solution code:
def main():
    N, A, B, C, D, E = map(int, open(0).read().split())
    print(-(-N // min(A, B, C, D, E) - 4))
    return


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq 
import math

N = int(input())
transport = list(int(input()) for _ in range(5))
#heapq.heapify(transport)

#min_trans  = heapq.heappop(transport)
min_trans  = min(transport)
#print(transport)
#print(min_trans)

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

Submission status: Accepted

Solution code:
N,A,B,C,D,E=[int(input()) for _ 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())
inp = []
for _ in range(5):
    inp.append(int(input()))
print(math.ceil(N/min(inp)) + 4)

Submission status: Accepted

Solution code:
import math

n = int(input())
ls = [int(input()) for _ in range(5)]
print(math.ceil(n/min(ls))+4)

Submission status: Accepted

Solution code:
n=int(input())
a=[0]*5
for i in range(5):
    a[i]=int(input())
b=5+n//min(a)
if n%min(a)==0:
    b-=1
print(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())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
if N%min(A, B, C, D, E) == 0:
    print(N//min(A, B, C, D, E)+4)
else:
    print(N//min(A, B, C, D, E)+5)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
time = np.array([int(input()) for _ in range(5)])
place = np.zeros(6)
place[0] = N
end = 0
cnt = 0
'''
while place[5] != N:

    cnt += 1
    for i in range(4,-1,-1):
        now = place[i + 1]
        work = min(place[i] , time[i])
        place[i + 1] += work
        place[i] -= work
    #print(place)
'''
ans = 0
min_val = min(time)
print(int(np.ceil(N / min_val) + 4))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n,*l=map(int,open(0))
print(math.ceil(n/min(l))+4)

Submission status: Accepted

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

def ceil(x,y):
    if x%y == 0:
        return x//y
    else:
        return x//y + 1

# 5分後以降、最後の都市にmin(N,A,B,C,D,E)人ずつ人が到着する    
print(4 + ceil(N, min(N,min(ABCDE))))

Submission status: Accepted

Solution code:
N=int(input())
m=10**15+1
for _ in range(5):
    m=min(m,int(input()))
ans=(N+(m-1))//m+4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input()) 
rissoku=10**18
for _ in range(5): 
    rissoku=min(rissoku,int(input())) 

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil

ins = [int(input()) for _ in range(6)]
N, *xs = ins
k = min(xs)
print(4 + ceil(N/k))

Submission status: Accepted

Solution code:
from sys import stdin
import math

N = int(stdin.readline().rstrip())
X = [int(stdin.readline().rstrip()) for _ in range(5)]

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

Submission status: Accepted

Solution code:
import math
n = int(input())
cap = [int(input()) for i in range(5)]
cap.sort()
print(math.ceil(n/cap[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())

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

print(counter)

Submission status: Accepted

Solution code:
#2019/10/04
N, A, B, C, D, E = list(map(int, open(0).read().split()))
# print(N)
print(-(-N//min(A,B,C,D,E)) + 4)

Submission status: Accepted

Solution code:
lst=[0]*6
for i in range(6):
  lst[i]=int(input())  
N=lst.pop(0)
m=min(lst)
if m<N:
  v1=N//m
  if N%m==0:
    print(5+v1-1)
  else:
    print(5+v1)
else:
  print(5)

Submission status: Accepted

Solution code:
N = int(input())
tran = [int(input()) for _ in range(5)]
mint = min(tran)
ans = N//mint +4
if N%mint:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()
a = []
for _ in range(5):
    a.append(ni())
print(math.ceil(n/min(a))+4)

Submission status: Accepted

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

c = []
n = int(input())
for _ in range(5):
    c.append(int(input()))
    
c.sort()
time = ceil(n/c[0]) + 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())
neck =min(a,b,c,d,e)
ans = 5

if n%neck==0:
    nt = n//neck -1
else:
    nt = n//neck
ans += nt
print(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:
from math import ceil
N = int(input())
print(4+max([ceil(N/int(input())) for _ in range(5)]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a_list = []
[a_list.append(int(input())) for i in range(5)]
a_min = min(a_list)
if n%a_min == 0:
    btlneck = n//a_min
else:
    btlneck = n//a_min + 1

print(4 + btlneck)

Submission status: Accepted

Solution code:
n = int(input())

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

min_move = min(move)

if n%min_move == 0:
    loss = -1
else:
    loss = 0

print(n//min_move + loss + 5)

Submission status: Accepted

Solution code:
import math

n = int(input())
a = [int(input()) for _ in range(5)]
t = 0
if n > min(a):
    t += math.ceil(n/min(a))
    t += 4
else:
    t += 5

print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f_c():
    from math import ceil
    *i, = map(int, open(0).read().split())
    n, a = i[0], i[1:]
    print(len(a)-1+ceil(n/min(a)))

if __name__ == "__main__":
    f_c()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from math import ceil
count=0
n=int(input())
bus=[int(input()) for i in range(5)]
# cur=n
# for i in range(5):
#     a=ceil(cur/bus[i])
#     if i!=4:
#         ne=max((a-1)*(bus[i]-bus[i+1]),0)
#         cur=ne+min(bus[i],cur)
#     count+=a
# print(count)
print(ceil(n/min(bus)+4))

Submission status: Accepted

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

idx=P.index(min(P))

ans=idx+(N-1+min(P))//min(P)+(4-idx)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest
import math
class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """5
3
2
4
3
5"""
        output = """7"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """10
123
123
123
123
123"""
        output = """5"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """10000000007
2
3
5
7
11"""
        output = """5000000008"""
        self.assertIO(input, output)
def resolve():
    N=int(input())
    a=[int(input()) for i in range(5)]
    m=min(a)
    print(4+math.ceil(N/m))
if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
num = float('inf')
for i in range(5):
    m = int(input())
    num = min(num, m)
print(-(-n // num) + 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:
import math

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

time = 0
mini = min(rides)
time = math.ceil(n/mini)+4

print(time)

Submission status: Accepted

Solution code:
import math

n = int(input())
info_list = [int(input()) for _ in range(5)]
min_num = min(info_list)
print(5+math.ceil(n/min_num)-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import Decimal
N = Decimal(input())
A = Decimal(input())
B = Decimal(input())
C = Decimal(input())
D = Decimal(input())
E = Decimal(input())
print((N-Decimal(0.1))//min(A,B,C,D,E)+5)

Submission status: Accepted

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

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

min_persons = min(persons)
print(4 - (-N // min_persons))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tn= 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((tn-1) //f + 5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = int(input().rstrip('\n'))
    b = int(input().rstrip('\n'))
    c = int(input().rstrip('\n'))
    d = int(input().rstrip('\n'))
    e = int(input().rstrip('\n'))

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

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


if __name__ == '__main__':
    slove()

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:
import math
n = int(input())
ma = 10**16
ind = 0
for i in range(5):
    ai = int(input())
    if ma >= ai:
        ind = i
        ma = ai
print(math.ceil(n/ma)+4)

Submission status: Accepted

Solution code:
N = int(input())
L = [0 for i in range(5)]
for i in range(5):
    L[i] = int(input())
    
time = [0 for i in range(5)]
time[0] = (N-1)//L[0] + 1
for i in range(4):
    if L[i] <= L[i+1]:
        time[i+1] = time[i]
    else:
        time[i+1] = (N-1)//L[i+1] + 1
        
ans = max(time) + 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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

print(math.ceil(num / min(accomodate_num)) + 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:
    print(N//m+5)
else:
    print(N//m+4)

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
minimum = min(a, b, c, d, e)
if n%minimum == 0:
  print(4 + n//minimum)
else:
  print(5 + n//minimum)

Submission status: Accepted

Solution code:
#C - Five Transportations 
N=int(input())
a=int(input())
for i in range(4):
    a=min(a,int(input()))
    
ans=4
if N%a>0:
    ans+=N//a+1
else:
    ans+=N//a
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# train : 1 -> 2, 1m, A
# bus : 2 -> 3, 1m, B 
# taxi : 3 -> 4, 1m, C
# airplane : 4 -> 5, 1m, D
# ship : 5 -> 6, 1m, E

N = int(input())
transportation_facilities_num = [int(input()) for _ in range(5)]
min_num = min(transportation_facilities_num)

ans = N//min_num
if N % min_num > 0:
    ans += 1
ans += 4

print(ans)

Submission status: Accepted

Solution code:
import math
N=int(input())
A,B,C,D,E=[int(input()) for _ in range(5)]
m=math.ceil(N/A)
if A<=B:
  B=A
  m+=1
else:
  m+=math.ceil((N-B*(m-1))/B)
if B<=C:
  C=B
  m+=1
else:
  m+=math.ceil((N-C*(m-2))/C)
if C<=D:
  D=C
  m+=1
else:
  m+=math.ceil((N-D*(m-3))/D)
if D<=E:
  m+=1
else:
  m+=math.ceil((N-E*(m-4))/E)
print(m)

Submission status: Accepted

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

N = int(input())
slowest = float('inf')
for i in range(5):
    a = int(input())
    slowest = min(slowest, a)

remain = N-slowest
diff = -(-remain // slowest)
print(5 + diff)

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

mi=min(a,b,c,d,e)
print(4+ceil(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())
r = min(a, b, c, d, e)
print(int((n + r -1)/r) +4)

Submission status: Accepted

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


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

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

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())
A=min([int(input()) for _ in range(5)])
print(-(-N//A)+4)

Submission status: Accepted

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

print((N+(m-N%m)%m)//m+4)

Submission status: Accepted

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

Submission status: Accepted

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

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(5 + math.ceil(n / min(l)) - 1)

Submission status: Accepted

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

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)