Problem:


Score: 300 points

Problem Statement

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

There are five means of transport in this empire:

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

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

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

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

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

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

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

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

Constraints

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

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A
B
C
D
E

Output

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

Sample Input 1

5
3
2
4
3
5

Sample Output 1

7

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

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

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

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

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

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

Sample Input 2

10
123
123
123
123
123

Sample Output 2

5

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

Sample Input 3

10000000007
2
3
5
7
11

Sample Output 3

5000000008

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



Sample input:
5
3
2
4
3
5


Sample output:
7

Submission status: Accepted

Solution code:
import sys
import math

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

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

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

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

Submission status: Accepted

Solution code:
#ABC123_C
N=int(input())

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

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

if N%bn==0:
    num=N//bn
else:
    num=N//bn+1

print(num+4)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read

import math
n, *lst = map(int, read().split())
t = prep = math.ceil(n / lst[0])
for i in lst[1:]:
  tt = math.ceil(n / i)
  if tt <= prep:
    t += 1
  else:
    t += 1 + tt - prep
    prep = tt
print(t)

Submission status: Accepted

Solution code:
import math
n = int(input())

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

ans = 0
ans = math.ceil((n / min(t))) + 4

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

N, *ABCDE = map(int, open(0).read().split())
bottle_neck = min(ABCDE)
print(ceil(N / bottle_neck) + 4)

Submission status: Accepted

Solution code:
import math


N, *ABCDE = map(int, open(0).read().split())
bottle_neck = min(ABCDE)
print(math.ceil(N/bottle_neck) + 4)

Submission status: Accepted

Solution code:
import math


def main():
    N, *ABCDE = map(int, open(0).read().split())

    bottle_neck = min(ABCDE)
    
    print(math.ceil(N/bottle_neck) + 4)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
from math import ceil
n=int(input())
a=int(input())
for i in range(4):
    a=min(int(input()),a)

g=ceil(n/a)
print(g-1+5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

(n,a,b,c,d,e) = [int(input().rstrip()) for i in range(6)]

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

ans = int(n/f) + (0 if n % f == 0 else 1) + 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

n = int(input())
a = [int(input()) for i in range(5)]
mn = min(a)
print(4 + ceil(n / mn))

Submission status: Accepted

Solution code:

def solve(N,T):
    import math
    ans = 0
    for i in range(len(T)):
        ans = max(ans, math.ceil(N/T[i]))
    ans += 4
    print(ans)

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
min1=11**15
for i in range(5):
    a=int(input())
    min1=min(min1,a)
print(-(-n//min1)+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())

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

time = math.ceil(N/data[0])+4
if data[0] >= N:
    time = 5

print(time)

Submission status: Accepted

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

Submission status: Accepted

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

min_p = barrier.index(min(barrier))
print(min_p+(n//barrier[min_p] + (n % barrier[min_p] > 0))+5-min_p-1)

Submission status: Accepted

Solution code:
import math
n=int(input())
minnum=9999999999999999999999999
for _ in range(5):
    a= int(input())
    if a<minnum:
        minnum=a

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

Submission status: Accepted

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

div = min(li)
gr = math.ceil(n / div)
print(5+gr-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
l=[int(input()) for i in range(6)]
n=l[0]
min_=min(l[1:])
print(n//min_+1+4 if n%min_!=0 else n//min_+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,*A = map(int,open(0).read().split())
print((N+min(A)-1)//min(A) + 4)

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


# どの都市間も同じ人数ずつ移動するとしてよい

N = int(sys.stdin.buffer.readline())
A = [int(sys.stdin.buffer.readline()) for _ in range(5)]
flow = min(A)
ans = math.ceil(N / flow) + 4
print(ans)

Submission status: Accepted

Solution code:
import math

def my_solve2():
    """
    最短時間はもっとも移動可能人数が少ない区間に依存する
    """
    num = int(input())
    transpotations = []
    for _ in range(5):
        transpotations.append(int(input()))

    # print(transpotations, min(transpotations))
    # 最も移動可能人数が少ない区間の抽出
    bottleneck = min(transpotations)

    # 移動時間．切り上げの必要あり
    time = math.ceil(num / bottleneck)

    time += 4
    return time


def my_solve():
    """
    未完成
    現在の人の分布と1分後の人の分布を分けて考えるために2つの人分布リストが必要
    この方法では制限時間内に計算を終了することができない
    """
    num = int(input())
    # print("num: {}".format(num))
    traffic_a = int(input())
    traffic_b = int(input())
    traffic_c = int(input())
    traffic_d = int(input())
    traffic_e = int(input())

    city_people_num = [num, 0, 0, 0, 0, 0]

    time = 0
    # TODO: 現在の人の分布と1分後の人の分布を分けて考えるために2つのリストが必要
    while city_people_num[5] < num:
        #print(city_people_num)
        # 1->2
        if city_people_num[0] >= traffic_a:
            city_people_num[0] -= traffic_a
            city_people_num[1] += traffic_a
        else:
            city_people_num[1] += city_people_num[0]
            city_people_num[0] = 0
        #print(city_people_num)
        time += 1
        # 2->3
        if city_people_num[1] >= traffic_b:
            city_people_num[1] -= traffic_b
            city_people_num[2] += traffic_b
        else:
            city_people_num[2] += city_people_num[1]
            city_people_num[1] = 0
        #print(city_people_num)
        time += 1
        # 3->4
        if city_people_num[2] >= traffic_c:
            city_people_num[2] -= traffic_c
            city_people_num[3] += traffic_c
        else:
            city_people_num[3] += city_people_num[2]
            city_people_num[2] = 0
        time += 1
        # 4->5
        if city_people_num[3] >= traffic_d:
            city_people_num[3] -= traffic_d
            city_people_num[4] += traffic_d
        else:
            city_people_num[4] += city_people_num[3]
            city_people_num[3] = 0
        time += 1
        # 5->6
        if city_people_num[4] >= traffic_e:
            city_people_num[4] -= traffic_e
            city_people_num[5] += traffic_e
        else:
            city_people_num[5] += city_people_num[4]
            city_people_num[4] = 0
        time += 1
        #print("time {}".format(time))
        #print(city_people_num)

    return time

print(my_solve2())

Submission status: Accepted

Solution code:
N = int(input())
abc = []
for i in range(5):
    abc.append(int(input()))
mina = min(abc)
suma = (N-1)//mina + 1 
print(suma + 4)

Submission status: Accepted

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

ans = -(-n // min(l)) + 4
print(ans)

Submission status: Accepted

Solution code:
def examA():
    X = [I() for _ in range(5)]
    k = I()
    X.sort()
    ans = "Yay!"
    if X[-1]-X[0]>k:
        ans = ":("
    print(ans)
    return

def examB():
    X = [I() for _ in range(5)]
    ans = 0
    for i in range(5):
        ans += (X[i]+9)//10 *10
        X[i] = (X[i]-1)%10
    ans -= (9-min(X))
    print(ans)
    return

def examC():
    N = I()
    X = [I() for _ in range(5)]
    ans = max(0,(N-1)//min(X))+5
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,inf
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examC()

Submission status: Accepted

Solution code:
def solve():
    N, *T = map(int, open(0).read().split())

    bottleneck = (0, 10**15)
    for i, t in enumerate(T):
        if t <= bottleneck[1]:
            bottleneck = (i, t)
    
    if N % bottleneck[1] == 0:
        print(bottleneck[0] + N // bottleneck[1] + 4 - bottleneck[0])
    else:
        print(bottleneck[0] + N // bottleneck[1] + 1 + 4 - bottleneck[0])


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

min1 = float("inf")
for i in range(5):
    min1 = min(min1, man[i])
ans = math.ceil(n / min1)
print(ans+4)

Submission status: Accepted

Solution code:
N,*A=map(int,open(0).read().split())
print(5+(N-1)//min(A))

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())
print(4+n//min(a)+(n%min(a)>0))

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

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

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

Submission status: Accepted

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

real = [float("inf")]
for i in range(len(traffic)):
    if real[-1] < traffic[i]:
        real.append(real[-1])
        continue

    real.append(traffic[i])

print(math.ceil(n/real[-1]) + 4)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
time = [int(input()) for _ in range(5)]
#print(time)
mt = min(time)
if N%mt == 0:
    tt = N//mt
else:
    tt = N//mt+1
ans = tt + 4
print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

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

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())
nekku = min(A)
ans = N//nekku + 4
if N%nekku != 0:
    ans += 1
print(ans)

Submission status: Accepted

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

n = int(input())
capacities = [int(input()) for i in range(5)]
min_v = min(capacities)
ans = math.floor((n + min_v - 1) / min_v + 4)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import *

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

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

print(ceil(n/mn)+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N=int(input())
A,B,C,D,E=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:
n, *a = [int(input()) for _ in range(6)]
print(max(int(n - 1) // min(a), 0) + 5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
print(max(map(lambda num: ceil(N / num), (int(input()) for _ in range(5)))) + 4)

Submission status: Accepted

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

print(5+ -(-n//min(l)) -1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n<=m:
      print(5)
      exit()

a=n//m-1 if n%m==0 else n//m

print(5+a)

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ans = min(A, B, C, D, E)
#print(ans)
print(int(5+(N-1/2)//ans))

Submission status: Accepted

Solution code:
n = int(input())
ride = []
for i in range(5):
    ride.append(int(input()))
if n%min(ride) != 0:
    s = 1
else:
    s = 0

print(4+n//min(ride)+s)

Submission status: Accepted

Solution code:
n = int(input())

mn = 1e17

for i in range (5):
  nn = int(input())
  mn = min(mn, nn)
  
cnt = n//mn
if n%mn != 0:
  cnt += 1
  
print(str(cnt+4))

Submission status: Accepted

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

m=0
for i in range(5):
    if x[m]>x[i]:
        m=i
if m==0:
    print(5+math.ceil(n/x[0])-1)
else:
    print(5+math.ceil(n/x[m])-1)

Submission status: Accepted

Solution code:
import math

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

if min(A) >= n:
    print(5)
else:
    print(math.ceil(n/min(A))+4)

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

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
A = INT()
B = INT()
C = INT()
D = INT()
E = INT()
F = [A, B, C, D, E]
G = [math.ceil(N/f)-1 for f in F]

#print(G)
print(5+max(G))

Submission status: Accepted

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

stp_min = stp.index(min(stp))
tim = ceil(n/min(stp)) + 4
print(tim)

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]
x=n//min(l)
if min(l)!=1:
    print(5+x)
else:
    print(4+x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque, Counter
import sys,heapq,bisect,math,itertools,string,queue,copy,time
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

n = inp()
mini = 10**15
for _ in range(5):
    temp = inp()
    if temp < mini: mini = temp

ans = n//mini + (n%mini != 0)+4
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

res=5
res+=(b+n-1)//b
print(res-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())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m = min(way)
if m >= n:
    print(5)
elif n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 5)

Submission status: Accepted

Solution code:
import math

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

for _ in range(5):
    time.append(math.ceil(n / (int(input()))))
print(max(time) + 4)

Submission status: Accepted

Solution code:
import math

N = int(input())

A = [0] * 5

human_in_city = [0]*6
human_in_city[0] = N
moving_human = [0]*5

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

# count = 0
# while human_in_city[-1] != N:
#     count += 1
#     for i in range(5):
#         if human_in_city[i] >= A[i]:
#             moving_human[i] = A[i]
#         else:
#             moving_human[i] = human_in_city[i]
#     for i in range(5):
#         human_in_city[i+1] += moving_human[i]
#         human_in_city[i] -= moving_human[i]

min_A = min(A)

count = 5 + math.ceil(N / min_A) -1

print(count)

Submission status: Accepted

Solution code:
import math
import heapq
import sys
from collections import Counter
import numpy as np
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input[0].split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import ceil


def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    print(ceil(N/min(A,B,C,D,E))+4)



# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    solve(N, A, B, C, D, E)

if __name__ == '__main__':
    main()

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

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

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

Submission status: Accepted

Solution code:
import math
N = int(input())
abcde =[ int(input()) for _ in range(5)]
min_num = min(abcde)
if N%min_num == 0:
    print(5+math.ceil(N//min_num)-1)
else:
    print(5+math.ceil(N//min_num))

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)
print(5-(-(n-m)//m))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import ceil

def main():
    n, *cap = map(int, sys.stdin.read().split())
    
    t = ceil(n / min(cap) + 4)
    print(t)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

a = min(A, B, C, D, E)
ans = 5
if N % a != 0:
    ans += (N // a) 
else:
    ans += (N // a) - 1
if a >= N:
    ans = 5
print(ans)

Submission status: Accepted

Solution code:
import math
data=[int(input()) for i in range(6)]
n=data[0]
trans=data[1:]
mintrans=min(trans)

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if min(a,b,c,d,e)==a:
    if n%a!=0:
        print(n//a+1+4)
    else:
        print(n//a+4)
elif min(a,b,c,d,e)==b:
    if n%b!=0:
        print(n//b+1+4)
    else:
        print(n//b+4)
elif min(a,b,c,d,e)==c:
    if n%c!=0:
        print(n//c+1+4)
    else:
        print(n//c+4)
elif min(a,b,c,d,e)==d:
    if n%d!=0:
        print(n//d+1+4)
    else:
        print(n//d+4)
elif min(a,b,c,d,e)==e:
    if n%e!=0:
        print(n//e+1+4)
    else:
        print(n//e+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


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

    arr = [A, B, C, D, E]
    minimum = min(arr)
    if N % minimum == 0:
        a = N // minimum
    else:
        a = N // minimum + 1

    print(a+4)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
C = []
for _ in range(5):
    C.append(int(input()))
minA = min(C)
if N - minA <= 0:
    print(5)
else:
    n = (N - minA) 
    if n % minA == 0:
        print(5 + (n // minA))
    else:
        print(6 + (n // minA))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    l=[int(input()) for i in range(5)]
    l2=list(map(lambda x: -(-N//x)-1, l))
    print(5+sorted(l2)[4])

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=min(int(input()) for _ in range(5))
print(-(-n//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())

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

Submission status: Accepted

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

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

    m = min(A, B, C, D, E)
    if N % m == 0:
        print(N//min(A, B, C, D, E)+4)
    else:
        print(N//min(A, B, C, D, E)+5)


main()

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(5)]
B = min(A)
C = N//B+1 if N%B!=0 else N//B
ans = C+4
print(ans)

Submission status: Accepted

Solution code:
import math
N=int(input())
T=[int(input()) for i in range(5)]
bottleneck=min(T)
if N<=bottleneck:
    Ans=5
else:
    Ans=5+math.ceil((N-bottleneck)/bottleneck)
print(Ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC123 C - Five Transportations
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
min_num = 10**16
ans = 5
n = 0
for i in range(6):
    t = int(input())
    if i==0:
        n = t
    min_num = min(min_num,t)

if n==min_num:
    print(ans)
    exit()

a = n%min_num
if a == 0:
    ans += (n//min_num)-1
else:
    ans += (n//min_num)

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

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

group = -(-N // MIN)

print(5 + group - 1)