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=int(input());x=min([int(input())for i in[0]*5]);print((n+x-1)//x+4)

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for x in range(5)]
B = []
cnt=0
for i in range(5):
    if A[i]>=n:
        B.append(1)
        cnt+=1
    else:
      if A[i]==1:
        B.append(n)
      else:
        B.append(int(n/A[i])+1)
if cnt==5:
    print(5)
else:
    print(max(B)+4)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
n = int(input())
move = [int(input()) for i in range(5)]

mini = min(move)

time =(n/mini)+4

print(math.ceil(time))

Submission status: Accepted

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

min_i = -1
min_kazu = 10**20
for i, p in enumerate([a, b, c, d, e]):
    if p < min_kazu:
        min_kazu = p
        min_i = i

nokori = 5-min_i
if N%min_kazu == 0:
    print(4+N//min_kazu)
else:
    print(5+N//min_kazu)

Submission status: Accepted

Solution code:
import math
n = int(input())
menu = []
for i in range(0, 5):
    menu.append(int(input()))
min_in = min(menu)

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

num_min = min(num)
print(max(math.ceil(N / num_min),1) + 4 )

Submission status: Accepted

Solution code:
import math

N = int(input())

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


min_cost = min(C)
t = math.ceil(N / min_cost) + 4
print (int(t))

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])
num = math.ceil(n/min_) + 4
print(num)

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%a == 0:
    train = n // a
else:
    train = 1 + (n // a)
    
if n%b == 0:
    bus = (n // b)
else:
    bus = 1 + (n // b)
    
if n%c == 0:
    taxi = (n // c)
else:
    taxi = 1 + (n // c)
    
if n%d == 0:
    plane = (n // d)
else:
    plane = 1 + (n // d)
    
if n%e == 0:
    boat = (n // e)
else:
    boat = 1 + (n // e)

vehicles = [train, bus, taxi, plane, boat]

latest = train
for i in range(len(vehicles)):
    if latest < vehicles[i]:
        latest = vehicles[i]

if latest == train:
    an = train + 4
elif latest == bus:
    an = bus + 4
elif latest == taxi:
    an = taxi + 4
elif latest == plane:
    an = plane+ 4
else:
    an = boat + 4

print(an)

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):
    print(5)
elif min(A,B,C,D,E) !=1:
    print(5 + (N //min(A,B,C,D,E)))
else:
    print(5 + (N //min(A,B,C,D,E))-1)

Submission status: Accepted

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

if n % li[0] == 0:
    a = n // li[0]
else:
    a = n // li[0] + 1

print(a + 4)

Submission status: Accepted

Solution code:
n,a,b,c,d,e=[int(input()) for i in range(6)]
A=[a,b,c,d,e]
if n<=min(A):
  print(5)
else:
  if n%min(A)==0:
    ans=n//min(A)+4
  else:
    ans=n//min(A)+5
  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)
if n % m == 0:
  print(4 + n // m)
else:
  print(5 + n // m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp = []
for i in range(6):
    inp.append(int(input()))
n = inp[0]
inp.pop(0)

a = sorted(inp)
resu = n//a[0] + 4
if n % a[0] != 0:
    resu += 1

print(resu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

N = int(input())
list = []
for i in range(5):
    list.append(int(input()))
#print(list)
twn = [0] * 6
twn[0] = N
#print(twn)

ans = []
for i in range(5):
    ans.append(math.ceil(N / list[i]))
#print(ans)
#print(sum(ans))

answer = ans[0] + ans[1] - 1 + ans[2] - 1 + ans[3] - 1 + ans[4]
#print(answer)
#print(max(sum(ans),answer))
print(max(ans) + 4)

Submission status: Accepted

Solution code:
import math

N = int(input())
rcvr = [0, 0, 0, 0, 0]
i = 0
while (i < 5):
    rcvr[i] = int(input())
    i += 1

narrow = min(rcvr)
ans = (N / narrow)
if (ans < 1):
    ans = 1
ans = math.ceil(ans)
ans += 4

print(ans)

Submission status: Accepted

Solution code:

# https://atcoder.jp/contests/abc123/tasks/abc123_c

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

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

if n % minimum != 0:
    diff = n // minimum + 1
else:
    diff = n // minimum

print(diff+4)

Submission status: Accepted

Solution code:
import math

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

bottleneck = min(cities)
groups = math.ceil(n/bottleneck)

print(groups + 4)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


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


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A, B, C, D, E):
    m  = min((A, B, C, D, E ))
    return math.ceil(N/m) + 4


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

s = [0] * 5
for i in range(5):
    s[i] = int(input())


min_i = s.index(min(s))
min = min(s)
time = 0
if N%min != 0:
    time = N//min + 1 + 4
else:
    time = N//min + 4

# print(10//123)
print(time)

Submission status: Accepted

Solution code:
from math import ceil

n = int(input())
array = []
for i in range(5):
    array.append(int(input()))
base = min(array)
print(5 + ceil(max(n-base, 0) /base))

Submission status: Accepted

Solution code:
n = int(input())

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

min_ = min(l)


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

Submission status: Accepted

Solution code:
import numpy as np
import math

diff_rate = [0] * 5

N = int(input())

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

min_rate = np.min(diff_rate)



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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    I = [int(input()) for _ in [0] * 6]

    min_ = min(I[1:])
    idx = I[1:].index(min_)
    n = (I[0] - 1) // min_
    print(5 + n)

input = lambda: stdin.readline()
main()

Submission status: Accepted

Solution code:
import math

num = [] #５個の料理の必要時間

n=input()
n=int(n)

for i in range(5): #入力
    a = input()
    a = int(a)
    num.append(a)



mini=min(num)
i=max(0,int(math.ceil(n/mini)))

print(4+i)

Submission status: Accepted

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

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

mi = min(li)

group_num = n//mi + int(bool(n%mi))

print(group_num + 4)

Submission status: Accepted

Solution code:
import math

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

neck = min(capa)

t = math.ceil(n/neck)

print(t+4)

Submission status: Accepted

Solution code:
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
r = (N//min([a,b,c,d,e]))+4
if N%min([a,b,c,d,e]) != 0:
    print(r+1)
else:
    print(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):
    x = min(A,B,C,D,E)
    ans = 5+int(N/x)
    if(N%x == 0):
        ans -= 1
    print(ans)
    return


# Generated by 1.1.3 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()) 
a = int(input()) 
b = int(input()) 
c = int(input()) 
d = int(input()) 
e = int(input())

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

print(ans)

Submission status: Accepted

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

if(min(tl) == 1):
  a = n // min(tl) - 1
else:
  a = n // min(tl)

print(a + 5)

Submission status: Accepted

Solution code:
N = int(input())
L = [int(input()) for _ in range(5)]
minL = 10**16
minIndex = -1
for i in range(5):
  if L[i] < minL:
    minIndex = i
    minL = L[i]
ans = 4 + N//minL
if N%minL != 0: ans += 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())

location = [n, 0, 0, 0, 0, 0]
cap = [a, b, c, d, e]


min_cap = min(cap)
if min_cap >= n:
	print(5)

else:
	total = int((n-1)/min_cap) + 5
	print (total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
trans = []
for i in range(5):
  trans.append(int(input()))
count = 5
yusou_min = min(trans)

if N % trans[0] == 0:
  count += (N // yusou_min - 1)
else:
  count += (N // yusou_min)
  
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

m = min(t)
dN = N//m
rN = N%m
if rN != 0:
    dN += 1
ans = 5 + dN - 1

print(ans)

Submission status: Accepted

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

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

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

print(time)

Submission status: Accepted

Solution code:
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
l = [A,B,C,D,E]
m = min(l)
ans = 5 - 1 + math.ceil(N/m)
print(ans)

Submission status: Accepted

Solution code:
import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")


N=int(input())

cost=10**15

import math
for _ in range(5):
  cost = min(cost, int(input()))

ans=5
ans+= max(0, math.ceil(N/cost)-1)

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

S = [A,B,C,D,E]

ans = math.ceil(N/min(S))

print(ans+4)

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
input = sys.stdin.readline

N = int(input())
min = sorted([int(input()) for _ in range(5)])[0]

times = int((N / min + 0.9) * 10 // 10)

if times == 0:
    times = 1

print(5 + (times - 1))

Submission status: Accepted

Solution code:
n=int(input())
l=[int(input()),int(input()),int(input()),int(input()),int(input())]
m=min(l)
t= (n-1)//m + 5
print(t)

Submission status: Accepted

Solution code:
from math import ceil

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

print(ceil(n / x[0]) + 4)

Submission status: Accepted

Solution code:
import numpy as np
import math

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

X = [A, B, C, D, E]

min_idx = np.argsort(X)[0]

res = 0
res = res + math.ceil(N / X[min_idx])
res = res + 4

print(res)

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())
capacity = [a, b, c, d, e]

min = capacity[0]
for i in range(0, 5):
    if capacity[i] < min:
        min = capacity[i]


print("{}".format(math.ceil(N/min)+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())
l = [a,b,c,d,e]
x = min(l)
if n > x:
        ans = math.ceil(n/x) + 5 - 1
else:
        ans = 5
print(ans)

Submission status: Accepted

Solution code:
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
 
N, *num = [int(input()) for i in range(6)]
min = sorted(num)[0]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i = [int(input().strip()) for i in range(6)]


for s in range(1,6):
  if s == 1:
    minimum = i[s]
  else:
    if minimum > i[s]:
      minimum=i[s]

tmp = i[0] % minimum
if tmp == 0:
  group = i[0] // minimum
else:
  group = (i[0] // minimum) + 1

print(group + 4)

Submission status: Accepted

Solution code:
N = int(input())
cost = [0]*5
for i in range(5):
  cost[i] = int(input())
bottleneck = sorted(cost,key = lambda x: N / x,reverse = True)
result = N // bottleneck[0]
if N % bottleneck[0] == 0:
  result -= 1
print(5+result)

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
L = [A,B,C,D,E]
L.sort()
if N%L[0] == 0:
  print(4+N//L[0])
else:
  print(5+N//L[0])

Submission status: Accepted

Solution code:
N = int(input())
info = [int(input()) for _ in range(5)]
ans = 5
small = N
info_p = []
for x in info:
    if x < small:
        info_p.append(x)
        small = x
k = -((small-N)//small)
ans += k
print(ans)

Submission status: Accepted

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

time = []
time.append(int(N/capacity_list[0])+1 if N%capacity_list[0] != 0 else int(N/capacity_list[0]))
for i in range(0,4):
    if capacity_list[i]>capacity_list[i+1]:
        time.append(int(N/capacity_list[i+1])+1 
        if N%capacity_list[i+1] != 0 
        else int(N/capacity_list[i+1]))
    else:
        time.append(1)
rate_limit = max(time)
print(rate_limit+4)

Submission status: Accepted

Solution code:
import numpy as np


def read():
    n = int(input().strip())
    capacities = np.empty((5, ), dtype=np.int64)
    for i in range(5):
        capacities[i] = int(input().strip())
    return n, capacities


def solve(n, capacities):
    n_groups = (n - 1) // np.min(capacities)
    return 5 + n_groups


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import io
import math
import re

menu_num = 5
menu_sum = 0
menu_time_divided = 9
flag_a = 0
flag_b = 0

time_info_min = 10000000000000000

data_info = input().split()
passenger_info = int(data_info[0])

for num in range(menu_num):
    data_info = input().split()
    time_info = int(data_info[0])
    if time_info < time_info_min:
        time_info_min = time_info

if time_info_min != 1:
    print( 5 + math.floor(passenger_info/time_info_min))
else:
    print( 5 + math.floor(passenger_info/time_info_min) -1)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
ABC = [int(input()) for _ in range(5)]
ABC = np.array(ABC)

check = 0
def counter(ABC, check):
    count = 0
    minABC = min(ABC)
    minidx = np.argmin(ABC)
    amari = N%minABC
    tmp = int(N/minABC) - int(amari==0)
    if check == 0:
        count = len(ABC) - minidx + tmp
    else:
        count = len(ABC) - minidx
    if minidx != 0:
        count += counter(ABC[:minidx], 1)
    return count

count = counter(ABC, 0)
print(count)

Submission status: Accepted

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

m = min(A)

if m == 1:
    times = 5 + (N - 1)
else:
    times = 5 + (N // m)

print(times)

Submission status: Accepted

Solution code:
# coding: utf-8

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

neck = min(capacity)
num_group = N // neck + (0 if N % neck == 0 else 1)
print(5 + num_group - 1)

Submission status: Accepted

Solution code:
N = int(input())
transes = list()

for _ in range(5):
    transes.append(int(input()))

print((N-1)//min(transes)+5)

Submission status: Accepted

Solution code:
#C問題
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:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
bottom=min(A,B,C,D,E)
print(4+(N+bottom-1)//bottom)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = []

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

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

Submission status: Accepted

Solution code:
import math
n = int(input())
a = list()
for i in range(5):
    a.append(int(input()))

min_a = min(a)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input().rstrip())
    S = []
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    min_s = min(S)
    if(N % min_s == 0):
        print(N//min_s -1 + 5)
    else:
        print(N//min_s + 5)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
LIST = [int(input()) for _ in range(5)]
MINval = min(LIST)

cnt = math.ceil(N / MINval)
print(cnt + 4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

def main():

    lst = []

    for line in sys.stdin:
        line = line.rstrip()
        a = int(line)
        lst.append(a)

    n = lst[0]
    a_to_e = lst[1:]

    # ボトルネック基準でやる
    bottle = min(a_to_e)

    # ボトルの場所
    ind = a_to_e.index(bottle)

    if n <= bottle:
        print(5)
        return 0

    ans = 5 + (n // bottle) - 1

    if n % bottle != 0:
        ans += 1
    print(ans)
    return 0

if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
N, trans = int(input()), [int(input()), int(input()), int(input()), int(input()), int(input())]

min_trans = min(trans)
print(int((N-1)/min_trans) + 1 + 4)

Submission status: Accepted

Solution code:
n = int(input())
a = []
su = 0
for i in range(5):
    k = int(input())
    a.append([k,-(-1*n//k)])

for i in range(5):
    if i == 0:
        su += a[i][1]
    else:
        if i + a[i][1] > su + 1:
            su = i + a[i][1]
        else:
            su += 1

print(su)

Submission status: Accepted

Solution code:
import sys
import math

N = int(sys.stdin.readline())

amount = []
for i in range(5):
    amount.append(int(sys.stdin.readline()))

min_index = 0
min_amount = amount[0]
for i in range(5):
    if min_amount > amount[i]:
        min_index = i
        min_amount = amount[i]

total_time = math.ceil(N/min_amount)
total_time += 4
print(total_time)

Submission status: Accepted

Solution code:
import math

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

limit = min(limits)

min_time = 5
min_time += math.ceil((n - limit) / limit)

print(min_time)

Submission status: Accepted

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

if N<=m:
	print 5
else:
	if N%m!=0:
		print 5+N/m
	else:
		print 5+N/m-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())
lst = [A, B, C, D, E]
mn = min(lst)
print(5+math.ceil(N / mn) - 1)

Submission status: Accepted

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

bottleneck = min(caps)

if bottleneck >= N:
    print(5)
    exit()

t_start2bn = 0
sepnum = 0
t_bn2goal = 0

for idx,item in enumerate(caps):
    if item == bottleneck:
        t_start2bn = idx
        sepnum = N // bottleneck if N % bottleneck == 0 else + N // bottleneck + 1
        t_bn2goal = 5 - idx
        print(t_start2bn + t_bn2goal + sepnum - 1)
        exit()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [tuple(map(int, l.split())) for l in sys.stdin]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = sorted([I() for _ in range(5)])
    r = (n+a[0]-1) // a[0]

    return r + 4

print(main())

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

minV = min([a, b, c, d, e])
q = int(N / minV)
r = int(N % minV)
if q != 0 and r != 0:
    print(5 + q)
elif q != 0 and r == 0:
    print(5 + q - 1)
else :
    print(5)

Submission status: Accepted

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

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

ans = 4 + n // min(lis)
if n % min(lis) is not 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
import math


def main():
    inp = [int(line)  for line in sys.stdin.readlines()]
    num = inp.pop(0)
    inp_min = min(inp)
    if inp_min >= num:
        print(5)
    else:
        a = math.ceil(num / inp_min) + 4
        print(a)


if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
N = int(input())

start = 0
end = 0

person = N

cap = [10 ** 15 + 1]

for _ in range(5) :
    cap.append(int(input()))

for i in range(1, 6) :
    person = N - (end - start) * cap[i]
    if person <= 0 :
        person = 1
    end += - (- person // cap[i])
    start += 1
print(end)

Submission status: Accepted

Solution code:
n = int(input())
mi = 10**15+1
def kiri(n):
  if n == int(n):
    return n
  else:
    return int(n)+1
for i in range(5):
  xi = int(input())
  if xi < mi:
    mi = xi
print(int(kiri(n/mi) + 4))

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

# status=np.array([n,0,0,0,0,0])
# end=np.array([0,0,0,0,0,n])
# t=0

# while (status==end).all()==False:
#     A=min(a,status[0])
#     B=min(b,status[1])
#     C=min(c,status[2])
#     D=min(d,status[3])
#     E=min(e,status[4])
#     status=status-np.array([A,B-A,C-B,D-C,E-D,-E])
#     t+=1
#     # print(status)

# print(t)

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

if n<=m:
    print(5)
else:
    if n%m==0:
        print(n//m+4)
    else:
        print(n//m+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=[n//a,n//b,n//c,n//d,n//e]
M=[a,b,c,d,e]
if L[L.index(max(L))]*M[L.index(max(L))] == n:
  print(max(L)+4)
else:
  print(max(L)+5)

Submission status: Accepted

Solution code:
import numpy as np
from math import ceil
N = int(input())
cap = np.array([int(input()) for _ in range(5)])
min_cap = cap.min()
dur = ceil(N / min_cap) + 4
print(dur)

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

list1 = [math.ceil(N/i) for i in [A,B,C,D,E]]

max_index = list1.index(max(list1))

print(max(list1) + 4)

Submission status: Accepted

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

temp = [a,b,c,d,e]
temp.sort()

ans = 0
if N > temp[0]:
    if N%temp[0]!=0:
        ans = 4 + N//temp[0] + 1
    else:
        ans = 4 + N//temp[0]
else:
    ans = 5

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

def calcu(a, b):
    if a % b == 0:
        return a//b
    else:
        return a//b + 1

ans = calcu(n, lst[0])
pace = min(n, lst[0])

for i in range(1,5):
    if pace > lst[i]:
        ans = calcu(n, lst[i]) + i
        pace = lst[i]
    else:
        ans += 1
print(ans)