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

def main():
    """ 以下にコードを書いてください """
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    
    min_capacity = min(A,B,C,D,E)

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

tmp = min(max_available)
if tmp >= N:
    print(5)
else:
    print(4 + (N + tmp - 1) // tmp)

Submission status: Accepted

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

list_trans.sort()

if N % list_trans[0] == 0:
	time = N // list_trans[0]
elif N % list_trans[0] != 0:
	time = N // list_trans[0] + 1
print(time + 4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

X=np.asarray([A,B,C,D,E])
X=np.sort(X)
if N%X[0]==0:
	y=N//X[0]
elif N%X[0]!=0:
	y=N//X[0]+1
print(y+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())
capacity_list = [int(input()) for _ in range(5)]
capacity_list.sort()
bottle_neck = capacity_list[0]
print(4+int((N+bottle_neck-1)/bottle_neck))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

A = []
N = int(input())
for i in range(5):
    a = int(input())
    A.append(a)
min_t = min(A)
"""
if N % min_t == 0:
    a = N // min_t
else:
    a = N // min_t + 1
"""
a = math.ceil(N / min_t)
print(a + 4)

Submission status: Accepted

Solution code:
import math
#入力値を定義
N, A, B, C, D, E = eval("int(input())," * 6)
# Nをmin(A~E)で割った商を繰り上げた分だけ、移動が余計にかかる
print(4 + math.ceil(N / min(A, B, C, D, E)))

Submission status: Accepted

Solution code:
#!/usr/bin/python

def main():
    N = int(input())
    d = []
    for _ in range(5):
        d.append(int(input()))
    print(-(-N // min(d)) + 4)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

N=int(input().strip())
a=[0]*5
ans=0
for i in range(5):
    a[i]=int(input().strip())
#ans=5+math.floor(N/min(a))
ans=4+math.ceil(N/min(a))
print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
t = [0] * 5
t[0] = int(input())
t[1] = int(input())
t[2] = int(input())
t[3] = int(input())
t[4] = int(input())

print(math.ceil(n / min(t)) + 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

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

print(x + 4)

Submission status: Accepted

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

print((N + min(A) - 1) // min(A) + 4)

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math


n = int(input())
capacity = []
for _ in range(5):
  capacity.append(math.ceil(n / int(input())))

ans = 5 + capacity[0]-1
mn = capacity[0]
for i in capacity[1:]:
  if mn < i:
    ans += i - mn
    mn = i
print(ans)

Submission status: Accepted

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

N = int(input())
# ボトルネックとなる制限人数を取得
mini = min([int(input()) for _ in range(5)])

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

Submission status: Accepted

Solution code:
import math

N = int(input())
list = []
min = 0
for i in range(5):
  list.append(int(input()))
  if min > list[i] or i == 0:
    min = list[i]

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

Submission status: Accepted

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

Submission status: Accepted

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

bottleneck = min(time)
print(-(-N // bottleneck) + 4)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(5)]
q_max = 0
res = 5
for i in range(len(a)):
  q = n // a[i]
  r = n % a[i]
  if r > 0:
    q_max = max(q_max, q)
  else:
    q_max = max(q_max, q - 1)
print(res + q_max)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
li = [int(input()) for _ in range(5)]
li2 = [int(n/li[i]) if n%li[i]!=0 else int(n/li[i])-1 for i in range(5)]

print(5+max(li2))

Submission status: Accepted

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

output = N % min(a)
output = N // min(a) + 1 if output > 0 else N // min(a)
print(output + 4)

Submission status: Accepted

Solution code:
import math
n = int(input())
cnt = 4
a = int(input())
min = a

for i in range(4):
	b = int(input())
	if b < min:
		min = b

cnt += math.ceil(n / min)

print(cnt)

Submission status: Accepted

Solution code:
import sys
import math


def main():
    n = int(sys.stdin.readline())
    move = [int(x) for x in sys.stdin.readlines()]
    min_move = min(move)
    print(math.ceil(n/min_move) + 4)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

n = int(input())
transports = list()

for i in range(5):
    transports.append(int(input()))
    
min_cost = min(transports)
print(math.ceil(n/min_cost)+4)

Submission status: Accepted

Solution code:
import math

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

neck = min(caps)
ans = 5 + math.ceil(N/neck) - 1

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

tr = [A,B,C,D,E]
ls = []

for i in range(0,5):
    ls.append([tr[i],i])

m = min(ls)[0]
i = min(ls)[1]

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

Submission status: Accepted

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

nar = min(l)
print((n//nar+bool(n%nar))+4)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

seiyaku = min(a)

print(-(-N // seiyaku)+4)

Submission status: Accepted

Solution code:
from math import ceil
n = int(input())
A = [int(input()) for i in range(5)]
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())
s = min(A, B, C, D, E)
if N % s == 0:
    print(N // s + 4)
else:
    print(N // s + 5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
N = int(input())
trans = [int(input()) for _ in range(5)]
maxi = 0
for item in trans:
  k = math.ceil(N / item)
  maxi = max(maxi, k)
print(maxi + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
m=min(a,b,c,d,e)
x=n/m
y=n//m
if x==y:
  print(int(4+x))
else:
  print(int(5+y))

Submission status: Accepted

Solution code:
# 2019/04/07

from numpy import array, zeros
IN_RANGE = 5


# 入力受け取り
N = int(input())
a_e = array([int(input()) for i in range(IN_RANGE)])


minute = 4 + -(- N // a_e.min())
print(minute)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

minMove = min(li)

import math
ans = math.ceil(n / minMove) + 4
# 4 5本の道があって、ボトルネックでかかる時間＋それ以外の経路にかかる時間
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())
li = [a,b,c,d,e]

m = min(li)

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

Submission status: Accepted

Solution code:
import math

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

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

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

Submission status: Accepted

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

lst=[A,B,C,D,E]
neck=min(lst)
ans=N//neck+5
if N%neck==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())
print(int((N-1)/min(a,b,c,d,e))+5)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    capacity = [None] * 5
    min_cap = float('inf')
    for i in range(5):
        capacity[i] = int(input())
        if capacity[i] < min_cap:
            min_cap = capacity[i]
    time = N // min_cap
    if N % min_cap > 0:
        time += 1
    print(time + 4)
    return

main()

Submission status: Accepted

Solution code:
import sys, os

if __name__=='__main__':
    if 'local' in os.environ :
        sys.stdin = open('./input.txt', 'r')
    
    n = int(input())
    ma = int(1e15)
    for i in range(5):
        ma = min(ma, int(input()))
    
    print(4 + (n +ma-1)//ma)

Submission status: Accepted

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

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

if N % min_capacity == 0:
    ans = N // min_capacity + 4
else:
    ans = N // min_capacity + 5

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans=4+n//m + (0 if n%m==0 else 1)

print(ans)

Submission status: Accepted

Solution code:
n,*a=eval('int(input()),'*6);print(4--n//min(a))

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc123/tasks/abc123_c

# ボトルネックを探し，そこに詰まらない量だけ流す
n = int(input())
a_e = [int(input()) for _ in range(5)]

min_ae = min(a_e)
# city1に全員がつくためにかかる時間
arr_city1 = n // min_ae if n % min_ae == 0 else n//min_ae + 1
ans = arr_city1 + 4
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
def solve(n, c):
    i = np.argmin(c)
    m = len(c)
    return m - 1 + (n + c[i] - 1) // c[i]

n = int(input())
c = [int(input()) for i in range(5)]
print(solve(n, c))

Submission status: Accepted

Solution code:
import math
#入力
N = int(input())
maxmembers={}
for i in range(5):
    maxmembers[i] = int(input())

#シミュレーション
'''
citypeople = [N,0,0,0,0,0]
flag = bool(False)
time = 0

for i in range(6):
    print(citypeople[i],end=' ')
print('')

while True:
    for i in reversed(range(1,6)):
        if citypeople[i-1] > maxmembers[i-1]:
            citypeople[i] += maxmembers[i-1]
            citypeople[i-1] -= maxmembers[i-1]
        else:
            citypeople[i] += citypeople[i-1]
            citypeople[i-1] = 0
    time += 1
    
    for i in range(6):
        print(citypeople[i],end=' ')
    print('')
    
    if citypeople[5] == N:
        break

print(time)
'''
#ボトルネックを全部に適用する
mintransportation = maxmembers[0]
for i in range(1,5):
    if maxmembers[i] < mintransportation:
        mintransportation = maxmembers[i]

    time = math.ceil(N / mintransportation) + 4
print(time)

Submission status: Accepted

Solution code:
#入力
N = int(input())
maxmembers={}
for i in range(5):
    maxmembers[i] = int(input())

#シミュレーション
'''
citypeople = [N,0,0,0,0,0]
flag = bool(False)
time = 0

for i in range(6):
    print(citypeople[i],end=' ')
print('')

while True:
    for i in reversed(range(1,6)):
        if citypeople[i-1] > maxmembers[i-1]:
            citypeople[i] += maxmembers[i-1]
            citypeople[i-1] -= maxmembers[i-1]
        else:
            citypeople[i] += citypeople[i-1]
            citypeople[i-1] = 0
    time += 1
    
    for i in range(6):
        print(citypeople[i],end=' ')
    print('')
    
    if citypeople[5] == N:
        break

print(time)
'''
#ボトルネックを全部に適用する
mintransportation = maxmembers[0]
for i in range(1,5):
    if maxmembers[i] < mintransportation:
        mintransportation = maxmembers[i]

if N % mintransportation == 0:
    time = int(N / mintransportation) + 4
else:
    time = int(N / mintransportation) + 5
print(time)

Submission status: Accepted

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

Submission status: Accepted

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

city = sorted(city)

ans = ((N+city[0]-1) // city[0]) + 4
    
print(ans)

Submission status: Accepted

Solution code:
import sys
aD = [int(_) for _ in sys.stdin.readlines()]
def fCeil(a):
    a *= 10
    return int(a // 10 + 1 if a % 10 else a // 10)
print(max( fCeil(aD[0]/_) for _ in aD[1:]) +4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())
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 sys
import math
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(5)]
a = min(a)
print(4+math.ceil(n/a))

Submission status: Accepted

Solution code:
import numpy as np
import math

n = int(raw_input())
a = []
for i in range(5):
	a.append(int(raw_input()))
b = np.array(a)
print int(math.ceil(n *1. / np.min(b))) + 4

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N=int(input())
A=[int(input()) for _ in range(5)]
MA=min(A)
if MA == N:
  N = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


N, *capacity = [int(input()) for _ in range(6)]

# min_index = capacity.index(min(capacity))

ans = math.ceil(N/min(capacity))

print(ans+4)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil


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


bottle_neck = min(lst_AtoE)
ans = ceil(N / bottle_neck) + 4
print(ans)

Submission status: Accepted

Solution code:
print((int(input())-1)//sorted([int(input()) for _ in range(5)])[0]+5)

Submission status: Accepted

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

a,b = divmod(N,min(A,B,C,D,E))
print(4 + a + (1 if b != 0 else 0))

Submission status: Accepted

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


bottle_neck = min(lst_AtoE)
bottle_neck_time = N//bottle_neck if N % bottle_neck==0 else (N//bottle_neck + 1)
ans = bottle_neck_time + 4
print(ans)

Submission status: Accepted

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


def main():
    from math import ceil

    n = int(input())
    alpha = [int(input()) for _ in range(5)]
    print(max(0, ceil(n / min(alpha)) - 1) + 5)


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())
import math
print(math.ceil(max(N/A, N/B, N/C, N/D, N/E)) + 4)

Submission status: Accepted

Solution code:
N = int(input())
M = 5 # number of edges
A = [int(input()) for _ in range(M)]
m = min(A)
print((N + m - 1) // m + M - 1)

Submission status: Accepted

Solution code:
from math import *

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

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

Submission status: Accepted

Solution code:
import math

N = int(input())
min_road = N
ABCDE = [int(input()) for _ in range(5)]
for i, element in enumerate(ABCDE):
    min_road = min(min_road, element)

ans = int(math.ceil(N / min_road)) + 4
print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

import sys
import copy

input = sys.stdin.readline

# ---------------------------------------------------------

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

minV = min(a)

print((N + minV - 1) // minV + 4)

Submission status: Accepted

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

Submission status: Accepted

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

m = min(trans)
ans = int((n + m - 1) / m) + 4
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
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-1)//m)+5)

Submission status: Accepted

Solution code:
import math

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

min_num_person = min(num_person)

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

Submission status: Accepted

Solution code:
import math
array1 = [int(input()) for i in range(6)]
array2 = array1[1:6]
num = array1[0]
minimum = min(array2)
print(math.ceil(num / minimum) + 4)

Submission status: Accepted

Solution code:
n,*a=[int(input()) for i in range(6)]
m=sorted(a)[0]
print(n//m+5 if n%m>0 else n//m+4)

Submission status: Accepted

Solution code:
from sys import stdin

def ria(sep = ''):
    if sep == '' :
        return list(map(int, input().split())) 
    else: return list(map(int, input().split(sep)))
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()

N = ri()
A = [0] * 5
for i in range(5): A[i] = ri()

prev = N
head = 0
tail = 0
for i in range(5):
    if(A[i] >= prev):
        nhead = head + 1
        ntail = tail + 1
        head = nhead
        tail = ntail
    else :
        nhead = head + 1
        ntail = head + (N + (A[i] - 1)) // A[i]
        head = nhead
        tail = ntail
    # print("{0}, {1}".format(head, tail))
    prev = min(prev, A[i])
print (tail)

Submission status: Accepted

Solution code:
N = int(input())
cost = [int(input()) for i in range(5)]
mn = min(cost)
print((N + mn - 1) // mn + 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:
import numpy as np

N = int(input())
M = 5
data = [int(input()) for i in range(M)]
lowest_index = np.argmin(data)

sum = int(np.ceil(N / data[lowest_index])) + 4
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

arr = [A,B,C,D,E]
key = arr.index(min(arr))

ans = 4 + ((N + arr[key] - 1) // arr[key])

print(ans)

Submission status: Accepted

Solution code:
import math
population = int(input())
a2b = int(input())
b2c = int(input())
c2d = int(input())
d2e = int(input())
e2f = int(input())
city = [population,0,0,0,0,0]
vehicle = [a2b,b2c,c2d,d2e,e2f]
print(math.ceil(population/min(vehicle)) + 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())
 
cs = [a,b,c,d,e]
 
min_cs = min(cs)
 
t = math.ceil(n / min_cs)

print(t + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = 6
a = [int(input()) for i in range(N)]
p = [a[0],0,0,0,0,0]
count = 0
b = min(a)
if a[0] <= b:
    ans = 5
else:
    ans = -1*(-1*a[0] // b) + 4
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
 
T = []
for i in range(5):
	T.append(int(input()))
 
#print()
 
#print(N)
#print(T)
 
minT = min(T)
#print(minT)
 
indminT = T.index(minT)
#print(indminT)
 
time = 1 + indminT - 1 + ((N-1)//minT) + 1 + 5 - (indminT + 1)
print(time)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

from math import ceil

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

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


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

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

time = (-(-n//minroute)) + 4

print(time)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
bt = 10**15
for _ in range(5):
    bt = min((int(input()), bt))
t = N // bt + (4 if N % bt == 0 else 5)
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A_E = [int(input()) for i in range(5)]
A_E.sort()
time = int(N/A_E[0])
if N % A_E[0]:
    time += 1
time += 4
print(time)

Submission status: Accepted

Solution code:
import sys
import math


def main():
    input = sys.stdin.readline
    n = float(input())
    min_nin = min([int(input()) for _ in range(5)])
    print(int(4 + math.ceil(n / min_nin)))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

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

min_num = min(a)

print(math.ceil(N / min_num) + 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:
import math
 
N=int(input())
 
m=0
 
for i in range(5):
    a=math.ceil(N/int(input()))
    if m<a:
      m=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())
ans = math.ceil(n / min(a,b,c,d,e)) + 4
print(ans)

Submission status: Accepted

Solution code:
print(4 - (-int(input())//min(int(input()) for _ in range(5))))

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
distances = [int(stdin.readline().rstrip()) for _ in range(5)]
min_d = min(distances)

print(int((n + min_d - 1) / min_d) + 4)

Submission status: Accepted

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