Problem:


Score: 300 points

Problem Statement

In 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!

There are five means of transport in this empire:

Train: travels from City 1 to 2 in one minute. A train can occupy at most A people.

Bus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.

Taxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.

Airplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.

Ship: travels from City 5 to 6 in one minute. A ship can occupy at most E people.

For each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).

There is a group of N people at City 1, and they all want to go to City 6.

At least how long does it take for all of them to reach there? 
You can ignore the time needed to transfer.  

Constraints

1 \leq N, A, B, C, D, E \leq 10^{15}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A
B
C
D
E

Output

Print the minimum time required for all of the people to reach City 6, in minutes.

Sample Input 1

5
3
2
4
3
5

Sample Output 1

7

One possible way to travel is as follows.
First, there are N = 5 people at City 1, as shown in the following image:

In the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.

In the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.

In the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.

From then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.

There is no way for them to reach City 6 in 6 minutes or less.

Sample Input 2

10
123
123
123
123
123

Sample Output 2

5

All kinds of vehicles can occupy N = 10 people at a time.
Thus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.  

Sample Input 3

10000000007
2
3
5
7
11

Sample Output 3

5000000008

Note that the input or output may not fit into a 32-bit integer type.



Sample input:
5
3
2
4
3
5


Sample output:
7

Submission status: Accepted

Solution code:
import math

N = int(input())
idou = [int(input()) for _ in range(5)]
hosoi = min(idou)

ans = 5
if hosoi < N:
    ans += math.ceil(N / hosoi) -1


print(ans)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if n % min(v):
  print(n // min(v) + 5)
else:
  print(n // min(v) + 4)

Submission status: Accepted

Solution code:
n,*t=map(int,open(0).read().split())
print(int((n-0.1)//min(t))+5)

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
def solve():
    min_number = min([A,B,C,D,E])
    if(N%min_number==0):
        return print(5 + int(N/min_number) - 1)
    else:
        return print(5 + int(N/min_number))
solve()

Submission status: Accepted

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


#%%
# n, alist = 5, [3, 2, 4, 3, 5]


#%%
if n <= min(alist):
    print(5)
else:
    print((n-1)//min(alist)+5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())


mn = min(A)
minidx = A.index(mn)
ans = 0
ans = minidx

ans += ( N + A[minidx] -1)//A[minidx]
ans += 5 - 1 - minidx
print(ans)


# ans = 0
# tmp = N
# for i in range(5):
#     if tmp > A[i]:
#         ans += (tmp + A[i]-1) // A[i]
#         tmp = A[i]
#     else:
#         ans += 1
# print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
x = min(int(input()) for i in range(5))
print(ceil(N/x)+4)

Submission status: Accepted

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

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

num_group = math.ceil(N / cap)

ans = 5 + num_group - 1
print(ans)

Submission status: Accepted

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

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())
A = [a, b, c, d, e]
min_A = min(A)
result = math.ceil(n / min_A) - 1 + 5
print(result)

Submission status: Accepted

Solution code:
import math

N = int(input())

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

slow = int(transp.index(min(transp)))

k, l = divmod(N, transp[slow])
time = k + 4 
if l > 0:
    time += 1

print(time)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
A = [int(input()) for i in range(5)]
#print(A)
I = float("INF")
c = 0
for i in reversed(range(5)):
    if I >= A[i]:
        c = i
        I = A[i]
#print(I,c)
a = math.ceil(N/I)+4
print(a)
#
#
# AAAa0A
# 0
# BBBBbb
# 00
# CCCCccc

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())
city = [int(input()) for i in range(5)]

m = min(city)

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

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

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

Submission status: Accepted

Solution code:
import math

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

for i in range(1, 5):
    if t[i] > t[i-1]:
        t[i] = t[i-1]

print(math.ceil(n/t[4]) + 4)

Submission status: Accepted

Solution code:
from math import ceil

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:52:46 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy
import bisect

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    

"""
N = int(input())

A = [0]*5

A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

if N <= min(A):
    print(5)
    sys.exit()

n = N//min(A)
if N%min(A) ==0:
    pass
else:
    n += 1

print(n+5-1)

Submission status: Accepted

Solution code:
"""
python3 main.py < input.txt
"""
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])
times=int(math.ceil(n/m))
print(times+4)

Submission status: Accepted

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

import math

def readInts():
  return [int(s) for s in input().split(" ")]

def readInt():
  return readInts()[0]

def solve(N, A, B, C, D, E):
  v = min(A, B, C, D, E)
  return math.ceil(N / v) + 4

def main():
  N = readInt()
  A = readInt()
  B = readInt()
  C = readInt()
  D = readInt()
  E = readInt()

  print(solve(N, A, B, C, D, E))

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

min_data = min(data_list)

if min_data!= 1:
    print(N//min_data+5)
else:
    print(N-1+5)

Submission status: Accepted

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

Submission status: Accepted

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

def io_generator():
	return input()

#+++++++++++++++++++
	
def ku(n,a):
	if n % a==0:
		return int(n/a)
	return (n // a)+1
	
def main(io):
	n=int(io())
	l =[ int(io()) for _ in range(5)]
	bn=min(l)
	nd=ku(n,bn)
	return 4+nd

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Submission status: Accepted

Solution code:
n=int(input())
a=[]
for i in range(5):
    a.append(int(input()))
b=0
if n%min(a)>0:
    b=1
print(n/min(a)+b+4)

Submission status: Accepted

Solution code:
import numpy as np
n=int(input())
a=[0,0,0,0,0]
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
k=np.argmin(a)
if n%a[k]==0:
    l=n//a[k]
else:
    l=n//a[k]+1
print(4+l)

Submission status: Accepted

Solution code:
#coding:utf-8

N = int(input())

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

min_flow = min(flows)

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

Submission status: Accepted

Solution code:
import math

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

mi = min(l)

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

Submission status: Accepted

Solution code:
n=int(input());m=[int(input())for _ in range(5)];s=min(m);print((n%s>0)+4+n//s)

Submission status: Accepted

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

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

minl = min(load)

if (n%minl==0):
    print(n//minl-1+5)

if (n%minl!=0):
    print(n//minl+5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
capacity = [None] * 5

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

min_cap = min(capacity)

t = n // min_cap + (0 if n % min_cap == 0 else 1) + 4
print(t)

Submission status: Accepted

Solution code:
N = int(input())
min_cap = float('inf')
for i in range(5):
    temp = int(input())
    min_cap = min(min_cap, temp)
print(5 + N // min_cap - (N % min_cap == 0))

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A = []
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))

A = np.array(A)
min_A = np.min(A)
print(int(np.ceil(N/min_A) + 5 - 1))

Submission status: Accepted

Solution code:
a = 6*[0]
for i in range(6):
    a[i] = int(input())

min_n = min(a[1:])

if(a[0] % min_n == 0): print(4+a[0]//min_n)
else: print(5+a[0]//min_n)

Submission status: Accepted

Solution code:
import math
n = int(input())
t = [int(input()) for i in range(5)]
t = sorted(t)
ans = math.ceil(n/t[0]) -1 + 5
print(ans)

Submission status: Accepted

Solution code:

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

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

main()

Submission status: Accepted

Solution code:
n = int(input())
m = 0
for i in range(5):
    t = int(input())
    c = n // t
    if n % t != 0:
        c += 1
    m = max(c, m)

print(6 - 1 + m - 1)

Submission status: Accepted

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

count = N // min(A,B,C,D,E)
if N % min(A,B,C,D,E) == 0:
    count -= 1
print(count+5)

Submission status: Accepted

Solution code:
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
A = [I() for i in range(5)]
num = min(A)

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

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

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

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

# counts = [n, 0, 0, 0, 0, 0]
# ans = 0
# while counts[-1] != n:
#     for i in range(5):
#         mv = min(counts[4 - i], caps[4 - i])
#         counts[4 - i] -= mv
#         counts[5 - i] += mv
#     ans += 1
# print(ans)

Submission status: Accepted

Solution code:


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

    if N==1:
        print(5)
        return

    m = min([a,b,c,d,e])  # bottle neck

    ans = (N//m) - (N%m==0)
    ans += 5

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
S = np.zeros(5)
S[0] = int(input())
S[1] = int(input())
S[2] = int(input())
S[3] = int(input())
S[4] = int(input())

ANS=4-(-N//S.min())

print(str(int(ANS)))

Submission status: Accepted

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

for i in range(5):
    if L[i]==l:
        break

if N<min(L):
    ans=5
else:
    if N%L[i]==0:
        ans=N//L[i]+4
    else:
        ans=N//L[i]+5

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3.4
# -*- coding: utf-8 -*-

# abc123_c
import math

# input
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
#arr = [a, b, c, d, e]
neck = min(a, b, c, d, e)
# output
ans = math.ceil(n/neck)
ans += 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N=INT()
tran=[INT() for i in range(5)]
print(5-1+ceil(N, min(tran)))

Submission status: Accepted

Solution code:
import numpy as np
import math

N=int(input())
X=np.zeros(5)
for i in range(5):
  X[i]=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! /usr/bin/python3
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("min", m)

t = 5
k = max(0, N - m) // m
t += k
#print("rem", N-m)
#print("k=", k)

k = 1 if max(0, N - m) % m > 0 else 0
t += k
#print("k=", k)

print(t)

Submission status: Accepted

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

from math import ceil


n = int(input())

min_limit = 10 ** 15
for i in range(5):
    x = int(input())
    min_limit = min_limit if min_limit < x else x

t = ceil(n / min_limit) + 4

print(t)

Submission status: Accepted

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

if N % min(li):
    ans = N // min(li) + 1
else:
    ans = N // min(li)

print(4 + ans)

Submission status: Accepted

Solution code:
import math
inputs = []
for i in range(6):
    tmp = int(input())
    inputs.append(tmp)

n = inputs[0]
lim = inputs[1:]
minlim = min(lim)
print(math.ceil(n/minlim) + 4)

Submission status: Accepted

Solution code:
import sys
import math

n = int(sys.stdin.readline())
cs = [int(sys.stdin.readline()) for _ in range(5)]
mc = min(cs)
ret = 4 + int(math.ceil(n / mc))
print(ret)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    s = IR(5)
    k = I()
    if max(s)-min(s) > k:
        print(":(")
    else:
        print("Yay!")
    return

#B
def B():
    s = IR(5)
    s.sort(key = lambda x:-x%10)
    ans = 0
    i = 0
    k = 0
    while 1:
        if i%10 == 0:
            ans = i+s[k]
            i += s[k]-1
            k += 1
            if k == 5:break
        i += 1
    print(ans)
    return

#C
def C():
    n = I()
    a = IR(5)
    ans = 5+n//min(a)
    if n%min(a) == 0:ans -= 1
    print(ans)
    return

#D
def D():
    x,y,z,k = LI()
    a = LI()
    b = LI()
    c = LI()

    return

#Solve
if __name__ == "__main__":
    C()

Submission status: Accepted

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

m = min(a)
mi = a.index(m)
res = 0
if n%m==0:
    res += n//m
    res += 4
else:
    res += n//m
    res += 1
    res += 4
print(res)

Submission status: Accepted

Solution code:
a = []
N = int(input())
min_v = 10**15 + 1
for i in range(5):
    v = int(input())
    min_v = min(min_v, v)

if N  % min_v == 0:
    print(N // min_v + 4)
else:
    print(N//min_v + 5)

Submission status: Accepted

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

Submission status: Accepted

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

print(((N-1)//min(mem))+M)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

bottleneck_time = (n + bottleneck-1) // bottleneck

print(bottleneck_time + 4)

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lis = [a, b, c, d, e]
minn = min(lis)
m = 0
if n % minn == 0:
    m = n // minn
else:
    m = n // minn + 1
print(m + 4)

Submission status: Accepted

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

Submission status: Accepted

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

import math

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

print(5 + math.ceil(N / min(A, B, C, D, E)) - 1)

Submission status: Accepted

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

min_num = min(num)
if N % min_num == 0:
	print(int(N / min_num) + 4)
else:
	print(int(N // min_num) + 5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

result = float(person)/float(min(number))

print(int(math.ceil(result)+4))

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

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

print(5 + -(-n//min(abcde)) - 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 = [a, b, c, d, e]
mins = min(s)
ans = math.floor((n-0.5)/mins) + len(s)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

bn = -(-N//min(l))
print(4 + bn)

Submission status: Accepted

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

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()
ans = 0
for i in [0] * 5:
    P = input()
    num = N / P
    if N % P:
        num += 1
    ans = max(ans, num)
print ans + 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 = min(A, B, C, D, E)
print(4 + math.ceil(N / num))

Submission status: Accepted

Solution code:
import sys
from itertools import permutations

N = int(sys.stdin.readline())
prev, prev_delay = None, None
out = []
for _ in range(5):
    x = int(sys.stdin.readline())
    if prev is None or prev >= x:
        d = N // x
        r = N % x
        prev = x
        prev_delay = d + (1 if r > 0 else 0)
    else:
        prev = x
    out.append(prev_delay)

ret = out[0]
max_delay = ret
for x in out[1:]:
    ret += max(0, x - max_delay) + 1
    if x > max_delay:
        max_delay = x
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def solve():
    num_total = int(input())
    num_transport=[0]*5
    for i in range(5):
        num_transport[i]=int(input())
    time = math.ceil(num_total/num_transport[0])
    x = num_transport[0]
    for i in range(1,5):
        if num_transport[i] < x:
            time = i+ math.ceil(num_total/num_transport[i])
            x = num_transport[i]
        else:
            time += 1
    print(time)


solve()

Submission status: Accepted

Solution code:
import sys

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    v = [int(sys.stdin.readline()) for i in range(5)]

    mi = min(v)
    ans = int((n + mi - 1) / mi)

    print(ans + 4)

Submission status: Accepted

Solution code:
import math

n = int(input())
a = [int(input()) for _ in range(5)]
min = max(a)
minin = 0
for i in range(5):
    if min > a[i]:
        min = a[i]
        minin = i
ans = math.ceil(n/a[minin]) + 4
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = [0] * 5
for i in range(5):
    a[i] = int(input())
ans = 5 + (N - 1) // min(a)
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(max(math.ceil(N / a),math.ceil(N / b),math.ceil(N / c),math.ceil(N / d),math.ceil(N / e)) + 4)

Submission status: Accepted

Solution code:
N = int(input())

pipes = []
pipes.append(int(input()))
pipes.append(int(input()))
pipes.append(int(input()))
pipes.append(int(input()))
pipes.append(int(input()))

min_pipe = 10**16
for pipe in pipes:
    if pipe < min_pipe:
        min_pipe = pipe

max_time, mod = divmod(N, min_pipe)
if mod != 0:
    max_time += 1

max_time += 4
print(max_time)

Submission status: Accepted

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

limits = list()
limits.append(a)
limits.append(b)
limits.append(c)
limits.append(d)
limits.append(e)

min_v, min_i = limits[0], 0
for i, limit in enumerate(limits):
    if min_v > limit:
        min_v = limit
        min_i = i
if min_v >= n:
    time = 5
elif n % min_v == 0:
    time = 5 + n // min_v - 1
else:
    time = 5 + n // min_v

print(time)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return list(map(int, ss_raw()))


n = int_raw()
a = int_raw()
b = int_raw()
c = int_raw()
d = int_raw()
e = int_raw()

minimum = min([a, b, c, d, e])
ans = 5 + n // minimum
if n % minimum == 0:
    ans -= 1
print(ans)

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

lst = [a, b, c, d, e]
v_min = min(lst)
time_slow = ceil(n/v_min)
print(4+time_slow)

Submission status: Accepted

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

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

Submission status: Accepted

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

if N % m != 0:
    print(N//m + 5)
else:
    print(N//m - 1 + 5)

Submission status: Accepted

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

mini = (-1, pow(10, 15) + 5)
for i, x in enumerate([a, b, c, d, e]):
  if mini[1] >= x:
    mini = (i, x)

if mini[1] >= n:
  print(5)
else:
  print(n // mini[1] + (1 if n % mini[1] != 0 else 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())
M = min(A,B,C,D,E)

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

Submission status: Accepted

Solution code:
import numpy as np
import sys

N = int(input())

A = np.zeros(5)
for i in range(5):
    A[i] = int(input())

width = int(A.min())

groups = N//width + int(N%width!=0)

print(groups-1+5)

Submission status: Accepted

Solution code:
lists = []
import math

N=int(input())
for _ in range(5):
    lists.append(int(input()))

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

Submission status: Accepted

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

mi = min(X)
result = N // mi
if N % mi != 0:
    result += 1
print(4 + result)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for _ in [0]*5]
ans=10**16
ind=0
for i in range(5):
    if a[i]<ans:
        ind=i
        ans=a[i]
print(5+(n-1)//ans)

Submission status: Accepted

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

if N % min(A) != 0:
    print(N // min(A) + 5)
else:
    print(N // min(A) + 4)