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: Wrong Answer

Solution code:
#a,b,c = map(int,inpput().split(" "))
n = int(input())
#print(a,b,c)
t=[]

for i in range(5):
    t.append(int(input()))
bottle_neck = min(t)

ti = int(n/bottle_neck)
ti+=1

print(ti+4)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

n = [N,0,0,0,0,0]
time=0
def trans(i):
    if n[i] != 0:
        if m[i] > n[i]:
            n[i+1] = n[i]
            n[i] = 0
        else:
            n[i] -= m[i]
            n[i+1] = m[i]

while n[5] != N:
    for i in range(5):
        trans(i)
    time+=1

print(time)

Submission status: Wrong Answer

Solution code:
N = int(input())
ABCDE = [int(input()) for i in range(5)]
mi = min(ABCDE)
for i in range(len(ABCDE)):
    if mi == ABCDE[i]:
        index = i
        break
moved = [0 for i in range(index+1)]
moved[0] = N
time = 0
while moved[-1]<N:
    for i in range(index-1,-1,-1):
        if moved[i] < ABCDE[i]:
            moved[i+1] += moved[i]
            moved[i] = 0
        else:
            moved[i+1] += ABCDE[i]
            moved[i] -= ABCDE[i]
    time += 1
ans = N//mi+5
print(ans)

Submission status: Wrong Answer

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

ans = -(-n // people[0])
for i in range(1, 5):
    if people[i] < people[i - 1]:
        ans = max(ans, -(-n // people[i]))
    ans += 1

print(ans)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
#c
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)

Submission status: Wrong Answer

Solution code:
n, a, b, c, d, e = [int(input()) for _ in range(6)]
l = [0 for _ in range(6)]
l[0] = n
i = 0
while i < 10:
    if l[5] == n:
        break
    if l[4] != 0:
        x = l[4]
        if (x - e) < 0:
            l[5] += x
            l[4] = 0
        else:
            l[5] += e
            l[4] = x - e
    if l[3] != 0:
        x = l[3]
        if (x - d) < 0:
            l[4] += x
            l[3] = 0
        else:
            l[4] += d
            l[3] = x - d
    if l[2] != 0:
        x = l[2]
        if (x - c) < 0:
            l[3] += x
            l[2] = 0
        else:
            l[3] += c
            l[2] = x - c
    if l[1] != 0:
        x = l[1]
        if (x - b) < 0:
            l[2] += x
            l[1] = 0
        else:
            l[2] += b
            l[1] = x - b
    if l[0] != 0:
        x = l[0]
        if (x - a) < 0:
            l[1] += x
            l[0] = 0
        else:
            l[1] += a
            l[0] = x - a
    i += 1
print(i)

Submission status: Wrong Answer

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

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

b = 0
for i in a:
    if n >= i:
        b += n // i
        n = n % i
print(str(b + 5))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N=int(input())
P=[None]*5
for i in range(5):
    P[i]=int(input())

m = min(P)
if m >= N:
    print(5)
else:
    print(4+(N//m)+(N%m))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
e=[int(input()) for i in range(5)]
#print(n,e)

ans=5+n//min(e)-1+1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []

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

kaisuu = 0
last = 0

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

    if last == 0:
        kaisuu += hituyouNum
        last = hituyouNum
        continue

    if hituyouNum - last > 0:
        kaisuu += hituyouNum-last+1
    else:
        kaisuu += 1

    last = hituyouNum

print(kaisuu)

#     print("")
#     if i == 0:
#         if N % li[i] == 0:
#             kaisuu = N // li[i]
#         else:
#             kaisuu = N // li[i] + 1
#     else:
#         # もし前の部分全部見て自分より小さい数があれば + 1
#         flg = 0
#         minsuu = float("inf")
#         for j in range(i):
#             if li[j] <= li[i]:
#                 flg = 1
#                 break

#             if minsuu > li[j]:
#                 minsuu = li[j]

#         if flg == 1:
#             kaisuu += 1
#         else:
#             # もしその一番小さい数よりも小さい数が来たら
#             if N < minsuu:
#                 minsuu = N

#             if minsuu % li[i] == 0:
#                 print("a")
#                 kaisuu += N // li[i] - 1  # minsuu // li[i]
#             else:
#                 print("b")
#                 kaisuu += N // li[i]  # minsuu // li[i] + 1
#     print(kaisuu)

# print(kaisuu)

Submission status: Wrong Answer

Solution code:
idou = list()
for i in range(6):
    idou.append(int(input()))
    
counter = 0
if idou[0] <= idou[1]:
    counter += 1
else:
    counter += (idou[0]//idou[1])+1
for i in range(1,5):
    if idou[i] <= idou[i+1]:
        counter +=1
    else:
        if idou[i+1] >= idou[i-1]:
            counter +=1
        else:
            counter += (idou[i]//idou[i+1])+1
    
print(counter)

Submission status: Wrong Answer

Solution code:
_ = [int(input()) for __ in range(6)]
N = _[0]
cities = _[1:]

sorted_cities = sorted(cities)
times = (N - N % sorted_cities[0]) / sorted_cities[0] + 1
print(int(times + 4))

Submission status: Wrong Answer

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
t1 = N
t2 = 0
t3 = 0
t4 = 0
t5 = 0
t6 = 0
w = 0
while(t6 != N):
    w += 1
    if t5 > 0:
        t6 += min(t5, E)
        t5 = max(0, t5 - E)
    if t4 > 0:
        t5 += min(t4, D)
        t4 = max(0, t4 - D)
    if t3 > 0:
        t4 += min(t3, C)
        t3 = max(0, t3 - C)
    if t2 > 0:
        t3 += min(t2, B)
        t2 = max(0, t2 - B)
    if t1 > 0:
        t2 += min(t1, A)
        t1 = max(0, t1 - A)
    if t6 >= 1:
        break
print(w + int(math.ceil(t1 / t6)) + int(math.ceil(t2 / t6)) + int(math.ceil(t3 / t6)) + int(math.ceil(t4 / t6)) + int(math.ceil(t5 / t6)))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ans = 0
ans += math.ceil(N/A)
if A <= B:
  ans+=1
else:
  ans += math.ceil(N/B)-math.ceil(N/A)+1
if B <= C:
  ans+=1
else:
  ans += math.ceil(N/C)-math.ceil(N/B)+1
if C <= D:
  ans+=1
else:
  ans += math.ceil(N/D)-math.ceil(N/C)+1
if D <= E:
  ans+=1
else:
  ans += math.ceil(N/E)-math.ceil(N/D)+1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces


li = []
n = int(input())
for i in range(5):
    li.append(int(input()))
if n == min(li):
    print(5)
else:
    print(5 + n // min(li))

Submission status: Wrong Answer

Solution code:
import numpy as np

def std_input():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    return N, A, B, C, D, E


N, A, B, C, D, E = std_input()

arr = np.array((A, B, C, D, E))
ceil_arr = (np.array([np.ceil(N/A), np.ceil(N/B), np.ceil(N/C), np.ceil(N/D), np.ceil(N/E), 0]).astype(int))
diff_arr = ceil_arr[1:6] - ceil_arr[0:5]

'''
In [1]: arr
Out[1]: array([3, 2, 4, 3, 5])

In [2]: ceil_arr
Out[2]: array([2, 3, 2, 2, 1, 0])

In [3]: diff_arr
Out[3]: array([ 1, -1,  0, -1, -1])
'''



min_minute=0

for i in range(5):
    if(i==0):
        min_minute+=ceil_arr[0]
    else:
        if(diff_arr[i-1]>0):
            min_minute+=diff_arr[i-1]
        else:
            min_minute+=0

min_minute+=4

print(min_minute)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

A=[]
A.append(a)
A.append(b)
A.append(c)
A.append(d)
A.append(e)

A.sort()
m=A[0]
ans = int(n/m) + 4 + 1
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
max_ride = [int(stdin.readline().rstrip()) for _ in range(5)]

res_time = 5 + N // min(max_ride)

print(res_time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

time = 0
cnt = 0
for prev, after in [(A, B), (B, C), (C, D), (D, E), (E, 0)]:
  if prev < N:
    t = N // prev + int(N % prev > 0)
    if prev <= after:
      time += t
      N = prev
    else:
      time += t
      N = (prev - after) * (time - cnt) + after
  else:
    time += 1
  cnt += 1
print(time)

Submission status: Wrong Answer

Solution code:
import math
i = [int(input()) for i in range(6)]
m = i[1:5]
minimam = min(m)
answer = math.ceil(i[0]/minimam) + 4
print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(int(input()) for _ in range(5))
ans = 5
if N <= min(A):
    ans = 5
else:
    for i in range(5):
        if A[i] > N:
            A[i] = N
    for i in range(5):
        A[i] = (N + 1) // A[i]
    ans += max(A) - 1
print(ans)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
can_moves = []
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
cities = [N, 0, 0, 0, 0, 0]
time = 0
for t in range(1, 10**15):
  for i in reversed(range(len(cities) - 1)):
    if cities[i] != 0:
      cities[i] -= can_moves[i]
      cities[i+1] += can_moves[i]
      if cities[i] < 0:
        cities[i+1] += cities[i]
        cities[i] = 0
  if cities[-1] == N:
    time = t
    print(cities)
    break
  
# 出力
print(time)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

#print()

#print(N)
#print(T)

minT = min(T)
#print(minT)

indminT = T.index(minT)
#print(indminT)

time = 1 + indminT - 1 + (N//minT) + 1 + 5 - (indminT + 1)
print(time)

Submission status: Wrong Answer

Solution code:
n = int(input())
list=[int(input()) for i in range(5)]
d = [n,0,0,0,0]
j = 1

while d[4] < n:
  
    for i in reversed(range(4)):
        if list[i] >= d[i]:
            d[i+1] = d[i+1] + d[i]
            d[i] = 0
            
        else:
            d[i+1] = d[i+1] + list[i]
            d[i] = d[i] - list[i]
           
    j = j + 1
        
print(j)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

min_limit = np.min([a, b, c, d, e])

if n % min_limit == 0:
  wait = n/min_limit - 1
else:
  wait = n//min_limit

print(5+wait)

Submission status: Wrong Answer

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

list_t = [A,B,C,D,E]
lowest = list_t[0]

for i in range(len(list_t)):
    if lowest >= list_t[i]:
        lowest = list_t[i]
    
a = N // lowest
print(a + 5)

Submission status: Wrong Answer

Solution code:
from math import ceil
n = int(input())
ps = [int(input()) for _ in range(5)]
min_p = min(ps)
times = 0 if n % min_p == 0 else n // min_p
print(times + 5)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

l = np.array(list)

d = np.amin(l)
dm = np.argmin(l)
if dm == 4:
    print(int(n//d))
else:
    print(int(n//d+5))

Submission status: Wrong Answer

Solution code:
N = int(input())
pas = [0]*5
for i in range(5):
  pas[i] = int(input())
min_pas = min(pas)
times = N//min_pas if N!=min_pas else 0
times += 5
print(times)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
A = [int(input()) for x in range(5)]
print('A',A)
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)
print('B',B)
if cnt==5:
    print(5)
else:
    print(max(B)+4)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

def main():
	N = int(input())
	me = []
	mini = -1
	for i in range(5):
		tmp = int(input())
		me.append(tmp)
		if mini == -1 or mini > tmp:
			mini = tmp

	time = 5
	tmp = N // mini
	print(time + tmp)
	
if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
N =int(input())
l =[int(input()) for i in range(5)]
s=[N]
st=[0 for i in range(5)]
s.extend(st)
ans=0

min_num=min(l)
min_ind=l.index(min_num)

times=int(N/min_num)+1

dis=4
ans=times+dis

print(ans)

Submission status: Wrong Answer

Solution code:
ninzu = int(input())
ps = [ninzu,0,0,0,0,0]

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

rissoku = min(able)
print((ninzu//rissoku) + 5)

Submission status: Wrong Answer

Solution code:
n,*move=[int(input()) for i in range(6)]

#多分ボトルネックを超える時間数を使う
min_index=0
min_move=move[0]
for i in range(1,5):
    if min_move > move[i]:
        min_move=move[i]
        min_index=i

move_time=min_index
move_time+=int(n/min_move)+1
move_time+=5-min_index-1
print(move_time)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

l = np.array(list)

d = np.amin(l)
dm = np.argmin(l)
if dm == 4:
    print(n//d)
else:
    print(n//d+5)

Submission status: Wrong Answer

Solution code:
n = int(input())
mt = []
mt.append(int(input()))
mt.append(int(input()))
mt.append(int(input()))
mt.append(int(input()))
mt.append(int(input()))

print(5 + n // min(mt))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
A = []

A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))


neck = A.index(min(A))
ans = (math.ceil(n/min(A))+4-neck)

print(ans)

Submission status: Wrong Answer

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())
mi = 0
mA = 1e16
for i in range(0,5):
    if (A[i] < mA):
        mA = A[i]
        mi = i
ans = 0 if (N == A[mi]) else (N // A[mi])
ans += (5 - mi) + mi
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n=int(input())
d=[0 for i in range(5)]
for i in range(5):
    d[i]=int(input())

mn=999999999999
for i in range(5):
    if mn>d[i]:
        j=i
        mn=d[i]
print(4+int((n+mn-1)/mn))

Submission status: Wrong Answer

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

c = [0] * 5
for i in range(len(l)):
    if N > l[i]:
        c[i] = N - l[i]
        N = l[i]

res = 0
for i in range(5):
    if c[i] > 0:
        if i == 0:
            res += int(c[i]/l[i]) + 1
        else:
            if int(c[i]/l[i]) + 1 >= res:
                nokori = c[i] - l[i]*res
                res += int((c[i-1]+nokori)/l[i]) + 1
    

print(5+res)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
if n%a==0:
  A=1
else:
  A=int(n//a)+1
if n%b==0:
  B=1
else:
  B=int(n//b)+1
if n%c==0:
  C=1
else:
  C=int(n//c)+1
if n%d==0:
  D=1
else:
  D=int(n//d)+1
if n%e==0:
  E=1
else:
  E=int(n//e)+1
f=A
listA=[A,B,C,D,E]
for i in range(1,5):
    if listA[i-1]-1>=listA[i]:
        f=f+1
    elif listA[i-1]-1<listA[i]:
        f=f+listA[i]-listA[i-1]+1
print(f)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces


li = []
n = int(input())
for i in range(5):
    li.append(int(input()))
if n >= min(li):
    print(5)
else:
    print(5 + n // min(li))

Submission status: Wrong Answer

Solution code:
n = int(input())
list=[int(input()) for i in range(5)]
d = [n,0,0,0,0]
j = 1

while d[4] < n:
    for i in reversed(range(4)):
        if list[i] >= d[i]:
            d[i+1] = d[i+1] + d[i]
            d[i] = 0
            
        else:
            d[i+1] = d[i+1] + list[i]
            d[i] = d[i] - list[i]
           
    
        
print(j)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
abcde = [int(input()) for _ in range(5)]

time = 0
n = N

for i in range(5):
#  time += math.ceil(n / abcde[i])
  time += n // abcde[i]
  if n % abcde[i] != 0:
    time += 1
  last = n % abcde[i] # 最後の1回で移動する人数
  if last == 0:
    last = min(abcde[i], n)
#  print(n, last, time)
  if i < 4: # 次の駅でまだ残っている人数
    n = last + max((N-last) - (time-1) * abcde[i+1], 0)

print(time)

Submission status: Wrong Answer

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-5)/min_in))

Submission status: Wrong Answer

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

capa = [A,B,C,D,E]
r1 = A
r2 = min(A,B)
r3 = min(r2,C)
r4 = min(r3,D)
r5 = min(r4,E)

t = 4+N//r4+1*(N%r4!=0)

print(int(t))

Submission status: Wrong Answer

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

if n == 0:
  print(0)

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


min_capa = min(capa)


print(n//min_capa + 5)

Submission status: Wrong Answer

Solution code:
N = int(input())
pas = [0]*5
for i in range(5):
  pas[i] = int(input())
min_pas = min(pas)
times = N//min_pas
times = times if times!=1 else 0
times += 5
print(times)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(5):
    inp = int(input())
    a.append(inp)
mini = min(a)
mini_list = [i for i in range(len(a)) if a[i]==mini]
mini_no = len(mini_list)
time = int(n/mini) +1
print(time+(5-mini_no))

Submission status: Wrong Answer

Solution code:
n = int(input())
li = [int(input()) for i in range(5)]
#print(li)
mn = min(li)
#print(mn)
gn = n//mn+1
#print(gn)
print(5 if mn == n else 5+gn-1)

Submission status: Wrong Answer

Solution code:
from math import modf

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

mod = 10**9+7
d, i = modf(n/min(a,b,c,d,e))
print(max(5, int(i)+int(d*10)))

Submission status: Wrong Answer

Solution code:
import math
i = [int(input()) for i in range(6)]
m = i[1:5]
minimam = min(m)
answer = math.ceil(i[0]/minimam)
print(answer)

Submission status: Wrong Answer

Solution code:
N, A, B, C, D, E = int(input()), int(input()), int(input()), int(input()), int(
    input()), int(input())
ABC = [A, B, C, D, E]
ans = 0
push = N
count = 1
for i in range(5):
    if push <= ABC[i]:
        ans += 1
    else:
        ans += (push // ABC[i]) * count + 1
        push = ABC[i]
        count = push // ABC[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
a.sort()
add=n//a[0]
print(5+add)

Submission status: Wrong Answer

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

a = N // A + 1
b = 1
bita = 0
bkuru = A
bkita = A

c = 1
cita = 0
ckuru = B
ckita = B

d = 1
dita = 0
dkuru = C
dkita = C

e = 1
eita = 0
ekuru = D
ekita = D

if A > B:
    bita = ( A - B ) * ( a - 1 )
    bkita = N % A
    b = (bita + bkita) // B + 1
else:
    ckuru = bkuru

if ckuru > C:
    cita = ( ckuru - C ) * ( b - 1 )
    ckita = (bita + bkita) % B
    c = (cita + ckita) // C + 1
else:
    dkuru = ckuru

if dkuru > D:
    dita = ( dkuru - D ) * ( c - 1 )
    dkita = (cita + ckita) % C
    d = (dita + dkita) // D + 1
else:
    ekuru = dkuru

if ekuru > E:
    eita = ( ekuru - E ) * ( d - 1 )
    ekita = (dita + dkita) % D
    e = (eita + ekita) // E + 1

print(a+b+c+d+e)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]
cap = [read_int()[0] for _ in range(5)]

def solve():
    b_neck = cap[0]
    # b_ni = 0
    ans = 5
    for i in range(5):
        # if i == 0:
        #     wait = N // b_neck
        #     ans += wait
        if b_neck > cap[i]:
            b_neck = cap[i]
            ans += N // b_neck
            # b_ni = i
    # till_neck = b_ni
    # in_neck = N // b_neck
    # to_last = 5 - b_ni if b_ni != 4 else 0
    # ans = till_neck + in_neck + to_last
    return ans

if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
saisyo=n+a+b+c+d+e
f=1
g=1
h=1
i=1
j=1
if saisyo>a:
    f=-(-n//a)
if saisyo>b:
    g=-(-a//b)
if saisyo>c:
    h=-(-b//c)
if saisyo<d:
    i=-(-c//d)
if saisyo<e:
    j=-(-d//e)

goke=f+g+h+i+j

print(goke)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
A = []

A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))


neck = A.index(min(A))
ans = (n//min(A))+5-neck

print(ans)

Submission status: Wrong Answer

Solution code:
input_data = []
hum = int(input())
for i in range(5):
    input_data.append(int(input()))
print(5+int(hum/min(input_data)))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(5 + int(n/x))

Submission status: Wrong Answer

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[]
for i in range(5):
    data.append(int(input()))
    
ans=(N//sorted(data)[0])+5
if set(data)=={N}:
    ans=5
flag=0
for j in data:
    if j < N:
        flag=1
if flag==1:
    print(ans)
else:
    print(5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for number in numbers:
    if number < N:
        flag = False
        
if flag:
    print(5)

else:
    print(N // 2 + 5)

Submission status: Wrong Answer

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

sub = [a,b,c,d,e]
city = [N,0,0,0,0,0]
time = 0

def sub_h(h, num):
    if h - num <= 0:
        return 0
    else:
        return h-num

def add_h(h, num):
    return h+num

while not (city[0] == 0 and city[1] == 0 and city[2] == 0 and city[3] == 0 and city[4] == 0):
    time+=1
    city_copy = city.copy()
    print(city)
    for i in range(len(sub)):
        if city_copy[i] == 0:
            trans = 0
        elif city_copy[i] - sub[i] <= 0:
            trans = city_copy[i]
        else:
            trans = sub[i]
        city[i] -= trans
        city[i+1] += trans
print(time)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

if n <= min(array): print(5)
else: print(5 + (n//min(array)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import itertools

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

print(N // min(cap) + 5)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = [int(input()) for i in range(5)]
#print(li)
mn = min(li)
#print(mn)
gn = n//mn+1
#print(gn)
print(5+gn-1 if mn != n else 5)

Submission status: Wrong Answer

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:
        B.append(int(n/A[i])+1)
if cnt==5:
    print(5)
else:
    print(max(B)+4)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [int(input()) for i in range(5)]
tmp = 0
for i in range(5):
  if l[i] > N:
    tmp = 1
if tmp == 1:
  print(5)
else:
  ans = 0
  ans += (N//min(l))+1
  ans += 5-l.index(min(l))
  if l.index(min(l))==0 or  l.index(min(l))==4:
    ans-=1
  print(ans)

Submission status: Wrong Answer

Solution code:
a=[int(input()) for _ in range(6)]
analMEGA =min(a[1],a[2],a[3],a[4],a[5])
print(5 + a[0] // analMEGA -1 if analMEGA %2 == 0 and a[0] % 2 == 0 else 5 + a[0] // analMEGA)

Submission status: Wrong Answer

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

flag=True
for i in A:
  if i<n:
    flag=False
if flag==True:
  print(5)
  exit()
ans=0
for a in A:
  if n>a:
    ans+=(n//a if n%a else n//a-1)
    n=a
print(ans+5)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(input())for _ in range(5)]
i=A.index(min(A))
ans=0
m=5-i
for i in range(i+1):
     ans+=N//A[i]
print(ans+m)

Submission status: Wrong Answer

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 + 5

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n=int(input())
d=[0 for i in range(5)]
for i in range(5):
    d[i]=int(input())
j=0
mn=999999999999
for i in range(5):
    if mn>d[i]:
        j=i
        mn=d[i]
print(5+max(max(int((n-1)/mn),0),int((n-d[0])/d[0])))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[]
for i in range(5):
    b=int(input())
    a.append(b)
a.sort()
if n<=a[0]:
    print("5")
    exit()
    
b=int(n/a[0])

print(b+5)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

if n >= min(array): print(5)
else: print(5 + (n//min(array)))

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
n = int(input())
inputs = [0,0,0,0,0]
inputs[0] = int(input())

inputs[1] = int(input())

inputs[2] = int(input())

inputs[3] = int(input())

inputs[4] = int(input())

posi = [n,0,0,0,0,0]

it = 0
while True:
	for i in range(1,6):
		j = 5 - i
		if posi[j] >= inputs[j]:
			posi[j] = posi[j] - inputs[j]
			posi[j+1] = posi[j+1] + inputs[j]
		else:
			posi[j+1] = posi[j+1] + posi[j]
			posi[j] = 0
	#print(posi)
	it = it + 1
	if posi[5] == n:
		break
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

minit=min(a,b,c,d,e)
print(int(n/minit)+5)