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 fractions
import sys
from functools import reduce
import math

input = sys.stdin.readline

def main():
    n = int(input())
    stations = []
    for _ in range(5):
        stations.append(int(input()))
    min_x = min(stations)
    print(5 + math.ceil(n / min_x) - 1)


def divide_list(l, args):
    result = []
    pre = 0
    for i, a in enumerate(args):
        if i != 0:
            pre = args[i-1]
        result.append(l[pre:a])
        if i == len(args) - 1:
            result.append(l[a:])
    return result

def divide_two(n):
    c = 0
    while True:
        if c >= 2:
            break
        if n % 2 != 0:
            break
        n //= 2
        c += 1
    return c

def get_camulative(l):
    import itertools
    # 累積和
    return [0] + list(itertools.accumulate(l))

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

mn = min(li)
groups = (n + mn - 1) // mn
ans = 5 + groups - 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 5
if n%min(L) == 0:
    ans += n//min(L)-1
else:
    ans += n//min(L)+1-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(4+ceil(N/min(A,B,C,D,E)))

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())
k=min(a,min(b,min(c,min(d,e))))
s=math.ceil(n/k)
while s*k<n:
  s+=1
print(5+s-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())

l = min([a,b,c,d,e])
print(5 + math.ceil(n/l) - 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)


        




n=l()[0]
a=l()[0]
b=l()[0]
c=l()[0]
d=l()[0]
e=l()[0]
x=min(a,b,c,d,e)
if(x>=n):
    print(5)
else:
    if(n%x!=0):
        n=n+(x-n%x)
    ans=n//x+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())

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

Submission status: Accepted

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

    time = [0] * 5

    for i in range(5):
        if N % transportation[i] == 0:
            time[i] = N // transportation[i]
        else:
            time[i] = N // transportation[i] + 1

    ans = max(time) + 4

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

A.sort()
if A[0] >= N:
    print(5)
    exit()
else:
    if N % A[0] == 0:
        print(N // A[0] + 4)
        exit()
    else:
        print(N // A[0] + 5)
        exit()

Submission status: Accepted

Solution code:
import math

N = int(input())
trans = [int(input()) for i in range(5)]
print(math.ceil(N / min(trans)) - 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())


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

s = 0 if N % mi == 0 else 1
ans = 5 if mi > N else 4+N//mi+s
print(ans)

Submission status: Accepted

Solution code:
from math import ceil
n, *cities = [int(input()) for _ in range(6)]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
print(5+(N-1)//min(a))

Submission status: Accepted

Solution code:
x = [int(input()) for _ in range(6)]

import math

ans = math.ceil(x[0] / min(x[1:])) + 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())

small=min(A,B,C,D,E)
if small>=N:
    print(5)
else:
    print(4+math.ceil(N/small))

Submission status: Accepted

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

m = min(l[1:])

mc = l[0] // m
mr = l[0] % m

if mr != 0:
    mc += 1

print( 4 + mc )

Submission status: Accepted

Solution code:
n = int(input())
abc = []
res = [0]*5
for i in range(5):
    a = int(input())
    abc.append(a)
    res[i] = -(-n//a)
ans = 4 + max(res)
print(ans)

Submission status: Accepted

Solution code:
import math

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

ans += math.ceil((n-mi)/mi)

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

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
A=[]
B=[0,0,0,0,0]
aa=int((n-0.1)//a)+1
ba=int((n-0.1)//b)+1
ca=int((n-0.1)//c)+1
da=int((n-0.1)//d)+1
ea=int((n-0.1)//e)+1
A.extend([aa,ba,ca,da,ea])
for i in range(4):
    for j in range(i+1,5):
        if A[i]<A[j]:
            A[j]=A[j]-A[i]
        else:
            A[j]=0
ans = 5+A[0]+A[1]+A[2]+A[3]+A[4]-1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N = INT()
lim = [INT() for _ in range(5)]

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N = INT()
L = [INT() for _ in range(5)]

C = min(L)
l = L.index(C) 
r = 4 - l

print(-(-N//C)+l+r)

Submission status: Accepted

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

def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    from math import ceil
    return ceil(N / min(A, B, C, D, E)) + 4


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(N, A, B, C, D, E))

def test():
    import doctest
    doctest.testmod()

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    n, *data = map(int, readlines())
    d = [int(i) for i in data]
    mi = min(d)
    if mi > n:
        print(5)
        return
    n = (n+mi-1)//mi
    print(n+4)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    n, *data = map(int, readlines())
    d = [int(i) for i in data]
    mi = min(d)
    mx = max(d)
    if mi > n:
        print(5)
        return
    n = (n+mi-1)//mi
    print(n+4)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

q,r = divmod(N,min(transportations))

if r != 0:
    q += 1

output = q + 4

print(output)

Submission status: Accepted

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

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


ans = (n-1)//min(a, b, c, d, e)+1 + 4
print(ans)

Submission status: Accepted

Solution code:
import sys
#import numpy as np
import math
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
from fractions  import gcd

input=sys.stdin.readline
n=int(input())
x=[int(input()) for _ in range(5)]
t=[0]*5
t[0]=math.ceil(n/x[0])
m=x[0]
for i in range(1,5):
    if x[i]>=m:
        t[i]=t[i-1]+1
    else:
        t[i]=i+math.ceil(n/x[i])
        m=x[i]
print(t[-1])

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:
import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ABCDE = [A, B, C, D, E]
print(-(-N//min(ABCDE)) + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
minimum = (-1,float('inf'))
for i in range(5):
  capa = int(input())
  if capa < minimum[1]:
    minimum = (i, capa)

print(math.ceil(N/minimum[1])+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
print(4 + math.ceil(n / min(a, b, c, d, e)))

Submission status: Accepted

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

repeat = n//mina

if n % mina == 0:
  print(repeat + 4)
else:
  print(repeat + 5)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

now = 0
for i, a in enumerate(A):
    now = max((N - 1) // a + 1 + i, now + 1)
print(now)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
n = ii()
l = []
for i in range(5):
    l.append(ii())

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

Submission status: Accepted

Solution code:
n,a,b,c,d,e=[int(input()) for _ in range(6)]

if n%min(a,b,c,d,e)==0:
    print(n // min(a,b,c,d,e) + 4)
else:
    print(n // min(a,b,c,d,e) + 5)

Submission status: Accepted

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


resolve()

Submission status: Accepted

Solution code:
import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=min(a,b,c,d,e)
print(math.ceil(n/f+4))

Submission status: Accepted

Solution code:
import math
n = int(input())
Min = 10000000000000000
for _ in range(5):
	Min = min(int(input()),Min)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

mn = min(L)
ans = (-(-N//mn)) + 4
print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
a=[int(input()) for i in range(5)]
b=0
for i in range(5):
  b=max(math.ceil(n/a[i]),b)
print(5+b-1)

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n = n//a
    count += 1
  if a**count == n:
    return count
  else:
    return count+1

#############
# Main Code #
#############

N,A,B,C,D,E = ILs(6)

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

Submission status: Accepted

Solution code:
n=int(input())
#a,b,x=map(int,input().split())
#hl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

mn=min(a,b,c,d,e)
print((n+mn-1)//mn +4)

Submission status: Accepted

Solution code:
import math

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


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

ans = math.ceil(n/minmove) + 4

print(ans)

Submission status: Accepted

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

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

now = [n,0,0,0,0,0]

from math import ceil

# i1 = ceil(n/a)
# now[0] = n - i1*a if n - i1*a >=0 else 0
# now[1] = a*(i1-1) - b*(i1-2) if a*(i1-1) - b*(i1-2) >=0 else 0
# now[2] = b*(i1-2) - c*(i1-3) if b*(i1-2) - c*(i1-3) >=0 else 0
# now[3] = c*(i1-3) - d*(i1-4) if c*(i1-3) - d*(i1-4) >=0 else 0
# now[4] = d*(i1-4) - e*(i1-5) if d*(i1-4) - e*(i1-5) >=0  else 0
# now[5] = e*(i1-5) if e*(i1-5) >=0 else 0

k = ceil(n/ min(a,b,c,d,e)) +4

print(k)

Submission status: Accepted

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

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

# check
total = 0
citys = [N] + ([0] * 5)

bottleneck = min(Cap)
print((N + bottleneck - 1) // bottleneck + 4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n=int(input())
l=[int(input()) for _ 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())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

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

Submission status: Accepted

Solution code:
import math
n,a,b,c,d,e = map(int,open(0).read().split())

print(5+math.ceil(n/min([a,b,c,d,e]))-1)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
n=int(input())

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

print(-(-n//min(v))+4)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import fractions
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

N = getN()
A = getArray(5)
# 一番乗員が少ない交通機関がボトルネックになる
# 他はトントンで行ける
neck = min(A)
print((N + neck - 1) // neck + 4)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
# ABC123 C Five Transportations
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])
_ans = math.ceil(n/_min)

print(_ans+4)

Submission status: Accepted

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

def solve():
    mi = min(A)
    ans = 4+(N+mi-1)//mi
    return ans
print(solve())

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

N = int(input())
times = [int(input()) for _ in range(5)]
t = max([ceil(N / time) - 1 for time in times])
print(t + 5)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
original = [a,b,c,d,e]

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

Submission status: Accepted

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
# from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

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

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

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

def SI():
    return input()

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

def SRI():
    return list(input().split())

def SCI(n):
    return [ input() for _ in range(n) ]

def SLI(n):
    return [ list(input().split()) for _ in range(n) ]

n = I()
abcde = CI(5)

m = min(abcde)

if m==1:
    ans = n + 4
elif m>n:
    ans = 5
else:
    ans = (n//m) + 1 + 4
print(ans)

Submission status: Accepted

Solution code:
import math
# def myAnswer(argv:list) -> int:


def modelAnswer(argv:list) -> int:
   return math.ceil(argv.pop(0) / min(argv)) + 4
def main():
   argv = [int(input()) for _ in range(6)]
   print(modelAnswer(argv))

if __name__ == '__main__':
   main()

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

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