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())
List=[int(input()) for i in range(5)]
sList = sorted(List)
#print(sList[0])
if sList[0]>=N:
  print(5)
else:
  print(math.ceil(N/sList[0])+4)

Submission status: Accepted

Solution code:
import math

def spaceinput():
    return list(map(int,input().split(" ")))

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


print(4+math.ceil(N/min(t)[0]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
people = int(input())

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

minimum = min(people, min(ways))

minutes = 5
if people % minimum == 0:
  minutes += people // minimum - 1
else:
  minutes += people // minimum
  
print(minutes)

Submission status: Accepted

Solution code:
n = int(input())
p = []
for i in range(5):
    p.append(int(input()))
mi = min(p)
y = (mi + n - 1) // mi
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())

import math
items = [a, b, c, d, e]
min_item = min(items)
min_idx = items.index(min_item)
n_times = math.ceil(n / min_item)
print(len(items) + n_times - 1)

Submission status: Accepted

Solution code:
import math
atcoder = [int(input()) for i in range(6)]
loc = [atcoder[0],0,0,0,0,0]

ans = 0

num = 1000000000000000000000
for i in range(1,6):
    if atcoder[i] < num:
        num = atcoder[i]

ans2 = atcoder[0] / num
if atcoder[0] == num:
    print(5)
else:
    print(math.ceil(ans2)-1+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())

f=[a,b,c,d,e]
g=[0,0,0,0,0,n]
ans=0

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

Submission status: Accepted

Solution code:
# import copy
import math

m_num = []  # 各交通機関の運搬上限人数
p_num = int(input())
for i in range (5):
    m_num.append(int(input()))

CITY = 6

pos = [0] * CITY  # 現在、都市にいる人数
pos[0] = p_num

pos_next = [0] * CITY  # 1分経過後の、都市にいる人数
pos_next[0] = p_num
total_time = 0

# 素直に計算する版。時間足りないっぽい。
# while pos[5] != p_num:
#     for p in range(CITY - 1):
#         if pos[p] > 0:
#             if pos[p] > m_num[p]:
#                 pos_next[p] -= m_num[p]
#                 pos_next[p + 1] += m_num[p]
#             else:
#                 pos_next[p] -= pos[p]
#                 pos_next[p + 1] += pos[p]
#     # pos = pos_next  # こうすると同じポインタを指すっぽい
#     pos = copy.deepcopy(pos_next)
#     total_time += 1
#     print(total_time, pos)

# ボトルネックのところで時間が決まる？
min_m = min(m_num)
total_time = math.ceil(p_num / min_m) + 4  # 最低5分かかる
print(total_time)

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] 
pace = min(x) 
y = int(N/pace)
if pace == 1:
    print(y+4)
else:
    print(y+5)

Submission status: Accepted

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

#import numpy as np
#arr=np.array([a,b,c,d,e])
#botne=np.argmin(arr)+1
#botne_num=np.min(arr)
botne_num=min([a,b,c,d,e])
if botne_num==1:
  print(4+N//botne_num)
else:
  print(5 + N//botne_num)

Submission status: Accepted

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

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

min_pos = 0
for p in range(len(cap)):
    if cap[p] < cap[min_pos]:
        min_pos = p

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

Submission status: Accepted

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

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

prev_ceil = math.ceil(N / A2E[0])
ans = int(prev_ceil)
for i in range(1,len(A2E)):
    ans += 1
    prev = A2E[i-1]
    cur = A2E[i]
    current_ceil = math.ceil(N / cur)
    if (prev_ceil < current_ceil):
        delay = int(current_ceil - prev_ceil)
        ans += delay
        prev_ceil = current_ceil

print(int(ans))

Submission status: Accepted

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

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)
X = math.ceil(n / x)
print(5 + X - 1)

Submission status: Accepted

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

temp=[a,b,c,d,e]
temp.sort()
mini=temp[0]

ans=int(n//mini+5)
if mini==1:
    print(ans-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# # 整数の入力
# a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# # 文字列の入力
# s = input()
# # 出力
# print("{} {}".format(a+b+c, s))
import numpy as np
N = int(input())
a = []
for _ in range(5):
    a.append(int(input()))
np_a = np.array(a)
k = np_a.argmin()
if N%np_a[k] == 0:
    tmp = N//np_a[k]
else:tmp = N//np_a[k] + 1
print(tmp + 4)

Submission status: Accepted

Solution code:
def getMinNum(N,nums):
	if N % min(nums) == 0:
		return N // min(nums)
	else:
		return N // min(nums) + 1

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

nums = [A,B,C,D,E]
	
print(len(nums)-1+getMinNum(N,nums))

Submission status: Accepted

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

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

Submission status: Accepted

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

list_t = [A,B,C,D,E]
lowest = list_t[0]

for i in range(len(list_t)):
    if lowest >= list_t[i]:
        lowest = list_t[i]
    
    
if (N % lowest) != 0:
    print(N // lowest + 5)
else:
    print(N // lowest + 4)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
import math

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


m = min(arr)
print(5 + math.ceil(n/m)-1)

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]
p=min(X)
if n%p==0:
    cnt=n//p+4
else:
    cnt=n//p+5 
    
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())

v = [N, A, B, C, D, E]
m = min(v[1:])
index = v.index(m)
ans = N // m + index
if N % m == 0:
  ans -= 1


for i in range(index+1, len(v)):
  ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
bottle_neck = 10**15+10
for _ in range(5):
    bottle_neck = min(bottle_neck,int(input()))
ans = 5
if bottle_neck<N:
    ans += N//bottle_neck
if N%bottle_neck==0:
    ans -= 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
l = [int(input()) for i in range(5)]
tmp = 0
for i in range(5):
  if l[i] > N:
    tmp += 1

if tmp == 5:
  print(5)
else:
    ans = 0
    if N%min(l) == 0:
      ans+=5+N//min(l)-1
    else:
      ans+=5+N//min(l)
    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())

qa, moda = divmod(n, a)
qb, modb = divmod(n, b)
qc, modc = divmod(n, c)
qd, modd = divmod(n, d)
qe, mode = divmod(n, e)

input_list = [a, b, c, d, e]
q_list = [qa, qb, qc, qd, qe]
mod_list = [moda, modb, modc, modd, mode]

max = 0
for i in range(0, 5):
    if q_list[i] > max:
        if mod_list[i] == 0:
            max = q_list[i] - 1
        else:
            max = q_list[i]

time = 5 + max
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())
l = [a,b,c,d,e]
min = min(l)
f = n // min
g = n % min
if not(g == 0):
    f = f + 1
f = f + 4
print(f)

Submission status: Accepted

Solution code:
#c
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(5 + n // m + math.ceil((n % m) / m) - 1)

Submission status: Accepted

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

import math
MinNum = min(N[1:])
Neck = math.ceil(N[0] / MinNum)
print(Neck + 4)

Submission status: Accepted

Solution code:
n = int(input())
clist = [int(input()) for _ in range(5)]
cmin = min(clist)
if cmin == 1:
  print(5 + n//cmin - 1)
else:
  print(5 + n//cmin)

Submission status: Accepted

Solution code:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
ListN=[A,B,C,D,E]
ListN.sort()
q=ListN[0]
if N%q!=0:
  w=(N//q)+1 #律速段階の輸送回数
elif N%q==0:
  w=N//q
if q==A:
  print(w+4)
elif q==B:
  print(w+4)
elif q==C:
  print(w+4)
elif q==D:
  print(w+4)
elif q==E:
  print(w+4)

Submission status: Accepted

Solution code:
import math
N=int(input())
d=10**15
for _ in range(5):
  a=int(input())
  if a < d:
      d=a
print(math.ceil(N/d)+4)

Submission status: Accepted

Solution code:
import math

n = int(input())

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

for i in range(4):
	if m[i] < m[i+1]:
		m[i+1] = m[i]

cnt = 5

cnt += math.ceil(n/m[0]) -1

l = []

for i in m:
	l.append(math.ceil(n/i))

for i in range(4):
	cnt +=(l[i+1] - l[i])

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

def ceil(n, m):
    if n % m == 0:
        return int(n / m)
    else:
        return int(n / m) + 1

aa = ceil(n, a)
bb = ceil(n, b)
cc = ceil(n, c)
dd = ceil(n, d)
ee = ceil(n, e)

lag = max([aa, bb, cc, dd, ee]) - 1

print(5 + lag)

Submission status: Accepted

Solution code:
N = int(input())
X = [int(input()) for _ in range(5)]
cap = min(X)
if (N <= cap):
  b = 1
else:
  b = (N + cap - 1) // cap

print(b + 4)

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
t1 = N
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0
w = 0
while(t6 != N):
    w += 1
    if t5 > 0:
        t6 += min(t5, E)
        t5 = max(0, t5 - E)
    if t4 > 0:
        t5 += min(t4, D)
        t4 = max(0, t4 - D)
    if t3 > 0:
        t4 += min(t3, C)
        t3 = max(0, t3 - C)
    if t2 > 0:
        t3 += min(t2, B)
        t2 = max(0, t2 - B)
    if t1 > 0:
        t2 += min(t1, A)
        t1 = max(0, t1 - A)
    if t6 >= 1:
        break
print(int(math.ceil(N / t6)) + 5 - 1)

Submission status: Accepted

Solution code:
import math
n=int(input())
e=[int(input()) for i in range(5)]
#print(n,e)

ans=5+math.ceil((n-min(e))/min(e))
print(ans)

Submission status: Accepted

Solution code:
inpt = []
import math
for i in range(6):
    inpt.append(int(input()))
time = 0
minCarr = inpt[0] 
lastBoarding = 0 
for i in range(5): 
    if inpt[i+1] >= minCarr:
        time += 1
    else: 
        minCarr = inpt[i+1]
        time = i + math.ceil(inpt[0]/inpt[i+1]) 
print(time)

Submission status: Accepted

Solution code:
import numpy as np
import math

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

l = np.array(list)

d = np.amin(l)
dm = np.argmin(l)

print(int(math.ceil(n/d)+4))

Submission status: Accepted

Solution code:
N = int(input())
min = 0
for i in range(5):
    x = int(input())
    if i == 0:
        min = x
    if min > x :
        min = x
#print("N={} min={}".format(N,min))
if N <= min:
    print(5)
elif N % min == 0:
    print(N // min + 4)
else:
    print(N // min + 5)

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

if X != 1:
    print(5+Y)
else:
    print(N + 4 )

Submission status: Accepted

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

l = min(L)
ans = 4 + N // l if N % l == 0 else 4 + N // l + 1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
import math
N = int(input())
can_moves = []
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
min_can_moves = min(can_moves)
time = math.ceil(N / min_can_moves) + len(can_moves) - 1
  
# 出力
print(time)

Submission status: Accepted

Solution code:
input_data = []
hum = int(input())
for i in range(5):
    input_data.append(int(input()))
    
diff = int(hum/min(input_data))
amari= int(hum%min(input_data))
if diff == 1 and amari==0:
    diff=0 
elif amari==0:
    diff-=1
print(5+diff)

Submission status: Accepted

Solution code:
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:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
if A < B:
    B = A
if B < C:
    C = B
if C < D:
    D = C
if D < E:
    E = D
print(5 + (N - 1) // E)

Submission status: Accepted

Solution code:
n = int(input())

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

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

m = min(array)
if n <= m: print(5)
else: 
	if n%m == 0:
		print(4 + (n//m))
	else:
		print(4 + (((n//m)+1)*m)//m)

Submission status: Accepted

Solution code:
n = int(input())
c = [int(input()) for i in range(5)]
mc = min(c)
b = n // mc
r =  0 if n % mc == 0 else 1

print(4 + b + r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

transp = []

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

print(math.ceil(n/transp[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())
if min(a,b,c,d,e) == a:
  if N % a == 0:
    print(N//a + 4)
  else:
    print(N//a + 5)
elif min(b,c,d,e) == b:
  if N % b == 0:
    print(N//b + 4)
  else:
    print(N//b + 5)
elif min(c,d,e) == c:
  if N % c == 0:
    print(N//c + 4)
  else:
    print(N//c + 5)
elif min(d,e) == d:
  if N % d == 0:
    print(N//d + 4)
  else:
    print(N//d + 5)
else:
  if N % e == 0:
    print(N//e + 4)
  else:
    print(N//e + 5)

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
input_list = [a,b,c,d,e]
input_list.sort()
if n % input_list[0] == 0:
    k = n // input_list[0]
else:
    k = n// input_list[0] + 1
print(k +4)

Submission status: Accepted

Solution code:
import math

menber= int(input())
flows=[]

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

print(math.ceil(menber/min(flows))+4)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces


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

Submission status: Accepted

Solution code:
n = int(input())
t = [int(input()) for i in range(5)]
p = n
time = 0
for i,k in enumerate(t):
  
  p = max(0,n-(time-i)*k)
  
  if p <= k:
    time+=1
  else:
    if p%k>0:
      time += int(p/k)+1
    else:
      time+= int(p/k)
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())
s=[A,B,C,D,E]
a=[1,1,1,1,1]
a2=[0,0,0,0,0]
if(A<N):
    a[0]=-(-N // A)
mn=A
if(B<mn):
    mn=B
    a[1]=-(-N // B)
    if(a[0]>1):
        a[0]=1
if(C<mn):
    mn=C
    a[2]=-(-N // C)
    for i in range(0,2):
        if(a[i]>1):
            a[i]=1
if(D<mn):
    mn=D
    a[3]=-(-N // D)
    for i in range(0,3):
        if(a[i]>1):
            a[i]=1
if(E<mn):
    mn=E
    a[4]=-(-N // E)
    for i in range(0,4):
        if(a[i]>1):
            a[i]=1
time=a[0]+a[1]+a[2]+a[3]+a[4]
print(time)

Submission status: Accepted

Solution code:
N = int(input())
pas = [0]*5
for i in range(5):
  pas[i] = int(input())
min_pas = min(pas)
if N==min_pas:
  times = 0
elif min_pas == 1:
  times = N-1
else:
  times = N//min_pas
times += 5
print(times)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,*move=[int(input()) for i in range(6)]

#多分ボトルネックを超える時間数を使う
min_index=0
min_move=move[0]
for i in range(1,5):
    if min_move > move[i]:
        min_move=move[i]
        min_index=i

move_time=min_index

if n%min_move==0:
    move_time+=int(n/min_move)
else:
    move_time+=int(n/min_move)+1


move_time+=5-min_index-1
print(move_time)

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
min = a
if b < min:
    min = b
if c < min:
    min = c
if d < min:
    min = d
if e < min:
    min = e
ans = n//min+5
if n%min == 0:
    ans = ans - 1
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())

little = min([A,B,C,D,E])
res = N//little
if N%little != 0:
    res+=1
res+=4

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())
route=[a,b,c,d,e]
min_route=a
for i in route:
    if i < min_route:
        min_route=i
if n%min_route == 0:
    time=n//min_route+4
else:
    time=n//min_route+5
print(time)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
inputs = [0,0,0,0,0]
inputs[0] = int(input())

inputs[1] = int(input())

inputs[2] = int(input())

inputs[3] = int(input())

inputs[4] = int(input())

posi = [n,0,0,0,0,0]

min = inputs[0]

for inp in inputs:
	if min > inp:
		min = inp

nn = int(n / min)
if nn != 0:
	if n % min != 0:
		nn += 1
	nn = nn -1

nn = 5 + nn

print(nn)

Submission status: Accepted

Solution code:
N=int(input())
l=[]
for i in range(5):
    l.append(int(input()))
m=min(l)
k=[]
if m<N:
    if N%m!=0:#6 2
        b=N//m
        print(b+5)
    else:
        b=N//m
        print(b+5-1)
else:
    print(5)

Submission status: Accepted

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

l=[b,c,d,e]
min=a
for x in l:
    if x<min:
        min=x
if n%min==0:
    ans=n//min+4
else:
    ans=n//min+5
print(ans)

Submission status: Accepted

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

min_num=min(num_list)

if N < min_num :
  print(5)
else:
  if min_num==1:
    count=int(N//min_num)-1
  else:
    count=int(N//min_num)
  print(5+count)

Submission status: Accepted

Solution code:
import math

def main():
    N = int(input())
    a = []
    c = 0
    f = 0
    for i in range(5):
        tr = int(input())
        a.append(tr)
        if i == 0:
            c = tr
        
        if c > tr:
            f = i
            c = tr
    
    print(4 + math.ceil(N / c))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = (4 + N//min(array) + 1) if N%min(array) != 0 else (4 + N//min(array))

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:
from math import ceil
N = int(input())
cap = [int(input()) for i in range(5)]
maxcap = min(cap)
group = ceil(N/maxcap)
print(4 + group)

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
idx = 0
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 = int(input())
mt = []
mt.append(int(input()))
mt.append(int(input()))
mt.append(int(input()))
mt.append(int(input()))
mt.append(int(input()))

print(5 + (n - 1) // min(mt))

Submission status: Accepted

Solution code:
n=int(input())
an=[int(input()) for _ in range(5)]
m = min(an)
if m == 1:
    print(5+n-1)
elif m >= n:
    print(5)
else:
    if n%m != 0:
        print(n//min(an)+5)
    else:
        print(n//min(an)+4)

Submission status: Accepted

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

Submission status: Accepted

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

print((n - 1 + min(lis)) // min(lis) + 4)

Submission status: Accepted

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

aryCapa = wk[1:6]
wkTime = int(wk[0] / min(aryCapa)) + 4
if wk[0] % min(aryCapa) == 0:
  pass
else:
  wkTime += 1

print(wkTime)

Submission status: Accepted

Solution code:
import math
n = float(raw_input())
num = [float(raw_input()) for i in range(5)]

min_num = min(num)

if n <= min_num:
    print 5
else:
    t = math.ceil(n/min_num)
    print int(t)+4

Submission status: Accepted

Solution code:
a=[int(input()) for _ in range(6)]
analMEGA =min(a[1],a[2],a[3],a[4],a[5])
print( 5 + a[0] // analMEGA if a[0] % analMEGA != 0 else 5 + a[0] // analMEGA -1)

Submission status: Accepted

Solution code:
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
ary = [a,b,c,d,e]
# ind_min = ary.index(min(ary))
# cnt = 
if N % min(ary) == 0:
    print(int(N/min(ary)+4))
else:
    print(int(N/min(ary)+5))

Submission status: Accepted

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

print((n-1)//min(l)+5)

Submission status: Accepted

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

sorted_cities = sorted(cities)
if N % sorted_cities[0] == 0:
    times = N / sorted_cities[0]
else:
    times = (N - N % sorted_cities[0]) / sorted_cities[0] + 1
print(int(times + 4))

Submission status: Accepted

Solution code:
def answer():
    N = int(input()) # 人数
    l = []
    for _ in range(5):
        l.append(int(input())) # 都市間の移動時間

    time = 0
    time += (N-1) // min(l) +5
    return time

def main():
    print(answer())

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

time = 0
array = a, b, c, d, e
ind = array.index(min(array))
time = - (-n // array[ind])
time = ind+time+(4-ind)
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())

if n == 0:
  print(0)

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

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

Submission status: Accepted

Solution code:
from math import ceil
n = int(input())
ps = [int(input()) for _ in range(5)]
min_p = min(ps)
times = ceil(n / min_p) - 1
print(times + 5)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input())for _ in range(5)]
A.sort()
if A[0]==N:
    print(5)
elif N%A[0]==0:
    print(N//A[0]+5-1)
else:
    print(N//A[0]+5)

Submission status: Accepted

Solution code:
n=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
a.sort()
if n%a[0]==0:
  add=n//a[0]-1
else:
  add=n//a[0]
print(5+add)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

def main():
	N = int(input())
	me = []
	mini = -1
	for i in range(5):
		tmp = int(input())
		me.append(tmp)
		if mini == -1 or mini > tmp:
			mini = tmp

	time = 5
	tmp = N // mini
	amari = N % mini

	if amari > 0:
		print(time + tmp)
	else:
		print(time + tmp-1)
	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

min_cap = None
min_i = 0
for i, c in enumerate(capacities):
    if min_cap is None or c < min_cap:
        min_i = i
        min_cap = c

# 全員が移動する時間 = (1) + (2) + (3)
# (1) 定員 min_cap の乗り物が出発する都市に人が到達する時刻
t1 = min_i
# (2) (1) から N 人を min_cap 人ずつ送り出していくとき最後のグループを送り出すまでにかかる時間
t2 = (N + min_cap - 1) // min_cap
# (3) (2) から最後のグループが都市 6 に到達するまでの時間
t3 = 5 - (min_i + 1)

print(t1 + t2 + t3)

Submission status: Accepted

Solution code:
import math

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

    min_time = min(time)
    ans = 5 + math.ceil((N - min_time) / min_time)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


m = min(l)
print((n-1)//m + 1 + 4)

Submission status: Accepted

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

print(time)

Submission status: Accepted

Solution code:
N =int(input())
l =[int(input()) for i in range(5)]
s=[N]
st=[0 for i in range(5)]
s.extend(st)
ans=0

min_num=min(l)
min_ind=l.index(min_num)

if N%min_num==0:
    times=int(N/min_num)
else:
    times=int(N/min_num)+1

dis=4
ans=times+dis

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

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

print(5+math.ceil(N/min(L))-1)

Submission status: Accepted

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

people = int(input())
capacities = [int(input()) for i in range(5)]
print(5 + ceil(people/sorted(capacities)[0] - 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())

li = [A, B, C, D, E]
temp = min(li)

if N <= min(li):
    print(5)
else:
    print(math.ceil(N/temp) + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

min_val = min(list)

if N%min_val == 0:
    print(N//min_val+4)
else:
    print(N//min_val+1+4)

Submission status: Accepted

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

capa = [A,B,C,D,E]
r1 = A
r2 = min(A,B)
r3 = min(r2,C)
r4 = min(r3,D)
r5 = min(r4,E)

t = 4+N//r5+1*(N%r5!=0)

print(int(t))

Submission status: Accepted

Solution code:
import math

N = int(input())
t = []

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

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

Submission status: Accepted

Solution code:
import math
time = 5
people = int(input())
capacity = []
for i in range(5):
    capacity.append(int(input()))

time += math.ceil(people/min(capacity)) - 1
print(time)

Submission status: Accepted

Solution code:
N = int(input())
t = [int(input()) for _ in range(5)]
min_t = min(t)
index = t.index(min_t)
num = N // min_t
if N % min_t != 0:
    num += 1
print(num + 4)