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 sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left
from math import factorial


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n = I()
L = IR(5)
print(5 + (n - 1) // min(L))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

bottleneck = min(a, b, c, d, e)
total = 4 + ceil(n / bottleneck)
print(total)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())
    P = [int(input()) for _ in range(5)]
    
    min_P = min(P)
    
    count = 0
    count += 4
    count += N//min_P
    if N//min_P < N/min_P:
        count += 1
    
    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 乗客制限人数の内最小人数
minLimit = min(pasLimit)
groupNum = n//minLimit
if n%minLimit != 0:
  groupNum += 1
print(5 + (groupNum-1))

Submission status: Accepted

Solution code:
n=int(input())
a=[]
for i in range(5):
    a.append(int(input()))
    
ans=5
ind=0
m=min(a)
for i in range(n):
    if m==a[i]:
        ind=i
        break
k=n//m
if n%m!=0:
    k+=1
print(ans+k-1)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(5):
    if i == 0:
        min_a = int(input())
    else:
        a = int(input())
        min_a = min(min_a,a)
print((n//min_a)+4 if n%min_a==0 else (n//min_a)+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())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil


n = int(input())
a = [int(input()) for i in range(5)]
if min(a) >= n:
    print(5)
    exit()
print(ceil(n / min(a)) + 5 - 1)

Submission status: Accepted

Solution code:
import math

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

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)
if n%mi != 0:
    print((n//mi)+1+4)
else:
    print((n//mi)+4)

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    ls = [int(input().rstrip('\n')) for _ in range(5)]
    m_t = min(ls)
    print((n + m_t - 1) // m_t + 4)


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

ans = ceil(N/min(A)) + 4

print(ans)

Submission status: Accepted

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

move = min(ride)

import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T = list(map(int, [input() for _ in range(5)]))
t = min(T)
print(N // t + bool(N % t) + 4)

Submission status: Accepted

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

a = min(f)
result = 0
result += n//a
if n%a != 0:
    result += 1

print(result+4)

Submission status: Accepted

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

    ans = 4 + (N // min(A) + (1 if N % min(A) > 0 else 0))
    print(ans)

main()

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:
n = int(input())
C = [int(input()) for i in range(5)]
print(4-(-n)//min(C))

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
lst = []
min = 10**15
for i in range(5):
    x = int(input())
    lst.append(x)
    if min > x:
        min = x
        loc = i

time = 4 + ceil(N/min) 
print(time)

Submission status: Accepted

Solution code:
from math import ceil
n, a, b, c, d, e = (int(input()) for i in range(6))
move01 = int(ceil(n/a))
move12 = 1 + int(ceil(n/min(a,b)))
move23 = max(2 + int(ceil(n/c)), 1 + move12)
move34 = max(3 + int(ceil(n/d)), 1 + move23)
move45 = max(4 + int(ceil(n/e)), 1 + move34)
print(move45)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

ans = 5+(N//min_cap)

if N%min_cap == 0:
    ans -= 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for i in range(5)]
# L = [0] * 6
# L[0] = n

# ans = 0
# for i in range(5):
#     time = -(-L[i]//A[i])
#     ans += time
#     L[i], L[i+1] = 0, L[i]+L[i+1]
#     print("t", time)
#     print(L)
#     for j in range(i+1, 5):
#         print(j)
#         time = max(0, time-1)
#         saigo = min(A[j-1], L[j]) # 最後の1分でL[j]にたどり着いた人数

#         mem = L[j] - saigo  # L[j+1]に移動し得る人数
        
#         L[j], L[j+1] = saigo + mem - min(mem, time*A[j]), min(mem, time*A[j])+L[j+1]
#         print(L)

    
# print(ans)

time = -(-n//min(A))
print(time + 4)

Submission status: Accepted

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

print (int(ceil(N / min(T))) + len(T) - 1)

Submission status: Accepted

Solution code:
import math

N = int(input())
A, B, C, D, E = [int(input()) for i in range(5)]

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

print(ans)

Submission status: Accepted

Solution code:
from math import ceil

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
N=input()
A=input()
B=input()
C=input()
D=input()
E=input()
N=int(N)
A=int(A)
B=int(B)
C=int(C)
D=int(D)
E=int(E)
a=N//A
b=N//B
c=N//C
d=N//D
e=N//E
f=max(a,b,c,d,e)
g=min(A,B,C,D,E)
if N%g==0:
    print(f+4)
else:
    print(f+5)

Submission status: Accepted

Solution code:
X=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
A=[a,b,c,d,e]
print((X-1)//min(A)+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)
if N%x==0:
   print(N//x+4)
else:
    print(N//x+5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math
import copy
import fractions
import numpy as np
from functools import reduce

# ===FUNCTION===

def getInputNum():
    inputNum = int(input())
    return inputNum

def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData

def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList

def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList

# ===CODE===

n, = map(int, input().split())
metroNum = 6
transLim = getSomeInputInt(metroNum-1)

neck = min(transLim)

tmpans = math.ceil(n/neck)
ans = tmpans + metroNum - 2

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input()) for _ in range(5)]
print(4+N//min(A)+(N%min(A)>0))

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_move = min(A, B, C, D, E)

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

Submission status: Accepted

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

ans = N // rl + 4
if N % rl != 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())
t = min(a, b, c, d, e)
print(4 + (n + (t - 1)) // t)

Submission status: Accepted

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

dp = [0] * 6
dp[0] = N
T = [A,B,C,D,E]
ans = 0

ans = -(-N//min(T)) + 4
# while dp[5] < N:
#     for i in range(4, -1, -1):
#         if dp[i] == 0:
#             continue
#         dp[i+1] += min(dp[i],T[i])
#         dp[i] -= min(dp[i],T[i])
#     ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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


# TLE
def sim(n, xs):
    state = [n] + [0] * 5
    step = 0
    while state[5] < n:
        moves = [min(state[i], xs[i]) for i in range(5)]
        for i in range(5):
            state[i] -= moves[i]
            state[i + 1] += moves[i]
        step += 1

    return step


def solve(n, xs):
    return math.ceil(n / min(xs)) + 4


print(solve(n, xs))

Submission status: Accepted

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

Submission status: Accepted

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

ans = ceil(n / min(a)) + 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


def main(): 

    N=int(input())
    a=[int(input()) for _ in range(5)]
    group = (N+min(a)-1)//min(a)
    print(4+group)



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

m = min(a,b,c,d,e)
#切り上げでなくてはいけなかった
n2 = int(math.ceil(n / m))
time = 5 + (n2-1)
print(time)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

_min = min(abc)

count = math.ceil(N/_min)


print(5+(count-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())

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

answer = 5 + math.ceil(N/s) - 1

print(answer)

Submission status: Accepted

Solution code:
from math import ceil

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

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

Submission status: Accepted

Solution code:
import math


def resolve():
    n = int(input())
    abcde = list(int(input()) for _ in range(5))
    print(math.ceil(n / min(abcde)) + 4)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import math
def main():
    N = int(input())
    min_f = float('inf')
    for i in range(5):
        f = int(input())
        min_f = min(min_f, f)

    return 4 + math.ceil(N/min_f)

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

m = min(A)
grp = -(-n // m)
print (grp  -1 + 5)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

N = I()
x = [0]*5
for i in range(5):
    x[i] = I()

move = min(x)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b,c,d,e = map(int,[input() for i in range(6)])
from math import ceil
print(4+ceil(n/min(a,b,c,d,e)))

Submission status: Accepted

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

x = min(A)
print(math.ceil(n/x) + 4)

Submission status: Accepted

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

print(k+4)

Submission status: Accepted

Solution code:
import math
n = int(input())
s = []
for i in range(5):
  s.append(int(input()))
s_min = min(s)
min_idx = s.index(s_min)

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

Submission status: Accepted

Solution code:
N = int(input())
min_ = min(int(input()) for _ in range(5))

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

Submission status: Accepted

Solution code:
import math

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

print(ans)

Submission status: Accepted

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

ans = 0
if n % min(trans) == 0:
    ans = n//min(trans)+4
else:
    ans = n//min(trans)+5

print(ans)

Submission status: Accepted

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

if N%Amin ==0:
  ans = N//Amin-1+5
else:
  ans = N//Amin+5

print(ans)

Submission status: Accepted

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

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

# t = [n]
# for _ in range(5 + 1):
#   t.append(0)
# print(a)
# print(t)
# ans = 0
# while t[5] != n:
#   for i in range(5-1,-1,-1):
#     if t[i] >= a[i]:
#       t[i] -= a[i]
#       t[i + 1] += a[i]
#     else:
#       t[i + 1] += t[i]
#       t[i] = 0
#     print(t)
#   print()
#   ans += 1
  
# print(ans)

Submission status: Accepted

Solution code:
import math,fractions
from collections import Counter
n,a,b,c,d,e = [int(input()) for i in range(6)]
print((n-1)//min(a,b,c,d,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())

tmp = min(A,B,C,D,E)
if N % tmp == 0:
    ans = N // tmp
else:
    ans =  N // tmp + 1

print(ans+4)

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

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

Submission status: Accepted

Solution code:
import math

n=int(input())
l=[]
for i in range(5):
    l.append(int(input()))
    
m=math.ceil(n/min(l))

print(m-1+5)

Submission status: Accepted

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

n = int(input())

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

import math
ans = math.ceil(n/bn) + 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil,floor

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(ceil(n/min(a,b,c,d,e)) + 4)

Submission status: Accepted

Solution code:
import math

N = int(input())
minNum = int(input())
for i in range(1, 5):
    inputNum = int(input())
    if minNum > inputNum:
        minNum = inputNum
print(math.ceil(N/minNum) + 4)

Submission status: Accepted

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

transport_capacities = [
    [1, a]
    ,[2, b]
    ,[3, c]
    ,[4, d]
    ,[5, e]
    ]


#               0  1  2  3  4  5  6
man_in_cties = [0, n, 0, 0, 0, 0, 0]

# 一番輸送力の低い手段
transport_capacities.sort(key=lambda x: x[1])
min_capa_id, capa = transport_capacities.pop(0)

total_time = (min_capa_id-1)

if n % capa > 0:
    total_time += n//capa + 1
else:
    total_time += n//capa

total_time += 5 - min_capa_id

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

Submission status: Accepted

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

Submission status: Accepted

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

minimum = min(l)
if n % minimum == 0:
    ans = n / minimum + 4
else:
    ans = (n // minimum) + 5

print(int(ans))

Submission status: Accepted

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

min_transporter = min([A, B, C, D, E])
if min_transporter >= N:
  print(5)
else:
  print((N + min_transporter - 1) // min_transporter + 4)

Submission status: Accepted

Solution code:
n = int(input())
transportation = list(int(input()) for _ in range(5))

print(int(-(-n//min(transportation)) + 4))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

def getint(): return int(input())
def getints(): return list(map(int, input().split()))

n = getint()
a = min([getint() for _ in range(5)])
m = (n + a - 1) // a
print(m + 4)

Submission status: Accepted

Solution code:
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
print(math.ceil(N/min(A,B,C,D,E))+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

n = int(input())
caps = []

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

minV = min(caps)

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

Submission status: Accepted

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

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:

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

ans = 4 + n // min(li)
if n % min(li) != 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())

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

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

Submission status: Accepted

Solution code:
# 2019/08/07

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

ans=5+n//a-1 if n%a==0 else 5+n//a
print(ans)

Submission status: Accepted

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

n = int(input().split()[0]) # 人数
a = int(input().split()[0]) # 電車の定員
b = int(input().split()[0]) # バスの定員
c = int(input().split()[0]) # タクシーの定員
d = int(input().split()[0]) # 飛行機の定員
e = int(input().split()[0]) # 船の定員

# 貪欲法だと時間内に解けないので、
# 一番きついところを考える
min_cap = min([a, b, c, d, e])

# (i - 1) + (5 - i) = 4
# 4分間は乗れない時間帯がある
ans = math.ceil(float(n) / min_cap) + 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())
import math
print(math.ceil(n/min(a,b,c,d,e))+4)

Submission status: Accepted

Solution code:
from math import ceil

N,a,b,c,d,e = [int(input()) for x in range(6)]
print(int(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())
m = min(A, B, C, D, E)
r = math.ceil(N/m)+4
print(r)

Submission status: Accepted

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

min_cap = min(cap)

time = 4 + n//min_cap
if n%min_cap != 0:
	time += 1
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())

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

Submission status: Accepted

Solution code:
import sys
from collections import deque, defaultdict
import copy
import bisect
#input=sys.stdin.readline
#sys.setrecursionlimit(10 ** 9)
import math
import heapq
 
#N, K = list(map(int, input().split()))
 
N = int(input())
 
x = []
for i in range(5):
	x.append(int(input()))
 
bottle = min(x)
times = math.ceil(N/bottle)
print(times + 4)

Submission status: Accepted

Solution code:
import math
import heapq
 
#N, K = list(map(int, input().split()))
 
N = int(input())
 
x = []
for i in range(5):
	x.append(int(input()))
 
bottle = min(x)
times = math.ceil(N/bottle)
print(times + 4)

Submission status: Accepted

Solution code:
import math
import heapq


N = int(input())

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

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

Submission status: Accepted

Solution code:
def five_transportations(n,a):
    min_a = min(a)
    rem = n
    count = 0
    mod = -(-rem//min_a)
    mod += 5 - 1
    return mod
if __name__ == '__main__':
    n = int(raw_input())
    a = [int(raw_input()) for i in range(5)]

    print five_transportations(n,a)

Submission status: Accepted

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

Submission status: Accepted

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

g = N // p + (1 if N % p > 0 else 0)

print(5 + g - 1)

Submission status: Accepted

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

min_trans = min(trans)
print(math.ceil(n/min_trans) + 4)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

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)
t = 4
if n % m ==0:
    t += n//m
else:
    t += n//m + 1
print(t)