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,a,b,c,d,e=(int(input()) for i in range(6))
print(math.ceil(n/min(a,b,c,d,e)+4))

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = -(-n//small_road)+4

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def roof(x):
    if x == int(x):
        return int(x)
    else:
        return int(x)+1

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

m = min(l)

t = roof(n/m)

print(t + 4)

Submission status: Accepted

Solution code:
# coding:utf-8
import math

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

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

total = 0

ride_list = []

ride_list.append(a)
ride_list.append(b)
ride_list.append(c)
ride_list.append(d)
ride_list.append(e)

ride_list.sort()

round_total = math.ceil(n / ride_list[0])
total = round_total + 4

print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

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

neck_list = []
for num in num_list:
    neck_list.append(math.ceil(n/num))

print(4 + max(neck_list))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

max_nums = []
for i in range(5):
  max_nums.append(int(input()))
max_nums.append(n)
a = n/min(max_nums)
print(int(a) +4+ (0 if a == int(a) else 1))

Submission status: Accepted

Solution code:
N = int(input())
cyapa = []
for i in range (1,6):
    cyapa.append(int(input()))
kasu = min(cyapa)
if kasu >= N:
    ans = 5
else:
    ans = 5 + (N-1)//kasu
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

num = [int(line.strip()) for line in sys.stdin]
N = num.pop(0)
n = min(num)
print((N+n-1)//n + 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:
from itertools import permutations

N = int(input())
trans = [int(input()) for _ in range(5)]
bottleneck = min(trans)

print((N-1) // bottleneck + 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())
stay_a=N
stay_b=0
stay_c=0
stay_d=0
stay_e=0
stay_f=0
f = -(-N//min(A,B,C,D,E))
print(4+f)

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
min = min(A, B, C, D, E)
 
ans = 4 + int(N/min)
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())
# N=5
# A=3
# B=2
# C=4
# D=3
# E=5
# L = [0]*5
# L[0] = N
# count = 0
# while sum(L) != 0:
#     if L[4] != 0:
#         tmp0 = min(L[4],E)
#         L[4] -= tmp0
#     if L[3] != 0:
#         tmp0 = min(L[3],D)
#         L[3] -= tmp0
#         L[4] += tmp0
#     if L[2] != 0:
#         tmp0 = min(L[2],C)
#         L[2] -= tmp0
#         L[3] += tmp0
#     if L[1] != 0:
#         tmp0 = min(L[1],B)
#         L[1] -= tmp0
#         L[2] += tmp0
#     if L[0] != 0:
#         tmp0 = min(L[0],A)
#         L[0] -= tmp0
#         L[1] += tmp0
#     count += 1
print((N-1) // min(A,B,C,D,E) + 5)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(5)]
small = min(A)
a = A.index(min(A)) 
bottle = float(N/small if small!=1 else N)
if bottle >int(bottle):
    bottle = int(bottle)+1
print(int(4+max(bottle,1)))

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(5)]
small = min(A)
a = A.index(min(A)) 
bottle = (N+small-1)/small if small!=1 else N
print(int(4+max(bottle,1)))

Submission status: Accepted

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

print (time)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, = read_line(int)

weights = []
for i in range(5):
    w, = read_line(int)
    weights.append(w)

if n == 0:
    print(0)
elif n <= min(weights):
    print(5)
else:
    print(5 + int(math.ceil(n / min(weights))) - 1)

Submission status: Accepted

Solution code:
from math import ceil
from sys import stdin
N = int(stdin.readline().rstrip())
cities = [int(stdin.readline().rstrip()) for _ in range(5)]
print(ceil(N/min(cities))+4)

Submission status: Accepted

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

import math


def problem(n, a, b, c, d, e):
    return int(math.ceil(n / min(a, b, c, d, e))) + 4


def main():
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    print(problem(n, a, b, c, d, e))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = []
for i in range(6):
  a.append(int(input()))
print((a[0]-1)//min(a[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())

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

ans = 4 + int(N/min)
if N % min != 0:
    ans = ans + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(N // A + int(N % A != 0) + 4)

Submission status: Accepted

Solution code:
import math

s=[int(input()) for x in range(6)]

n=s.pop(0)
t=int(4+math.ceil(1.0*n/min(s)))

print(t)

Submission status: Accepted

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

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

if N <= min(ls):
    print(5)
else:
    mint = min(ls)
    ans = 4 + math.ceil(N/mint) 
    print(ans)

Submission status: Accepted

Solution code:
import math

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

x = 1
for a in A:
    x = max(x, math.ceil(N / a))
print(4 + x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())

a = []

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

if N <= min(a):
  print(5)
else:
  print(ceil(N/min(a))+4)

Submission status: Accepted

Solution code:
n = int(input())
times = [int(input()) for i in range(5)]
bottleneck = min(times)
at_bn = n // bottleneck + (n%bottleneck>0)
total_time = 4 + at_bn
print(total_time)

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())
b=min(a)
if b>=n:
    print(5)
else:
    print(n//b+(n%b>0)+4)

Submission status: Accepted

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

import math

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

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

Submission status: Accepted

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

s = min(A)
c = N // s

if N - c * s > 0:
  c += 1
  
c+=4

print(c)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc123
# -*- coding: utf-8 -*-

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

minimum = min(v)
if n % minimum is 0:
    print((n // minimum)+4)
else:
    print((n // minimum)+5)

Submission status: Accepted

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

n = int(input())

data = []
for i in range(5):
    data.append(int(input()))
flow = min(data)

if n % flow == 0:
    ans = n // flow + 4
else:
    ans = n // flow + 5

print(ans)

Submission status: Accepted

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

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

if N%min(data) == 0:
    time = N//min(data) + 4
else:
    time = N//min(data) + 5

print(time)

Submission status: Accepted

Solution code:
a = input()
s = input()
d = input()
f = input()
g = input()
h = input()
j = min(int(s), int(d), int(f), int(g), int(h))

if int(a)%j == 0:
    k = int(a)//j + 4
else:
    k = int(a)//j + 5
print(k)

Submission status: Accepted

Solution code:
import math

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

min_n = min(nums)

print(math.ceil(N/min_n) + 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])
ans = N // m if N % m != 0 else (N // m) - 1

print(ans + 5)

Submission status: Accepted

Solution code:
import math

N=int(input())
mincapacity=10**16
for i in range(5):
  capacity=int(input())
  if capacity<mincapacity:
    mincapacity=capacity
    minindex=i
print(5+math.ceil(N/mincapacity)-1)

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]

def wari(a,n):
    if n%a == 0:
        return n//a
    else:
        return n//a + 1


modtrans = [wari(i,n) for i in trans]

print(max(modtrans) + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
numberOfToorists = int(input())

minimumCapacity = 10.0**16

for i in range(5):
	vehicleCapacity = int(input())
	minimumCapacity = min(minimumCapacity, vehicleCapacity)

bottleNeckTime = int(numberOfToorists / minimumCapacity)

if numberOfToorists % minimumCapacity > 0:
	bottleNeckTime += 1

requiredTime = bottleNeckTime + 4

print(requiredTime)

Submission status: Accepted

Solution code:
import math
if __name__ =="__main__":
    N = input()
    N = float(N)
    cap_min=10.0**16
    for x in range(5):
        a = input()
        cap_min = min(float(a),cap_min)
    time = math.ceil(N/cap_min)+4
    print(time)

Submission status: Accepted

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


y = min(x)
#print(math.ceil(N/y)+4)

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

Submission status: Accepted

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


y = min(x)
print(math.ceil(N/y)+4)

Submission status: Accepted

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

m = a[0]
for i in range(5):
        if a[i] < m:
                m = a[i]
        else:
                a[i] = m


s = 4 + int(math.ceil(N / a[4]))

print(s)

Submission status: Accepted

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

minv = min(a)
print((n + minv - 1) // minv + 4)

Submission status: Accepted

Solution code:
n=int(input())
li = [int(input()) for _ in range(5)]  # li = ['hoge', 'bar', 'foo']

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

Submission status: Accepted

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

# スペース区切りの整数の入力
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

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

ans= 4 + math.ceil(N/bottle_neck)

print(ans)

Submission status: Accepted

Solution code:
import math

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

# 交通機関のうち、最初の輸送可能乗客数を持つものに合わせる
X = min(abcde)
print(math.ceil(N / X) - 1 + 5)

Submission status: Accepted

Solution code:
data = [int(input()) for i in range(6)]
print(-(-data[0]//min(data[1:]))+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    n = float(input())
    tr = [float(input().replace('\n', '')) for i in range(5)] #なんで改行入るの 
    
    q, mod = divmod(n, min(tr))
    
    if(mod == 0):
        q = q - 1
    
    print(int(5 + q))
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = n//capa_min 

# if n <= capa_min:
#     amari = 0
# else:
amari = n % capa_min

# 人数が割り切れたら
if amari != 0:
    ans += 5
else:
    ans += 4
    
print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# using this function takes too long time!
def step():

    for i in range(4,-1,-1):
        if state[i] <= capacities[i]:
            state[i+1] += state[i]
            state[i] = 0
        
        else:
            state[i+1] += capacities[i]
            state[i] -= capacities[i]


N = int(input())
capacities = [int(input()) for _ in range(5)]
# state = [N,0,0,0,0,0]

# t = 0
# while True:
#     t += 1
#     step()

#     if state[-1] == N:
#         break


t = (N-1) // min(capacities) + 1 + 4

print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

N = int(input())  # the number of people
A = [int(input()) for _ in range(5)]  # capacities

m = min(A)  # bottle neck
t = math.ceil(N / m)  # the number of subgroups
print(5 + t - 1)

Submission status: Accepted

Solution code:
n=int(input())
p=[0]*5
for i in range(5):
    p[i]=int(input())
p.sort()
if n%p[0]!=0:
    ans=5+(n-n%p[0])/p[0]
else:
    ans=4+n/p[0]
print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

print(4+math.ceil(member/min(city)))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
move = []
min_time =0

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

if (N == min(move)):
    min_time = 5;
elif (N//min(move) == N/min(move)):
    min_time = N//min(move) + 4;
else:
    min_time = N//min(move) + 5;

print (min_time);

Submission status: Accepted

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

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)

ans = 5+n//minimum

if n%minimum == 0:
  ans -=1

print(ans)

Submission status: Accepted

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

A = list()
for i in range(5):
    A.append(int(input()))

min_num = min(A)

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


print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
 
minimum = min(a,b,c,d,e)
 
ans = 5+n//minimum

if n%minimum == 0:
    ans -=1
 
print(ans)

Submission status: Accepted

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

if N % mini != 0:
    ans = N // mini + 1 + 4
else:
    ans = N // mini + 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)
if n%x==0:
    y=n//x-1
else:
    y=n//x
print(5+y)

Submission status: Accepted

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

Submission status: Accepted

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

def timeToDestination(N, t):
  h = min(t)
  if N % h == 0:
    return 4 + (N // h)
  return 5 + (N // h)
  
print(timeToDestination(N, transport))

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
def solve(n, traffic_list):
    min_val = min(traffic_list)
    if n % min_val == 0:
        return n // min_val + len(traffic_list) - 1
    else:
        return n // min_val + len(traffic_list)


def main():
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    ans = solve(n, [a, b, c, d, e])
    print(ans)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math as m
L = [int(input()) for i in range(6)]
print(m.ceil(L[0] / min(L[1:])) + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = 6 #入力する数
a = [] #aに格納する
sum = 0 #宣言

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

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(5):
    a.append(int(input()))
if n % min(a) == 0:
    print(5 + n // min(a) -1)
else:
    print(5 + 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())
ans=5+n//(min(a,b,c,d,e))
if n%min(a,b,c,d,e) == 0:
  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())

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

ans = 5+n//minimum
if n%minimum == 0:
    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())
mi = min(A,B,C,D,E)
print(int((N + mi -1)/mi + 4))#切り上げテク

Submission status: Accepted

Solution code:
def transport(n,a,b,c,d,e):
    s = [a,b,c,d,e]
    x = min(s)
    return 5+int(1/x*(n-1))
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(transport(n,a,b,c,d,e))

Submission status: Accepted

Solution code:
import math

N = int(input())
capa = [int(input()) for i in range(5)]
min_capa = min(capa)

ans = int(math.floor(5 + (1 / min_capa) * (N - 1)))

print(ans)

Submission status: Accepted

Solution code:
import math
nums = [int(input()) for i in range(6)]

m = min(nums[1:])
batches = math.ceil(nums[0] / m)
more = batches - 1
print(5 + more)

Submission status: Accepted

Solution code:
# TODO C - Five Transportations
# https://atcoder.jp/contests/abc123/tasks/abc123_c

NUM_TRANSPORTATIONS = 5
N = int(input())

min_t = float("inf")

for t in range(NUM_TRANSPORTATIONS):
    tt = int(input())
    if tt < min_t:
        min_t = tt
print '{}'.format( (N-1) / min_t + 5)

Submission status: Accepted

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

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

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

min_val = min(a,b,c,d,e)
if n / min_val == 0:
    ans = 5
else:
    ans = ceil(4 + n / min_val) 
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())
sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)
z = 4
if n % min(sample_list) == 0:
  x = n // min(sample_list)
  print(z + x)
else:
  y = n // min(sample_list)
  print(z + y + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

people_num = int(input())

Transport_list = [0 for i in range(0,5)]
for i in range(5):
    Transport_list[i] = int(input())

bottle_nec = min(Transport_list)

if(people_num%bottle_nec == 0):
    print(people_num // bottle_nec + 4)
else:
    print(people_num // bottle_nec + 1 + 4)

Submission status: Accepted

Solution code:
import math

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

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


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

Submission status: Accepted

Solution code:
import math

# N = 5
# N = 10
# N = 10000000007
# car = [3, 2, 4, 3, 5]
# car = [123, 123, 123, 123, 123]
# car = [2, 3, 5, 7, 11]
# tmp = [N, 0, 0, 0, 0]

N = int(input())

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

car.sort()

min_num = car[0]

time = math.ceil(N / min_num) + 4

print(time)

Submission status: Accepted

Solution code:
n = int(input())

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

lmin = min(l)

ans = (n-1) // lmin + 1 + 4

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
import numpy as np
line = np.zeros([5,],dtype=np.int)

minval = 10**15+1
minind = 0
for i in range(0,5):
    line[i] = int(input())
    if minval>line[i]:
        minind = i
        minval=line[i]

rem = n%minval
time = n//minval

count = 4
if rem==0:
    print(count+time)
else:
    print(count+time+1)

Submission status: Accepted

Solution code:
import sys
import math

N = int(input())

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

now = [N, 0, 0, 0, 0, 0]

ans = math.ceil(float(N)/min(cap)) + 4

#while now[5] != N:
#	for i in reversed(range(5)):
#		if now[i] > 0:
#			if now[i] >= cap[i]:
##				now[i] -= cap[i]
#				now[i+1] += cap[i]
#			elif now[i] < cap[i]:
#				now[i+1] += now[i]
#				now[i] = 0
#
#	ans += 1

print(int(ans))

Submission status: Accepted

Solution code:
n = int(input())
List = []
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))

import math
print(math.ceil(n/min(List))+4)

Submission status: Accepted

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

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

time=-(-n//mintime)+4
print(time)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,*l=[int(input())for _ in range(6)]
m=min(l)
if m==1:print(n+4)
else:print(n//m+5)

Submission status: Accepted

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

member = [A, B, C, D, E]
if N % min(member) == 0:
    answer = N // min(member) + 4
else:
    answer = N // min(member) + 5
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

Lmin = min(L)
ans = (N+Lmin-1)//Lmin + 4

print(ans)

Submission status: Accepted

Solution code:
# not solved myself
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 = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())


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

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
 
 
min = min(a,b,c,d,e)
 
print(int((n-1)/min)+5)