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
import fractions
import copy
import numpy as np
def j(q):
    if q==1: print("YES")
    elif q == 0:print("NO")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def printrow(a):
    for i in a:
        print(i)
"""
#decomment when needed
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
"""
n = ip()
a = []
for i in range(5):
    a.append(ip())
if min(a)>=n:
    print(5)
    exit(0)
ans = n//min(a)
if n%min(a):
    ans+=1
print(ans+4)

Submission status: Accepted

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

mn=min(x)

if n%mn==0:
	res=n//mn+4
else:
	res=n//mn+5

print(res)

Submission status: Accepted

Solution code:
from math import ceil
n,a,b,c,d,e = [int(input()) for _ in range(6)]
k = min(a,b,c,d,e)
print(ceil(n/k)+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 = 5 + (n - 1) // m

print(ans)

Submission status: Accepted

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


def main():
	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)

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Accepted

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

if __name__ == "__main__":
    main46()

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 = min(a, b, c, d, e)
if n % f == 0:
    print(n // f - 1 + 5)
else:
    print(n // f + 5)

Submission status: Accepted

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

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

Submission status: Accepted

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

def main():
	n = int(input().strip())
	s = [0] * 5
	for i in range(5):
		s[i] = int(input().strip())
	m = min(s)
	if n % m == 0:
		print(n // m + 4)
	else:
		print(n // m + 5)

if __name__ == '__main__':
	main()

Submission status: Accepted

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

print(4 + max([((N + x - 1) // x) for x in ts]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#ABC122C
import sys

n = int(input())

minn = int(input())
minn = min(minn,int(input()))
minn = min(minn,int(input()))
minn = min(minn,int(input()))
minn = min(minn,int(input()))

#print(minn)

print(((n-1)//minn)+5)

Submission status: Accepted

Solution code:
# Five Transportations
N = int(input())
T = [int(input()) for _ in range(5)]

import math

T_min = min(T)
cost = math.ceil(N/T_min) + 4
print(cost)

Submission status: Accepted

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

def get_num():
    return int(input())


def get_nums(n):
    res = [0 for _ in range(n)]
    for i in range(n):
        res[i] = int(input())
    return res


def get_numbers():
    return map(int, input().split())


n = get_num()
costs = get_nums(5)

max_time = 0
for cost in costs:
    max_time = max(max_time, int(math.ceil(n / cost)))

print(max_time + 4)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import numpy as np

def get_num():
    return int(input())


def get_nums(n):
    res = [0 for _ in range(n)]
    for i in range(n):
        res[i] = int(input())
    return res


def get_numbers():
    return map(int, input().split())


n = get_num()
costs = get_nums(5)

max_time = 0
for cost in costs:
    max_time = max(max_time, int(np.ceil(n / cost)))

print(max_time + 4)

Submission status: Accepted

Solution code:
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    a = int(sys.stdin.readline())
    b = int(sys.stdin.readline())
    c = int(sys.stdin.readline())
    d = int(sys.stdin.readline())
    e = int(sys.stdin.readline())

    ans = -(-n//min(a,b,c,d,e)) + 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())

bot = min(A,B,C,D,E)
print((N-1)//bot+1+4)

Submission status: Accepted

Solution code:
import math
ninzuu = int(input())
norimono = []

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

min_n = min(norimono)
a = math.ceil(ninzuu / min_n)
a = a + 4
print(a)

Submission status: Accepted

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

for _ in range(5):
    transportation = int(input())
    transportations.append(transportation)

transportations.sort()
print(-(-N // transportations[0]) + 4)

Submission status: Accepted

Solution code:
import math

n = int(input())

m = 10 ** 15 + 1

for _ in range(5):
  m = min(m, int(input()))

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

Submission status: Accepted

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

list1 = [A,B,C,D,E]
min1 = min(list1)
if N % min1 != 0:
  ans = N//min1 + 5
else:
  ans = N//min1 + 4

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

min_c = min(C)
print((N+min_c-1) // min_c + 4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
neck = int(input())
for i in range(4):
  neck = min(neck, int(input()))
res = math.ceil(N/neck)
print(res + 4)

Submission status: Accepted

Solution code:
# ABC 123 C

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

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

time = n // neck
time += 1 if n % neck != 0 else 0

print(time + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
a = int(input())
b = 10 ** 16
for i in range(5):
    b = min(b, int(input()))
print((a + b - 1) // b + 4)

Submission status: Accepted

Solution code:
import math

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

for i in range(5):
  tr.append(int(input()))
            
print(math.ceil(N / min(tr))+4)

Submission status: Accepted

Solution code:
import math

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

neck = min(A)

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

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

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

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

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:
import math

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

mi = min(abcde)

if mi>=n:
    print(5)
else:
    print(math.ceil(n/mi)+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 = N
if min > A: min = A
if min > B: min = B
if min > C: min = C
if min > D: min = D
if min > E: min = E

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

Submission status: Accepted

Solution code:
import math
n =int(input())
a = [int(input()) for _ in range(5)]
if min(a)<n: # 詰まる場合
  print(math.ceil(n/min(a))+len(a)-1)
else:
  print(len(a))

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

Submission status: Accepted

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

Submission status: Accepted

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

if n%min(v)==0:
    a=n//min(v)
elif n<=min(v):
    print(5)
    exit()
else:
    a=n//min(v)+1
print(a+4)

Submission status: Accepted

Solution code:
import math

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

bottleneck = min(ABCDE)
n_addition = math.ceil(N / bottleneck) - 1
print(n_paths + n_addition)

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

bottleneck = min([A, B, C, D, E])
n_addition = math.ceil(N / bottleneck) - 1
print(5 + n_addition)

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    transpotation = [
        int(inputs[1]),
        int(inputs[2]),
        int(inputs[3]),
        int(inputs[4]),
        int(inputs[5])
    ]

    bottleneck = 0

    for t in transpotation:
        if bottleneck == 0 or t < bottleneck:
            bottleneck = t
    power_bottleneck = math.ceil(N / bottleneck)
    return power_bottleneck + 4


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(6))
    print(ret)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
from math import ceil

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

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

Submission status: Accepted

Solution code:
N = int(input())
lst = []
for i in range(0, 5):
	lst.append(int(input()))
lst.sort()
ans = N // lst[0] + 4
if N % lst[0] != 0:
	ans += 1
print(ans)

Submission status: Accepted

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

min_city = min(cities)
if N <= min_city:
  print(5)
else:
  times = N//min_city
  if N%min_city == 0:
    print(5+times-1)
  else:
    print(5+times)

Submission status: Accepted

Solution code:
ri = lambda: int(input())
n = ri()
x = min([ri() for _ in range(5)])
print(n//x+min(1,n%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())
l = [a, b, c, d, e]
l_m = min(l)

if (n/l_m)%1 == 0:
    print(4+int(n/l_m))
else:
    print(5+int(n/l_m))

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

    max_wait = max([(n + a - 1) // a for a in d])
    print(max_wait + 4)


main()

Submission status: Accepted

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

def ceil(a,b) :
    return (a + b - 1) // b

time =[A , B , C , D , E]
time.sort()

minTime = time[0]

ans = ceil(N,minTime) + 4

print(ans)

Submission status: Accepted

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

bottle_neck = min([a, b, c, d, e]) 
extra = (n-1)/bottle_neck
print 5 + extra

Submission status: Accepted

Solution code:
# using main() makes code faster from the point of view of "access to variables in global name-space"
# def main():

""" convenient functions
# for i, a in enumerate(iterable)
# q, mod = divmod(a, b)
# divmod(x, y) returns the tuple (x//y, x%y)
# manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f
"""

import sys
sys.setrecursionlimit(10**7)
from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html
# accumulate() returns iterator! to get list: list(accumulate())
from math import factorial, ceil, floor
def factorize(n):
    """return the factors of the Arg and count of each factor
    
    Args:
        n (long): number to be resolved into factors
    
    Returns:
        list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
    """
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
def combinations_count(n, r):
    """Return the number of selecting r pieces of items from n kinds of items.
    
    Args:
        n (long): number
        r (long): number
    
    Raises:
        Exception: not defined when n or r is negative
    
    Returns:
        long: number
    """
    # TODO: How should I do when n - r is negative?
    if n < 0 or r < 0:
        raise Exception('combinations_count(n, r) not defined when n or r is negative')
    if n - r < r: r = n - r
    if r < 0: return 0
    if r == 0: return 1
    if r == 1: return n
    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]
    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])
    return result
def combinations_with_replacement_count(n, r):
    """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
    
    Args:
        n (long): number
        r (long): number
    
    Raises:
        Exception: not defined when n or r is negative
    
    Returns:
        long: number
    """
    if n < 0 or r < 0:
        raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
    elif n == 0:
        return 1
    else:
        return combinations_count(n + r - 1, r)
from bisect import bisect_left, bisect_right
from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque
from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html
from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html
from operator import itemgetter
# ex1: List.sort(key=itemgetter(1))
# ex2: sorted(tuples, key=itemgetter(1,2))
from functools import reduce
def chmin(x, y):
    """change minimum
    if x > y, x = y and return (x, True).
    convenient when solving problems of dp[i]
    
    Args:
        x (long): current minimum value
        y (long): potential minimum value
    
    Returns:
        (x, bool): (x, True) when updated, else (x, False)
    """
    if x > y:
        x = y
        return (x, True)
    else:
        return (x, False)
def chmax(x, y):
    """change maximum
    if x < y, x = y and return (x, True).
    convenient when solving problems of dp[i]
    
    Args:
        x (long): current maximum value
        y (long): potential maximum value
    
    Returns:
        (x, bool): (x, True) when updated, else (x, False)
    """
    if x < y:
        x = y
        return (x, True)
    else:
        return (x, False)

from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.
def gcds(numbers):
    return reduce(gcd, numbers)
def lcm(x, y):
    return (x * y) // gcd(x, y)
def lcms(numbers):
    return reduce(lcm, numbers, 1)

# first create factorial_list
# fac_list = mod_factorial_list(n)
INF = 10 ** 18
MOD = 10 ** 9 + 7
modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!
def modinv(a, p = MOD):
    # evaluate reciprocal using Fermat's little theorem:
    # a**(p-1) is identical to 1 (mod p) when a and p is coprime
    return modpow(a, p-2, p)
def modinv_list(n, p = MOD):
    if n <= 1:
        return [0,1][:n+1]
    else:
        inv_t = [0,1]
        for i in range(2, n+1):
            inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
        return inv_t
def modfactorial_list(n, p = MOD):
    if n == 0:
        return [1]
    else:
        l = [0] * (n+1)
        tmp = 1
        for i in range(1, n+1):
            tmp = tmp * i % p
            l[i] = tmp
        return l
def modcomb(n, k, fac_list = [], p = MOD):
    # fac_list = modfactorial_list(100)
    # print(modcomb(100, 5, modfactorial_list(100)))
    from math import factorial
    if n < 0 or k < 0 or n < k: return 0
    if n == 0 or k == 0: return 1
    if len(fac_list) <= n:
        a = factorial(n) % p
        b = factorial(k) % p
        c = factorial(n-k) % p
    else:
        a = fac_list[n]
        b = fac_list[k]
        c = fac_list[n-k]
    return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
def modadd(a, b, p = MOD):
    return (a + b) % MOD
def modsub(a, b, p = MOD):
    return (a - b) % p
def modmul(a, b, p = MOD):
    return ((a % p) * (b % p)) % p
def moddiv(a, b, p = MOD):
    return modmul(a, modpow(b, p-2, p))

""" initialize variables and set inputs
# initialize variables
    # to initialize list, use [0] * n
    # to initialize two dimentional array, use [[0] * N for _ in range(N)]
# set inputs
    # open(0).read() is a convenient method:
    # ex) n, m, *x = map(int, open(0).read().split())
    #     min(x[::2]) - max(x[1::2])
    # ex2) *x, = map(int, open(0).read().split())
    #     don't forget to add comma after *x if only one variable is used
# preprocessing
    # transpose = [x for x in zip(*data)]
    # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
    # flat = [flatten for inner in data for flatten in inner]
    # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]
# calculate and output
    # output pattern
    # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6
"""

# functions used
r = lambda: sys.stdin.readline().strip()
r_int = lambda: int(r())
R = lambda: list(map(int, r().split()))
Rfloat = lambda: list(map(float, r().split()))
Rtuple = lambda: tuple(map(int, r().split()))
Rmap = lambda: map(int, r().split())

""" how to treat input
# single int: int(r())
# single string: r()
# single float: float(r())
# line int: R()
# line string: r().split()
# line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]
# lines int: [R() for _ in range(n)]
"""


# ----------------------------------
# main
N = int(r())
ABCDE = [int(r()) for _ in range(5)]
time, block = 0, N
q, mod = divmod(N, min(ABCDE))
if mod != 0:
    q += 1
print(q+4)
# for i in ABCDE:
#     if i >= block:
#         time += 1
#     else:
        
# end of main
# ----------------------------------

"""memo: how to use defaultdict of list
# initialize
Dic = defaultdict(list)
# append / extend
Dic[x].append(y)
# for
for k, v in Dic.items():
"""

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

Submission status: Accepted

Solution code:
import sys
import fractions

input = sys.stdin.readline


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

    m = fractions.math.ceil(N/min(s))
    if m == 1:
        print(5)
    else:
        print(m+4)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(input())for _ in range(6)]
print(
    max(
        (a[0] + a[1] - 1) // a[1]
        , (a[0] + a[2] - 1) // a[2]
        , (a[0] + a[3] - 1) // a[3]
        , (a[0] + a[4] - 1) // a[4]
        , (a[0] + a[5] - 1) // a[5]
    ) + 4
)

Submission status: Accepted

Solution code:
def main():

    capa = []
    n = int(raw_input())
    ans = 0

    for i in range(5):
        capa.append(int(raw_input()))
    sorted_capa = sorted(capa)
    if n % sorted_capa[0] == 0:
        ans = 4 + n//sorted_capa[0]
    else:
        ans = 4 + n//sorted_capa[0] + 1
    print(ans)
    """
    people = [n]
    for i in range(5):
        people.append(0)
    print(capa,people)
    while people[-1] < n:
        for i in reversed(range(0,6)):
            if i != 0:
                people[i] += min(people[i-1],capa[i-1])
                people[i-1] -= min(people[i-1],capa[i-1])
        time += 1
        print(people,time)
    print(time)

    """
if __name__ == "__main__":
    main()

Submission status: Accepted

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

minT=min(T)
minTidx=T.index(minT)
print(-(-N//min(T))+4)

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:
import math
n = int(input())
abcde = [int(input()) for _ in range(5)]

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

Submission status: Accepted

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

if n <= min(l):
  print('5')
else:
  if n%min(l) == 0:
    print(5+n//min(l)-1)
  else:
    print(5+n//min(l))

Submission status: Accepted

Solution code:
import math
N = int(input())
#人数a,b,c,d,e
numbers = [int(input()) for i in range(5)]
print(4+math.ceil(N/min(numbers)))

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_capacity = min(a, b, c, d, e)
print(ceil(n / min_capacity) + 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)
d = N // _min
if N % _min != 0:
    d += 1
print(d + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
transport = [0]*5
N = int(input())
for i in range(5):  # 一番効率の悪い（キャパが少ない）交通機関を使うのにかかる時間
    transport[i] = [0]*2
    transport[i][1], transport[i][0] = i, int(input())

transport = sorted(transport)
if N % transport[0][0] == 0:
    time = N // transport[0][0]
else:
    time = N // transport[0][0] + 1
time += 4  # 他の交通機関を使うのにかかる時間
print("{}".format(time))

Submission status: Accepted

Solution code:
transport = [0]*5
N = int(input())
for i in range(5):
    transport[i] = [0]*2
    transport[i][1], transport[i][0] = i, int(input())

transport = sorted(transport)
if N % transport[0][0] == 0:
    time = N // transport[0][0]
else:
    time = N // transport[0][0] + 1
time +=4
print("{}".format(time))

Submission status: Accepted

Solution code:
n=int(input())
t=[int(input()) for _ in range(5)]
print(-(-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())
ls = [A,B,C,D,E]
X = min((A,B,C,D,E))
s=N//X
if N%X==0:
  s-=1
print(s+5)

Submission status: Accepted

Solution code:

a = [float(input()) for i in range(6)]

limit = []
for i in range(5):
    limit.append(a[i + 1])

neck = min(limit)

if a[0] % neck == 0:
    ans = a[0] // neck + 4
else:
    ans = a[0] // neck + 5


print(int(ans))

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for _ in range(5)]
print(-(-N//min(p))+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())
a = [int(input()) for _ in range(5)]

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

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

print(ans)