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:
n,*l=map(int,open(0).read().split());print((n-1)//min(l)+5)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
quank = [int(input()), int(input()), int(input()), int(input()), int(input())]
b = min(quank)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)

Submission status: Accepted

Solution code:
import math

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

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

min_num = min(nums)
ans = 5 + (math.ceil(N/min_num) - 1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# solution
import io
import math

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math
n = int(input()) 
l = [int(input()) for _ in range(5)]
m = min(l)
print(math.ceil(n / m) + 4)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if stop >= n:
    print(5)
    exit()

print(4+(-1*((-1*n)//stop)))

Submission status: Accepted

Solution code:
import sys
import math

X = list(map(int, sys.stdin.readlines()))
N = X[0]
min_transport = min(X[1:])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
    
n = load()
li = []
for _ in range(5):
    li.append(load())

mn = min(li)
mni = li.index(mn)

ans = math.ceil(n / mn) + mni + (5-mni-1)
print(ans)

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest
import math

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

    min_a = min(a)

    # print(n // min_a + 5)
    print(math.ceil(n / min_a) + 4)

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """5
3
2
4
3
5"""
        output = """7"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """10
123
123
123
123
123"""
        output = """5"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """10000000007
2
3
5
7
11"""
        output = """5000000008"""
        self.assertIO(input, output)

if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(6)]
mina = a[1]
for i in range(2,6):
    if mina > a[i]: mina = a[i]
print(-(-a[0]//mina)+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a,b,c,d,e]
rissoku = min(l)
amari = n % rissoku
syou = n // rissoku
if amari == 0:
    print(syou + 4)
else:
    print(syou + 5)

Submission status: Accepted

Solution code:
import math

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

minimum_throughput = min(minutes)
total_elapsed_minute = 4 + math.ceil(number_of_people / minimum_throughput)

print(total_elapsed_minute)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n=int(input())
#t=[]
t=int(input())
for _ in range(4):
  t=min(t,int(input()))
ans=(n+t-1)//t+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())

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

if N%F != 0:
    time = N//F + 5
else:
    time = N//F + 4

print(time)

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

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

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, D, E)) + 4)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
m=min(A,B,C,D,E)
x=N//m
if N>m*x:
  print(x+5)
else:
  print((x-1)+5)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

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

mi = min(A)
plus = -(-N//mi)
answer = 4 + plus
print(answer)

Submission status: Accepted

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

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())
    city = [0] * 6
    city[0] = n
    ans = 0
    ans = math.ceil(n / min(a,b,c,d,e) + 4)
    print(ans)

def isFinished(city, n):
    if city[-1] == n:return True
    return False

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

n, *cap = map(int, sys.stdin.read().split())
m = min(cap)

def main():
    print((n + m - 1) // m + 4)

if __name__ ==  '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(5)]
pmin = min(i for i in p)

import math
print(math.ceil(n/pmin)+4)

Submission status: Accepted

Solution code:
N = int(input())
min = 10**15+1
for i in range(5):
    t = int(input())
    if min > t:
        min = t
a = N + min - 1
print(a//min + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    # 例えば、(A,B,C,D,E) = (5,3,4,2,6) だったら、D = 2の部分で絶対に人が詰まる
    # Dはボトルネック(一番処理がﾀﾞﾒ)
    # N = 100だとすると、最初にDに来てからはずっと2人ずつのせていく
    # 時間で言うと N // 2 = 50 分 かかる計算になる
    # しかし、全員ぴったりくるわけではないので、 (N + bottleneck - 1) // bottleneckにする
    # Dが一番小さいのだから、
    # Dにくるまでは、A,B,C の　3分
    # Dを過ぎてからはE の　1分
    # これは、ボトルネックがDの場合に限らない 合計で 4分
    n = int(input())
    bottleneck = float('inf')
    A = []
    for i in range(5):
        a = int(input())
        A.append(a)
    for i in range(5):
        bottleneck = min(bottleneck,A[i])
    #print(bottleneck)
    print((n + bottleneck - 1) // bottleneck + 4) # ボトネで処理するもの　と　来るまでと来た後　の合計

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

from math import ceil

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

def solve():
    print(4 + ceil(n / min([a, b, c, d, e])))



if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
#editorial参照
import sys
input = sys.stdin.read
n,*a, = map(int, input().split( ))
m = min(a)
ans = (n+m-1)//m + 4
print(ans)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    a=int(input())
    b=int(input())
    c=int(input())
    d=int(input())
    e=int(input())
    print(-(-n//min(a,b,c,d,e))+4)

if __name__=='__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

import math
ans = math.ceil(n/a)
if a<=b:
    ans += 1
else:
    ans = math.ceil(n/b)+1
if b<=c:
    ans += 1
else:
    ans = math.ceil(n/min(c,a))+2
if c<=d:
    ans += 1
else:
    ans = math.ceil(n/min(d,b,a))+3
if d<=e:
    ans += 1
else:
    ans = math.ceil(n/min(e,a,b,c))+4
print(ans)

Submission status: Accepted

Solution code:
n, *a = map(int, open(0))
print(-(-n // min(a)) + 4)

Submission status: Accepted

Solution code:
N=int(input())
path=[int(input()) for _ in range(5)]
time=0
for i in range(5):
    time=max(((N+path[i]-1)//path[i])+i,time+1)
print(time)

Submission status: Accepted

Solution code:
n=int(input())
a=int(10**15+1)
for _ in range(5):
    b=int(input())
    a=min(a,b)
if a>=n:
    ans=5
else:
    ans=5+(n-1)//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(math.ceil(N/min(A,B,C,D,E)) + 4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
n = int(input())
l = [int(input()) for _ in range(5)]
key = min(l)
ans = 5 + n // key + (1 if n % key > 0 else 0) - 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

x = min(l)

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

Submission status: Accepted

Solution code:
List = []
for _ in range(6):
  List.append(int(input()))
Count = 5
MIN = min(List[1],List[2],List[3],List[4],List[5],)
Count += List[0]//MIN if List[0]%MIN != 0 else (List[0]//MIN)-1

print(Count)

Submission status: Accepted

Solution code:
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    n = II(); a = II(); b = II()
    c = II(); d = II(); e = II()
    minv = min([a,b,c,d,e])
    t = n//minv
    if n%minv != 0: t += 1
    print(4+t)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline
from math import ceil,floor

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


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

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

Submission status: Accepted

Solution code:
import math
n = int(input())
mn = float("inf")
for i in range(5):
  ai = int(input())
  if mn > ai:
    mn = ai
print(4+math.ceil(n/mn))

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
X = min(A, B, C, D, E)
if(N % X == 0):
  print(N//X + 4)
else:
  print(N//X + 5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ボトルネック+4
from math import ceil
n = int(input())
neck = min([int(input()) for _ in range(5)])
m = ceil(n / neck)
print(m + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import factorial,sqrt,ceil
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix

# strlist = "abcdefghijklmnopqrstuvwxyz"

rows = [int(input()) for _ in range(6)]
n,a,b,c,d,e = rows
minvar = min(rows[1:])

ans = ceil(n/minvar) + 4

print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

print(4-(-n)//min(a))

Submission status: Accepted

Solution code:
CITIES = 6
N = int(input())
# cap[i]は都市i-1からiに一度に移動できる人数, cap[0]はダミー
cap = [N] + [int(input()) for _ in range(CITIES - 1)]

def ceil(n, m):
    return -(-n // m)

dp = [0] * CITIES # 都市iまで全員が移動するのにかかる時間
mincap = N
for i in range(1, CITIES):
    if mincap <= cap[i]:
        dp[i] = dp[i - 1] + 1
    else:
        dp[i] = ceil(N, cap[i]) + i - 1
    mincap = min(mincap, cap[i])

print(dp[CITIES - 1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, *M = (int(input()) for _ in range(6))

    mi = min(M)

    ans = 5 + (N - 1) // mi + 1 - 1
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

Solution code:
mod = 10 ** 9 + 7
mod2 = 2**61+1
from collections import deque
import heapq
from bisect import bisect_left, insort_left, bisect_right

_NUMINT_ALL = list(range(10))

def main():
    ans = solve()
    if ans is not None:
        print(ans)

def solve():
    N = iip(False)

    l = iipt(5)
    #print(l)

    m = min(l)
    mm = N // m
    if N % m != 0:
        mm += 1

    return 4+mm











#####################################################ライブラリ集ここから

def iip(listed=True, num_only = True):
    if num_only:
        ret = [int(i) for i in input().split()]
    else:
        ret = [int(i) if i in _NUMINT_ALL else i for i in input().split()]

    if len(ret) == 1 and not listed:
        return ret[0]
    return ret

def iipt(l, listed=False, num_only = True):
    ret = []
    for i in range(l):
        ret.append(iip(listed=listed, num_only=num_only))
    return ret

def iip_ord():
    return [ord(i) - ord("a") for i in input()]

def YesNo(s):
    if s:
        print("Yes")
    else:
        print("No")

def fprint(s):
    for i in s:
        print(i)

def bitall(N):
    ret = []
    for i in range(2**N):
        a = []
        for j in range(N):
            a.append(i%2)
            i //= 2
        ret.append(a)
    return ret

def split_print_space(s):
    print(" ".join([str(i) for i in s]))

def split_print_enter(s):
    print("\n".join([str(i) for i in s]))


def koenai_saidai_x_index(sorted_list, n):
    l = 0
    r = len(sorted_list)
    if len(sorted_list) == 0:
        return False
    if sorted_list[0] > n:
        return False

    while r - l > 1:
        x = (l + r) // 2
        if sorted_list[x] == n:
            return x
        elif sorted_list[x] > n:
            r = x
        else:
            l = x
    return l


def searchsorted(sorted_list, n, side="left"):
    if side not in ["right", "left"]:
        raise Exception("sideはrightかleftで指定してください")

    l = 0
    r = len(sorted_list)

    if n > sorted_list[-1]:
        # print(sorted_list)
        return len(sorted_list)
    if n < sorted_list[0]:
        return 0

    while r - l > 1:
        x = (l + r) // 2
        if sorted_list[x] > n:
            r = x
        elif sorted_list[x] < n:
            l = x
        else:
            if side == "left":
                r = x
            elif side == "right":
                l = x

    if side == "left":
        if sorted_list[l] == n:
            return r - 1
        else:
            return r

    if side == "right":
        if sorted_list[l] == n:
            return l + 1
        else:
            return l


def soinsuu_bunkai(n):
    ret = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret


def conbination(n, r, mod, test=False):
    if n <= 0:
        return 0
    if r == 0:
        return 1
    if r < 0:
        return 0
    if r == 1:
        return n
    ret = 1
    for i in range(n - r + 1, n + 1):
        ret *= i
        ret = ret % mod

    bunbo = 1
    for i in range(1, r + 1):
        bunbo *= i
        bunbo = bunbo % mod

    ret = (ret * inv(bunbo, mod)) % mod
    if test:
        # print(f"{n}C{r} = {ret}")
        pass
    return ret


def inv(n, mod):
    return power(n, mod - 2)


def power(n, p, mod_= mod):
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p // 2, mod_) ** 2) % mod_
    if p % 2 == 1:
        return (n * power(n, p - 1, mod_)) % mod_


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
  N = int(input())
  A = int(input())
  B = int(input())
  C = int(input())
  D = int(input())
  E = int(input())
  print(-(-N//min(A, B, C, D, E))+4)

Submission status: Accepted

Solution code:
import sys
import math
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)]

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

bottle = min(A,B,C,D,E)
delay = math.ceil(N/bottle) - 1

print(5 + delay)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

import math

n = ni()
a = nin(5)

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

Submission status: Accepted

Solution code:
N = int(input())
tmp = [0 for i in range(5)]
for i in range(5):
    tmp[i] = int(input())
tmp_min = min(tmp)
base = 0
if N % tmp_min == 0:
    base = N // tmp_min
else:
    base = N // tmp_min + 1

print(base + 4)

Submission status: Accepted

Solution code:
N = int(input())
T = [int(input()) for _ in range(5)]
print((N+min(T)-1)//min(T) + 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())
m = []
for i in range(5):
    m.append(int(input()))
mn = min(m)
if N%mn==0:
    print(N//mn+4)
else:
    print(N//mn+5)

Submission status: Accepted

Solution code:
from math import ceil
n=int(input())
min_val=min(int(input()),int(input()),int(input()),int(input()),int(input()))
m=ceil(n/min_val)
print(5+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())

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

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

Submission status: Accepted

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

m = min([a,b,c,d,e])
t = 4
if n%m==0:
    t += n//m
else:
    t += n//m + 1
print(t)

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    N = int(input())

    P = [0] * 5
    for i in range(5):
        P[i] = int(input())
    
    res = 4 + math.ceil(N / min(P))
    print(res)        


if __name__ == '__main__':
    main()

Submission status: Accepted

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

cost = (N + (min_T - 1)) // min_T
ans = cost + 4
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
def main():
    N, *M = (int(input()) for _ in range(6))

    t = 10 ** 15 + 1
    ind = -1
    for i, x in enumerate(M):
        if x < t:
            t = x
            ind = i

    ans = 5 + (N - 1) // t + 1 - 1
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

Solution code:
N = int(input())
MIN = float("inf")
for _ in range(5):
    MIN = min(MIN, int(input()))

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

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

print(math.ceil((n-mini)/mini)+5)

Submission status: Accepted

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

x=min(s)
print(-(-n//x)+4)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import permutations
import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    n=II()
    aa=[II() for _ in range(5)]
    mn=min(aa)
    ans=(n+mn-1)//mn+4
    print(ans)

main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
e = [0] * 5
for i in range(5): e[i] = int(input())
print(-(-N // min(e)) + 4)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    T = [int(input()) for i in range(5)]
    minT = min(T)
    bo = (N + minT - 1)//minT
    print(4+bo)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n, a, b, c, d, e = [int(input()) for _ in range(6)]
min_ = min(a, b, c, d, e)
ans = -(-n // min_) + 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())


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

Submission status: Accepted

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

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

ans = 4 + N // x
if N % x != 0:
  ans += 1

print(ans)

Submission status: Accepted

Solution code:
from math import ceil


def main():
    l = [int(input()) for _ in range(6)]
    n, a, b, c, d, e = l
    group = ceil(n / min(a, b, c, d, e))
    print(4 + group)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np
import sys
readline = sys.stdin.readline
read = sys.stdin.read

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

def kiriage(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1
		
x = np.array([a, b, c, d, e])
print(kiriage(n, np.min(x)) + 4)

Submission status: Accepted

Solution code:
import math

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

time = math.ceil(n / base[0])
base_min = base[0]

for i in range(1,5):
  if base_min <= base[i]:
    time = time + 1
  elif base[i] < base_min:
    time = time + math.ceil( (n - base[i]*(math.ceil(n/base_min)-1) )/base[i]) 
    base_min = base[i]
print(time)