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:
from sys import stdin

n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(5)]
lin = [n]+[0]*6

top_time = 5
biri_kai = n // min(li)

total_time = top_time + biri_kai
print(total_time)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
list1 = []
for i in range(5):
	list1.append(int(input()))
flag = 0 #A<B<C<D<Eの時、コーナーケースとなる
count = 0
for i in range(4):
        if list1[i] > list1[i+1]:
                count += math.ceil(n/list1[i+1])
                flag = 1
        else:
                count += 1
if not flag:
        count = 0
        count += math.ceil(n/list1[0])
        count += 4
print(count)

Submission status: Wrong Answer

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

def main():
    N = int(input())
    A = []
    for _ in range(5):
        A.append(int(input()))

    mi = min(A)
    print(5 + N // mi)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 5 + N//min(X)

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

p = [a, b, c, d, e]
print(n//min(p)+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())

p = [a, b, c, d, e]
n//min(p)+5

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ride = [0] * 5
for i in range(5):
	ride[i] = int(input())
 
narrow = min(ride)

if N != narrow:
	minuites = N // narrow + 5
else:minuites = N // narrow + 6
  
print(minuites)

Submission status: Wrong Answer

Solution code:
N = int(input())
ride = [0] * 5
for i in range(5):
	ride[i] = int(input())
 
narrow = min(ride)
if N != narrow:
	minuites = N // narrow + 5
else:minuites = N // narrow + 4
  
print(minuites)

Submission status: Wrong Answer

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


narrow = min(ride)

minuites = N // narrow + 5

print(minuites)

Submission status: Wrong Answer

Solution code:
N = int(input())
ride = [0] * 6
for i in range(5):
	ride[i] = int(input())

city = [0] * 6
city[0] = N

minuites = 0

while city[5] != N:
	for i in range(5)[::-1]:
		print(city[i + 1],city[i],ride[i])
		city[i + 1] = min(city[i],ride[i]) + city[i + 1]
		city[i] = city[i] - min(city[i],ride[i])
	minuites += 1

	
print(minuites)

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 = min(A,B,C,D,E)
time = 5 + N // a
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())

a = min(A,B,C,D,E)
time = 5 + int(N / a)
print(time)

Submission status: Wrong Answer

Solution code:
import heapq 

N = int(input())
transport = list(int(input()) for _ in range(5))
#heapq.heapify(transport)

#min_trans  = heapq.heappop(transport)
min_trans  = min(transport)
#print(transport)
#print(min_trans)

print(N // min_trans + 5 if N != min_trans else 5)

Submission status: Wrong Answer

Solution code:
import heapq 

N = int(input())
transport = list(int(input()) for _ in range(5))
#heapq.heapify(transport)

#min_trans  = heapq.heappop(transport)
min_trans  = min(transport)
#print(transport)
#print(min_trans)

print(N // min_trans + 5)

Submission status: Wrong Answer

Solution code:
import heapq 

N = int(input())
transport = list(int(input()) for _ in range(5))
heapq.heapify(transport)

min_trans  = heapq.heappop(transport)
#print(transport)
#print(min_trans)

print(N // min_trans + 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,*l=map(int,open(0))
print(n//min(l)+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

num=[n]+num
print(num)
cnt=0
min_carry=num[0]
for i in range(5-1):
    min_carry=min(min_carry,num[i])
    cnt+=min_carry//num[1]+1
    
print(cnt+1)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
cap = [int(input()) for i in range(5)]
cap.sort()
print(math.ceil(n/cap[0]) + 5)

Submission status: Wrong Answer

Solution code:
N=int(input())
rissoku=10**9

for _ in range(5):
    rissoku=min(rissoku,int(input()))

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

Submission status: Wrong Answer

Solution code:
N=int(input())
rissoku=10**9

for _ in range(5):
    rissoku=min(rissoku,int(input()))

print((N//rissoku)+5)

Submission status: Wrong Answer

Solution code:
#2019/10/04
N, A, B, C, D, E = list(map(int, open(0).read().split()))
# print(N)
print(-~(N//min(A,B,C,D,E)) + 5)

Submission status: Wrong Answer

Solution code:
#2019/10/04
N, A, B, C, D, E = list(map(int, open(0).read().split()))
print(N//min(A,B,C,D,E) + 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
lst=[0]*6
for i in range(6):
  lst[i]=int(input())
  
N=lst.pop(0)
m=min(lst)
if m<N:
  v1,v2=N//m,N%m
  print(5+v1+v2-1)
else:
  print(5)

Submission status: Wrong Answer

Solution code:
N = int(input())
tran = [int(input()) for _ in range(5)]
num = [N,0,0,0,0,0]
mint = min(tran)
ans = N//mint +5
print(ans)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for _ in [0]*5]
B = [-(-a//10)*10 - a for a in A]
print(sum(B) + sum(A) - max(B))

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
from math import ceil

c = []
n = int(input())
for _ in range(5):
    c.append(int(input()))
    
time = ceil(n/c[0])
for i in range(1, 5):
    if c[i] >= c[i-1]:
        time += 1
    else:
        time += ceil(n/c[i]) - ceil(n/c[i-1]) + 1

print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

min_move = min(move)

print((n//min_move) + 5)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
a = [int(input()) for _ in range(5)]
t = 0
if n > min(a):
    t += math.ceil(n/min(a))
    t += 5 - a.index(min(a))
else:
    t += 5
    
print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from math import ceil
count=0
n=int(input())
bus=[int(input()) for i in range(5)]
cur=n
for i in range(5):
    a=ceil(cur/bus[i])
    if i!=4:
        ne=max((a-1)*(bus[i]-bus[i+1]),0)
        cur=ne+min(bus[i],cur)
    count+=a
print(count)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from math import ceil
count=0
n=int(input())
bus=[int(input()) for i in range(5)]
cur=n
for i in range(5):
    a=ceil(cur/bus[0])
    if i!=4:
        ne=max((a-1)*(bus[i]-bus[i+1]),0)
        cur=ne+min(bus[i],cur)
    count+=a
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = float('inf')
for i in range(5):
    m = int(input())
    num = min(num, m)
print((n//num) + 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

min_persons = min(persons)
if N == min_persons:
    print(N // min_persons + 4)
else:
    print(N // min_persons + 5)

Submission status: Wrong Answer

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

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

min_persons = min(persons)
print(N // min_persons +5)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
N = Decimal(input())
A = Decimal(input())
B = Decimal(input())
C = Decimal(input())
D = Decimal(input())
E = Decimal(input())
print(N//min(A,B,C,D,E)+5)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
N = Decimal(input())
A = Decimal(input())
B = Decimal(input())
C = Decimal(input())
D = Decimal(input())
E = Decimal(input())
print(int(N/min(A,B,C,D,E))+5)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
N = Decimal(input())
A = Decimal(input())
B = Decimal(input())
C = Decimal(input())
D = Decimal(input())
E = Decimal(input())
print(Decimal(N/min(A,B,C,D,E))+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
tn= 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(tn //f + 5)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0 for i in range(5)]
for i in range(5):
    L[i] = int(input())
    
time = [0 for i in range(5)]
time[0] = (N-1)//L[0] + 1
for i in range(4):
    time[i+1] = (N-1)//L[i+1] + 1
        
ans = time[0]
for i in range(4):
    if time[i] >= time[i+1]:
        ans += 1
    else:
        ans += (time[i+1]-time[i]+1)
        
print(ans,time)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0 for i in range(5)]
for i in range(5):
    L[i] = int(input())
    
ans = (N-1)//L[0] + 1
for i in range(4):
    if L[i] <= L[i+1]:
        ans += 1
    else:
        ans += (N-1)//L[i+1] - (N-1)//L[i] + 1
        
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0 for i in range(5)]
for i in range(5):
    L[i] = int(input())
    
time = [0 for i in range(5)]
time[0] = (N-1)//L[0] + 1
for i in range(4):
    if L[i] <= L[i+1]:
        time[i+1] = time[i]
    else:
        time[i+1] = (N-1)//L[i+1] + 1
        
ans = time[0]
for i in range(4):
    if time[i] >= time[i+1]:
        ans += 1
    else:
        ans += (time[i+1]-time[i]+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())

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

Submission status: Wrong Answer

Solution code:
n=int(input())
t=[0,0,0,0,0]
for i in range(5):
  t[i]=int(input())
print(5+(n//min(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())
chi=min([a,b,c,d,e])
answer=(n//chi)+5
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#C - Five Transportations 
N=int(input())
b=int(input())
X=[b]
for i in range(4):
    a=int(input())
    if b>a:
        X.append(a)
ans=4
if N%X[-1]>0:
    ans+=N//X[-1]+1
else:
    ans+=N//X[-1]
print(ans)

Submission status: Wrong Answer

Solution code:
#C - Five Transportations 
N=int(input())
b=int(input())
X=[b]
for i in range(4):
    a=int(input())
    if b>a:
        X.append(a)
ans=4
ans+=N//X[-1]+1
print(ans)

Submission status: Wrong Answer

Solution code:
# train : 1 -> 2, 1m, A
# bus : 2 -> 3, 1m, B 
# taxi : 3 -> 4, 1m, C
# airplane : 4 -> 5, 1m, D
# ship : 5 -> 6, 1m, E

N = int(input())
transportation_facilities_num = [int(input()) for _ in range(5)]
min_num = min(transportation_facilities_num)

ans = N//min_num + 1
ans += 4

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())
print((max(n//a+1, n//b+1, n//c+1, n//d+1, n//e+1)) + 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())
print((max(n//a, n//b, n//c, n//d, n//e)) + 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())
print((n//min(a, b+1, c+2, d+3, e+4)) + 5)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
print((n//a) + 5)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

Submission status: Wrong Answer

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

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

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

if min(A, B, C, D, E) == A:
    print(N // A + 1 + 4)
elif min(A, B, C, D, E) == B:
    print(N // B + 1 + 3)
elif min(A, B, C, D, E) == C:
    print(N // C + 1 + 2)
elif min(A, B, C, D, E) == D:
    print(N // D + 1 + 1)
elif min(A, B, C, D, E) == E:
    print(N // E + 1)

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left
from math import factorial


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n = I()
L = IR(5)
print(5 + n // min(L))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n, a, b, c, d, e = [int(input()) for i in range(6)]
m = min(a, b, c, d, e)

print(math.ceil(n // m) + 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())

bus=[a,b,c,d,e]
minbus=min(bus)
print(n//minbus+5)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(5):
    if i ==0:
        min_a = int(input())
    else:
        a = int(input())
        min_a = min(min_a,a)
print(n//min_a+5)

Submission status: Wrong Answer

Solution code:
L=[int(input()) for i in range(6)]
m=L[0]
c=0
for i in range(1,6):
  c+=-(-m//L[i])
  m=min(m,L[i])
print(c)

Submission status: Wrong Answer

Solution code:
L=[int(input()) for i in range(6)]
m=L[0]
c=0
for i in range(5):
  c+=-(-m//L[i])
  m=min(m,L[i])
print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
a= [int(input()) for _ in range(5)]
count = 5
count2 = n
for i in range(0,5):
    b = -(-count2 // a[i]) -1
    count2 = count2 - max(0,count2-a[i])
    if b > 0:
        count += b
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a= [int(input()) for _ in range(5)]
count = 5
count2 = n
for i in range(0,5):
    b = -(-count2 // a[i]) -1
    print(b)
    count2 = count2 - max(0,count2-a[i])
    if b > 0:
        count += b
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = floor(N/min(A)) + 5

print(ans)

Submission status: Wrong Answer

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

move = min(ride)

import math

print(math.ceil(n/move) + 5)

Submission status: Wrong Answer

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

move = min(ride)

import math

print(math.ceil(n//move) + 5)

Submission status: Wrong Answer

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

move = min(ride)
print(n//move + 5)

Submission status: Wrong Answer

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

ans = 0
for i in range(1,len(a)):
    if a[i-1] < a[i]:
        a[i] = a[i-1]
    ans += math.ceil(a[i-1] / a[i])
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())

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

ans = 5+(N//min_cap)
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
t =[0]*5
for i in range(5):
  t[i]=int(input())
  
min_t = min(t)
ans= N / min_t + 4

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
for i in range(5):
    time = -(-L[i]//A[i])
    ans += time
    L[i], L[i+1] = 0, L[i]
    for j in range(i+1, 5):
        time = max(time-1, 0)
        saigo = A[j-1] if L[j] % A[j-1] == 0 else L[j] % A[j-1]
        mem = L[j] - saigo
        L[j], L[j+1] = saigo + mem - min(mem, time*A[j]), min(mem, time*A[j])

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,*city = [int(input()) for _ in range(6)]
print(5+n//min(city))

Submission status: Wrong Answer

Solution code:
N=input()
A=input()
B=input()
C=input()
D=input()
E=input()
N=int(N)
A=int(A)
B=int(B)
C=int(C)
D=int(D)
E=int(E)
a=N//A
b=N//B
c=N//C
d=N//D
e=N//E
f=max(a,b,c,d,e)
if A>=B>=C>=D>=E:
    print(f+4)
else:
    print(f+5)

Submission status: Wrong Answer

Solution code:
X=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
A=[a,b,c,d,e]
if a==b and a==c and a==d and a==e and X>=a:
    print(X//min(A)+4)
else:
    print(X//min(A)+5)

Submission status: Wrong Answer

Solution code:
N=input()
A=input()
B=input()
C=input()
D=input()
E=input()
N=int(N)
A=int(A)
B=int(B)
C=int(C)
D=int(D)
E=int(E)
a=N//A
b=N//B
c=N//C
d=N//D
e=N//E
f=max(a,b,c,d,e)
if a==b==c==d==e:
    print(f+4)
else:
    print(f+5)

Submission status: Wrong Answer

Solution code:
N=input()
A=input()
B=input()
C=input()
D=input()
E=input()
N=int(N)
A=int(A)
B=int(B)
C=int(C)
D=int(D)
E=int(E)
a=N//A
b=N//B
c=N//C
d=N//D
e=N//E
f=max(a,b,c,d,e)
print(f+5)

Submission status: Wrong Answer

Solution code:
X=int(input())
A=[int(input()),int(input()),int(input()),int(input()),int(input())]
print(X//min(A)+5)

Submission status: Wrong Answer

Solution code:
N=input()
a=input()
b=input()
c=input()
d=input()
e=input()
N=int(N)
a=int(a)
b=int(b)
c=int(c)
d=int(d)
e=int(e)
x=min(a,b,c,d,e)
print(N//x+5)

Submission status: Wrong Answer

Solution code:
N = int(input())
list = list(int(input())for i in range(5))
ans = N//(min(list))+5
if N%min(list) == 0:
    ans -=1 
if min(list) < N:
    ans = 5
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
list = list(int(input())for i in range(5))
ans = N//(min(list))+5
if min(list) < N:
    ans = 5
print(ans)

Submission status: Wrong Answer

Solution code:
n,a,b,c,d,e = (int(input()) for _ in range(6))
one=n
two=0
three=0
four=0
five=0
six=0
count=0
while six!=n:
  count+=1
  if ((five==0 and count==1) or five>0) and count>=5:
    if five>=e:
      five=five-e
      six+=e
    else:
      six+=five
      five=0
  if ((four==0 and count==1) or four>0) and count>=4:
    if four>=d:
      four=four-d
      five+=d
    else:
      five+=four
      four=0
  if ((three==0 and count==1) or three>0) and count>=3:
    if three>=c:
      three=three-c
      four+=c
    else:
      four+=three
      three=0
  if ((two==0 and count==1) or two>0) and count>=2:
    if two>=b:
      two=two-b
      three+=b
    else:
      three+=two
      two=0
  if one>0:
    if one>=a:
      one=one-a
      two+=a
    else:
      two+=one
      one=0
  else:pass
  print(one,two,three,four,five,six)
print(count)

Submission status: Wrong Answer

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

dp = [0] * 6
dp[0] = N
T = [A,B,C,D,E]
ans = 0

ans = -~(N//min(T)) + 4
# while dp[5] < N:
#     for i in range(4, -1, -1):
#         if dp[i] == 0:
#             continue
#         dp[i+1] += min(dp[i],T[i])
#         dp[i] -= min(dp[i],T[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())

dp = [0] * 6
dp[0] = N
T = [A,B,C,D,E]
ans = 0

ans = -~N//min(T) + 4
# while dp[5] < N:
#     for i in range(4, -1, -1):
#         if dp[i] == 0:
#             continue
#         dp[i+1] += min(dp[i],T[i])
#         dp[i] -= min(dp[i],T[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())

dp = [0] * 6
dp[0] = N
T = [A,B,C,D,E]
ans = 0

ans = N//min(T) + 5
# while dp[5] < N:
#     for i in range(4, -1, -1):
#         if dp[i] == 0:
#             continue
#         dp[i+1] += min(dp[i],T[i])
#         dp[i] -= min(dp[i],T[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())

m = min(a,b,c,d,e)
n2 = (n // m) + 1
time = 5 + (n2-1)
print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = [int(input()) for i in range(6)]
n = s[0]
a,b,c,d,e = s[1],s[2],s[3],s[4],s[5]
m = min(a,b,c,d,e)
ans = 5 + n//m
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
transpotation = []
for _ in range(5):
    transpotation.append(int(input()))
a = min(transpotation)
b = n // a
ans = 5 + b
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC 123 c
n = int(input())
A = [int(input()) for i in range(5)]

if all([a >= n for a in A]):
    print(5)
else:
    x = min(A)
    print(n // x + 1 + 4)

Submission status: Wrong Answer

Solution code:
# ABC 123 c
n = int(input())
A = [int(input()) for i in range(5)]

x = min(A)
print(n // x + 1 + 4)

Submission status: Wrong Answer

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

ans = 0
if n % min(trans) == 0:
    ans = 5
else:
    ans = n//min(trans)+5

print(ans)

Submission status: Wrong Answer

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

ans = 0
if n == min(trans):
    ans = 5
else:
    ans = n//min(trans)+5

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ABC = [0]*5
for i in range(5):
  ABC[i] = int(input())
  
Amin = min(ABC)

if N%Amin ==0:
  ans = N//2-1+5
else:
  ans = N//2+5

print(ans)

Submission status: Wrong Answer

Solution code:
import math,fractions
from collections import Counter
n,a,b,c,d,e = [int(input()) for i in range(6)]
print(n//min(a,b,c,d,e)+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())

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

Submission status: Wrong Answer

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

n = int(input())
m = [0]*6
m[0] = n

a = []
for i in range(5):
    a.append(int(input()))
bn = min(a)
bi = a.index(bn)

t = 0
while m[5] == 0:
    for i in range(5,-1,-1):
        if i < 5 and m[i] > 0:
            x = min(a[i], m[i])
            m[i] -= x
            m[i+1] += x
    t += 1

import math
x = math.ceil(m[bi]/bn)
if m[bi] % bn == 0:
    x += 1
if x < 0:
    x = 0

ri = 0
for i in range(len(m)):
    if m[i] != 0:
        ri = 5-i
        break

ans = t + x + ri -1
print(ans)

Submission status: Wrong Answer

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

n = int(input())
m = [0]*6
m[0] = n

a = []
for i in range(5):
    a.append(int(input()))
bn = min(a)
bi = a.index(bn)

t = 0
while m[5] == 0:
    for i in range(5,-1,-1):
        if i < 5 and m[i] > 0:
            x = min(a[i], m[i])
            m[i] -= x
            m[i+1] += x
    t += 1
ri = 0
for i in range(len(m)):
   if m[i] != 0:
        ri = 5-i
        break
ans = t + max(0, n-t*bn)//bn + ri
print(ans)

Submission status: Wrong Answer

Solution code:
s = [int(input()) for _ in range(6)]
ans = 5

for i in range(5):
    if s[0] <= s[1]:
        print(ans)
        break
    elif s[0] <= sum(s[1:i+1]):
        ans += i
        print(ans)
        break
    else:
        num = 10
        ans2 = 10
        while s[0] - sum(s) - num <= 0:
            num += s[5] 
            ans2 += 1
        print(ans2)

Submission status: Wrong Answer

Solution code:
lis = [int(input()) for _ in range(6)]
if lis[0] % min(lis[1:]) == 0:
  print(5)
else:
  print(lis[0]//min(lis[1:])+5)

Submission status: Wrong Answer

Solution code:
lis = [int(input()) for _ in range(6)]
if lis[0]/min(lis[1:]) == 1:
  print(5)
else:
  print(lis[0]//min(lis[1:])+5)

Submission status: Wrong Answer

Solution code:
lis = [int(input()) for _ in range(6)]
print(lis[0]//min(lis[1:])+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

minimum = float(min(l))

ans = float(n // minimum + 5)

print(int(ans))

Submission status: Wrong Answer

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

minimum = float(min(l))

ans = float(n // minimum + 5)

print(ans)