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:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

people = [a,b,c,d,e]
if n<=min(people):
    print("5")
elif (n-min(people))%min(people) == 0:
    print(5+(n-min(people))//min(people))
else:
    print(5+(n-min(people))//min(people)+1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
import math
N = int(input())
abcde = [int(input()) for _ in range(5)]

time = 0
n = N # 次の都市でまだ残っている人数
last = 0 # 最後の1回で移動する人数

for i in range(5):
  time += n // abcde[i]
  if n % abcde[i] > 0:
    time += 1

  last = n % abcde[i]
  if last == 0:
    last = abcde[i]

  if i < 4: 
    n = last + max((N-last) - (time-i-1) * abcde[i+1], 0)
  
print(time)
#print("ans:", math.ceil(N / min(abcde)) + 4)

Submission status: Accepted

Solution code:
d=lambda n,x:-(-n//x)
N,A,B,C,D,E=[int(input())for _ in[0]*6]
m=A
r=d(N,A)
if m<B:r+=1
else:r=d(N,B)+1;m=B
if m<C:r+=1
else:r=d(N,C)+2;m=C
if m<D:r+=1
else:r=d(N,D)+3;m=D
if m<E:r+=1
else:r=d(N,E)+4
print(r)

Submission status: Accepted

Solution code:
import math
from sys import stdin
N=int(stdin.readline().rstrip())
data=[]
for i in range(5):
    data.append(int(input()))
    
ans=(math.ceil(N/sorted(data)[0]))+4
print(ans)

Submission status: Accepted

Solution code:
def c_five_transportations(N, A, B, C, D, E):
    from math import ceil
    group_member = min((A, B, C, D, E))
    group_num = ceil(N / group_member)
    return 5 + (group_num - 1)

N, A, B, C, D, E = [int(input()) for _ in range(6)]
print(c_five_transportations(N, A, B, C, D, E))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n=int(input())
#li=input().split()
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
import math
#li=list(map(int,input().split()))
#S=input()

lis=[]
for i in range(6):
    lis.append(int(input()))
m=math.ceil(lis[0]/min(lis[1:]))
print(m+4)

Submission status: Accepted

Solution code:
import math
N,A,B,C,D,E=[int(input()) for i in range(6)]
ans=math.ceil(N/min(A,B,C,D,E))+4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

# ボトルネックにかかる時間 + それ以外の経路にかかる時間
# 切り上げテクニック
# result = (N / min_limit) + 4
result = int(((N + min_limit - 1) / min_limit) + 4)
print(result)

Submission status: Accepted

Solution code:
from math import ceil

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

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

Submission status: Accepted

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

Submission status: Accepted

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

mini = 1000000000000000000000
index = 0
for i in range(5):
    if mini > a[i] and a[i] > 0:
        index = i
        mini = a[i]


ans = (N-1)//mini + 1 + 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

key = min(c)

ans = 0

if N % key == 0:
    ans = N / key
else:
    ans = N // key + 1

print(int(ans + 4))

#anss = 4 + int((N+key-1)/key)
#print(anss)

Submission status: Accepted

Solution code:
inList = []
startCnt = int(input())
goalCnt = 0
minLst = 1000000000000000
for i in range(5):
    A = int(input())
    inList.append(A)
    minLst = min(minLst, A)
ans = (-(-startCnt // minLst)) + 4
print(ans)

Submission status: Accepted

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

cities = [a, b, c, d, e]
min_val = 1e18
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)

Submission status: Accepted

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

mi = min(X)
print(4 + (N + mi - 1) // mi)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, A, B, C, D, E = [INT() for _ in range(6)]
trans = [A, B, C, D, E]
num_city = [N, 0, 0, 0, 0, 0]
time = 0
for i in range(5):
	# print(num_city)
	if not i==4:
		if trans[i] == 1:
			tmp = 1
		else:
			tmp = num_city[i]%trans[i]
		num_city[i+1] = N-tmp
		if N-tmp <= trans[i+1]*((time+(ceil(num_city[i]/trans[i])))-(i+1)):
			num_city[i+1] = 0
		else:
			num_city[i+1] -= trans[i+1]*((time+(ceil(num_city[i]/trans[i])))-(i+1))
		num_city[i+1] += tmp
		time += ceil(num_city[i]/trans[i])
		num_city[i] = 0
	else:
		time += ceil(num_city[4]/E)
print(time)

Submission status: Accepted

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

min_move = min(move)

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

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

# ボトルネックにかかる時間 + それ以外の経路にかかる時間
print(int(((N + min_limit - 1) / min_limit) + 4))

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
l = []

n = int(input())

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

l.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

n = int(input())
people = [int(input()) for _ in range(5)]
ans = ceil(n / min(people)) + 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
N, *a = map(int, open(0).read().split())
cnt = []
for i in range(5):
    cnt.append(ceil(N / a[i]))
print(max(cnt)+4)

Submission status: Accepted

Solution code:
n = int(input())
a = []

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

def main(inp):
    N=int(next(inp).split()[0])
    cap = [int(next(inp).split()[0]) for _ in range(5)]
    
    time=math.ceil(N/cap[0])
    
    for i in range(1,5):
        if(cap[i-1]<=cap[i]):
            cap[i]=cap[i-1]
            time+=1
        elif(cap[i-1]>=N):
            time+=math.ceil(N/cap[i])
        else: time+=math.ceil(N/cap[i])-math.ceil(N/cap[i-1])+1
            
    return time
  
print(main(sys.stdin))

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 = 0
a, b, c, d, e = 0, 0, 0, 0, 0
n = N

#while(True):
#    t += 1
#    # calc minus
#    x1 = A if n > A else n
#    x2 = B if a > B else a
#    x3 = C if b > C else b
#    x4 = D if c > D else c
#    x5 = E if d > E else d
#
#    n -= x1
#    a -= x2
#    b -= x3
#    c -= x4
#    d -= x5
#
#    # calc add
#    a += x1
#    b += x2
#    c += x3
#    d += x4
#    e += x5
#
#    if e >= N:
#        break
# print(t)

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

Submission status: Accepted

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

Submission status: Accepted

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

wait = max([int(n/w) if n%w!=0 else int(n/w)-1 for w in [a,b,c,d,e]])
print(5 + wait)

Submission status: Accepted

Solution code:
from collections import deque
from math import ceil
N=int(input())
A=[]
for i in range(5):
    A.append(float(input()))
print(4+int(ceil(N/min(A))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

n = int(input())

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

print(4 + ceil(n/x))

Submission status: Accepted

Solution code:
a,*b=eval('int(input()),'*6);print(~-a//min(b)+5)

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:z = 4
else:z = 5
print(int(z+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())
print((N - 1) // min(A, B, C, D, E) + 5)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math
n,a,b,c,d,e=[int(input()) for _ in range(6)]
num=sorted([a,b,c,d,e])
print(math.ceil(n/num[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())
M = min([A,B,C,D,E])
def ceil(n):
    if n > int(n):
        return(int(n)+1)
    else:
        return(int(n))


ans = ceil(N/M) + 4
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
li = [int(input()) for i in range(5)]
#print(li)
mn = min(li)
#print(mn)
#gn = n//mn
#print(gn)
print((n+mn-1)//mn+4)
#print((gn+1)+4)

Submission status: Accepted

Solution code:
a = []

N = int(input())
for i in range(5):
    a.append(int(input()))

sum_minute = -(-N // min(a)) + 4

print(sum_minute)

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()
M = 0
H = N % L[0]
if(H == 0):
  print(N//L[0]+4)
else:
  print(N//L[0]+5)

Submission status: Accepted

Solution code:
print(~-int(input())//min(eval('int(input()),'*5))+5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import sys, collections, bisect, math
from fractions import gcd 

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 = (n+m-1)//m -1 


print(ans+5)

Submission status: Accepted

Solution code:
print(((int(input()))-1) // min(int(input()),int(input()),int(input()),int(input()),int(input())) + 5)

Submission status: Accepted

Solution code:
import sys, math
input = sys.stdin.readline
N, A, B, C, D, E = (int(input()) for i in range(6))
x = min([A, B, C, D, E])
ans = math.ceil(N / x) + 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

min_D=min(D)
ceil_D=math.ceil(N/min_D)
    
print(ceil_D+4)

Submission status: Accepted

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

print((a-1) // min(b,c,d,e,f) + 5)

Submission status: Accepted

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]
cap = [read_int()[0] for _ in range(5)]

def solve():
    b_neck = cap[0]
    for i in range(5):
        if b_neck > cap[i]:
            b_neck = cap[i]
    in_neck = -(- N // b_neck)
    ans = 4 + in_neck
    return ans

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

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())
 
wait = max([math.ceil(n/w) for w in [a,b,c,d,e]])
print(4 + wait)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 17:52:43 2019

@author: nakamuratakayuki
"""
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
l = [A,B,C,D,E]
m = min(l)
mn = l.index(m)
c = 0
cities = [N,0,0,0,0,0]
while cities[mn] == 0:
    p00 = min(A,cities[0])
    p01 = min(B,cities[1])
    p02 = min(C,cities[2])
    p03 = min(D,cities[3])
    p04 = min(E,cities[4])
    cities[0]-=p00
    cities[1]-=p01
    cities[2]-=p02
    cities[3]-=p03
    cities[4]-=p04
    cities[1]+=p00
    cities[2]+=p01
    cities[3]+=p02
    cities[4]+=p03
    cities[5]+=p04
    c += 1
c += 5-mn+math.ceil(N/m)-1
print(c)

Submission status: Accepted

Solution code:
import sys,math
input = sys.stdin.readline
N=int(input())
P=[None]*5
for i in range(5):
    P[i]=int(input())
 
m = min(P)
 
if m >= N:
    print(5)
else:
    c = math.ceil(N/m)
    print(c+4)

Submission status: Accepted

Solution code:
import math

number = int(input())
numbers = []

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

shortest = numbers[0]
for i in range(5):
    if shortest > numbers[i]:
        shortest = numbers[i]

print(4 + math.ceil(number / shortest))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8
N = int(input())
l = []
for i in range(5):
    l.append(int(input()))
if N % min(l) != 0:
    print(N // min(l) + 5)
else:
    print(N // min(l) + 4)

Submission status: Accepted

Solution code:
print(~-int(input())//min(int(input())for i in[0]*5)+5)

Submission status: Accepted

Solution code:
N, A, B, C, D, E = int(input()), int(input()), int(input()), int(input()), int(
    input()), int(input())
Min = min([A, B, C, D, E])
print(N // Min + 1 + 4 if N // Min != N / Min else 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())
x=[a,b,c,d,e]
ans=math.ceil(n/(min(x)))+4
print(ans)

Submission status: Accepted

Solution code:
l = [int(input()) for _ in range(6)]
N = l[0]
l = l[1:]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import math

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

limit = np.array(
  [a, b, c, d, e], dtype=np.int64)
min_limit = limit.min()

wait = math.ceil(n/min_limit)

print(4+wait)

Submission status: Accepted

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

ans = n // min(time) + 5


if n % min(time) == 0:
    print(ans -1) 
else:
    print(ans)

Submission status: Accepted

Solution code:

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

key = min(c)

ans = 0
"""
if N % key == 0:
    ans = N / key
else:
    ans = N // key + 1

print(ans + 4)
"""
anss = 4 + int((N+key-1)/key)
print(anss)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import copy
N = int(stdin.readline().rstrip())
data = [None] * 5
for itr in range(0,5):
    data[itr] = int(stdin.readline().rstrip())
neck = 0
if N%min(data) != 0:
    neck = N/min(data) + 1
else:
    neck = N/min(data)
print(4+int(neck))

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())
trans = []
for i in range(5):
  trans.append(int(input()))
mintr = min(trans)
tmp = n // mintr
if (n % mintr):
  tmp += 1
print(tmp + 4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
a=[int(input())for _ in[0]*6];print((~-a[0]//min(a[1:]))+5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

num_h = [N, 0, 0, 0, 0, 0]
print(math.ceil(N / min(capa)) + 4)

Submission status: Accepted

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

import itertools

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

trans = [a, b, c, d, e]
toshi = [n, 0, 0, 0 ,0, 0]
t = 0


t_min = min(trans)

t = n // t_min + 4
if n % t_min > 0:
    t +=1


print(int(t))

Submission status: Accepted

Solution code:
from math import ceil

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

print(ceil(N / min(a)) + (5-1))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
lis = [int(input()) for x in range(5)]
mi = min(lis)
if N%mi == 0:
    mini = N//mi
else:
    mini = N//mi +1
print(mini + 4)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, A, B, C, D, E= [float(input()) for _ in range(6)]
cities = [A, B, C, D, E]
P = [N, 0, 0, 0, 0, 0]
t = 0
while True:
  for i, c in enumerate(cities):
    s = P[i] - c
    if s < 0 :
      P[i+1] += P[i]
      P[i] = 0
    else :
      P[i+1] += c
      P[i] = s
    t += 1
  if(P[5] > 0):
    break
print(int(-(-N//P[5]) + t - 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())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np


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

    return N, A, B, C, D, E


N, A, B, C, D, E = std_input()

arr = np.array((A, B, C, D, E))
ceil_arr = np.array(
    [np.ceil(N / A), np.ceil(N / B), np.ceil(N / C), np.ceil(N / D), np.ceil(N / E)]
).astype(int)

print(4+max(ceil_arr))

Submission status: Accepted

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

w=sorted(a)
"""
b=[i  for i in range(5)if a[i]==w[0] and (n>a[i] and a[i]!=a[i-1])]
#b=a.index(w[0])
ans=0
m=1
b.append(6)
for i in b:
    ans=ans+i-m
    m=i
    



x=(n//w[0] if n>w[0] else 0)
m=0
wa=copy.copy(a)
for i in a:
    if m==i:
        wa.remove(i)
    m=i


ans=x*(wa.count(w[0]))+ans
"""
##print(ans)
print(-(-n//w[0])+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())

move= [A,B,C,D,E]
min_move =min(move) 
min_move_idx = move.index(min_move)
time = 4


time += math.ceil(N/min_move )

print(time)

Submission status: Accepted

Solution code:
import math

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

hun.sort()

risso=hun[0]
print(5+math.ceil(n/risso)-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
li = list()

for _ in range(5):
  li.append(int(input()))
ans = N
aa = 0
ll = list()
for i in range(5):
  ak = ans / li[i]
  ll.append(li[i])
  aa += math.ceil(ak)
  
  if ak != 0 and i != 4:
    if min(ll) > li[i+1]:
      ans = N-(li[i+1]*(aa-i-1))
    else:
      ans = N-(min(ll)*(aa-i-1))
print(aa)

Submission status: Accepted

Solution code:
import math
n = int(input())
A = []

A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))


neck = A.index(min(A))
ans = (math.ceil(n/min(A))+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())
if n%(min([a,b,c,d,e]))==0:
    res=4+ n//(min([a,b,c,d,e]))
else:
    res=5+ n//(min([a,b,c,d,e]))
print(res)

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

A=[]
A.append(a)
A.append(b)
A.append(c)
A.append(d)
A.append(e)

A.sort()
m=A[0]
if n%m==0:
    ans = n/m + 4
else:
    ans = n/m + 4 + 1
#print(int(n/m))
print(int(ans))

Submission status: Accepted

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

# flag=True
# for i in A:
#   if i<n:
#     flag=False
# if flag==True:
#   print(5)
#   exit()

# ans=0
# if n >A[0]:
#   ans+=(n//A[0] if n%A[0] else n//A[0]-1)
#   n=A[0]

# for a in A[1:]:
#   if n>a:
#     ans+=(n//a if n%a else n//a-1)
#     n=a
print(math.ceil(n/min(A))+4)

Submission status: Accepted

Solution code:
import sys
import math

input = sys.stdin.readline

n = int(input())

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


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

Submission status: Accepted

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

for i in range(5):
    a = int(input())
    li.append(a)

ans = 0
if N % min(li) == 0:
    ans += N // min(li)
else:
    ans += N // min(li) + 1

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

Submission status: Accepted

Solution code:
import math

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

time = 4 + math.ceil((k / min(t)))

print(time)

Submission status: Accepted

Solution code:
import math

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

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

cnt = 4
min = min(list)

x = n / min

print(cnt + math.ceil(x))

Submission status: Accepted

Solution code:
from sys import stdin
import math

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

res_time = math.ceil(N / min(max_ride) + 4)

print(res_time)

Submission status: Accepted

Solution code:
import math


def solve(N, limits):
    min_limit = min(limits)
    return 4 + math.ceil(N / min_limit)


N = int(input())
limits = []
for _ in range(5):
    limits.append(int(input()))
print(solve(N, limits))

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import math

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

print(math.ceil(N / min(a)) + len(a) - 1)

Submission status: Accepted

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

Submission status: Accepted

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

if n % lst[0] == 0:
    res = n // lst[0] + 4
else:
    res = n // lst[0] + 5
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
l = [0] * 6
l[0] = N
m = [int(input()) for i in range(5)]
ans = ceil(N/min(m)) + 4
print(ans)