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:
N = int(input())
x = [int(input()) for i in range(5)]
ans = [0]*5
ans[0] =  N//x[0]+1
for i in range(1,5):
    if x[i] == min(x[i:]):
        ans[i] = 1
        break
    else:
        ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1

for i in range(1, 5):
    if ans[i] == 0:
        ans[i] = 1

print(sum(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
x = [int(input()) for i in range(5)]
ans = [0]*5
ans[0] =  N//x[0]+1
for i in range(1,5):
    if x[i] == min(x[i:]):
        ans[i] = 1
    else:
        ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1

print(sum(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
x = [int(input()) for i in range(5)]
ans = 5
ans += N//x[0]
for i in range(5):
    if x[i] == min(x[i:]):
        break
    else:
        ans += x[i-1]//x[i]

print(ans)

Submission status: Wrong Answer

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

print(N // mini + 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())
x=min(a,b,c,d,e)
if n%x==0:
    y=n/x-1
else:
    y=n//x
print(5+y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def timeToDestination(N, t):
  if min(t) % N == 0:
    return 4 + (N // min(t))
  return 5 + (N // min(t))
  
print(timeToDestination(N, transport))

Submission status: Wrong Answer

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

def timeToDestination(N, t):
  if min(t) >= N:
    return 5
  return 5 + (N // min(t))
  
print(timeToDestination(N, transport))

Submission status: Wrong Answer

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

def timeToDestination(N, t):
  if min(t) == N:
    return 5
  return 5 + (N // min(t))
  
print(timeToDestination(N, transport))

Submission status: Wrong Answer

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

def timeToDestination(N, t):
  return 5 + (N // min(t))
  
print(timeToDestination(N, transport))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(n, traffic_list):
    min_val = min(traffic_list)
    if n % min_val:
        return n // min_val + len(traffic_list) - 1
    else:
        return n // min_val + len(traffic_list)


def main():
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    ans = solve(n, [a, b, c, d, e])
    print(ans)


main()

Submission status: Wrong Answer

Solution code:
def solve(n, traffic_list):
    min_val = min(traffic_list)

    if n <= min_val:
        return len(traffic_list)
    else:
        return n // min_val + len(traffic_list)


def main():
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    ans = solve(n, [a, b, c, d, e])
    print(ans)


main()

Submission status: Wrong Answer

Solution code:
def solve(n, traffic_list):
    min_val = min(traffic_list)
    return n // min_val + len(traffic_list)


def main():
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    ans = solve(n, [a, b, c, d, e])
    print(ans)


main()

Submission status: Wrong Answer

Solution code:
li=[]

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

min=10**15+1

for i in li:
    if i<min:
        min=i

plus=0
if n%min==0:
    plus=n/min
else:
    plus=(n/min)+n%min

#print(plus)
ans=5+plus-1

if n<min:
    print(5)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N = 6 #入力する数
a = [] #aに格納する
sum = 0 #宣言

for i in range(N):
    a.append(int(input()))
print(5+a[0]//(min(a[1],a[2],a[3],a[4],a[5])))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = 6 #入力する数
a = [] #aに格納する
sum = 0 #宣言

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

print(int(max(a[0]/a[1],a[0]/a[2],a[0]/a[3],a[0]/a[4],a[0]/a[5])+5))

'''
min = a[1]#適当に宣言
for i in range(N-1):
    if min > a[i+1]:
        min = a[i+1]
print(int(a[0]/min+ 5))
'''

Submission status: Wrong Answer

Solution code:
N = int(input())
transport_list = []
for i in range(5):
    transport_list.append(int(input()))
transport_list.sort()
if N > transport_list[0]:
    N_times = int(N / transport_list[0]) + 1
else:
    N_times = 1
print(N_times+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())
ans=5+n//(min(a,b,c,d,e))
if n == min(a,b,c,d,e):
  ans -= 1
  print(ans)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
transport_list = []
for i in range(5):
    transport_list.append(int(input()))
transport_list.sort()
if N > transport_list[0]:
    N_times = int(N / transport_list[0])
else:
    N_times = 1
print(N_times+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())
s=n//(min(a,b,c,d,e))
if n==min(a,b,c,d,e):
  print(5)
else:
  print(5+s)

Submission status: Wrong Answer

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

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(5+int(N//mi))

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('5')
else:
    print(5+int(N//mi))

Submission status: Wrong Answer

Solution code:
def transport(n,a,b,c,d,e):
    s = [a,b,c,d,e]
    x = min(s)
    return 5+1/x*(n-1)
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(transport(n,a,b,c,d,e))

Submission status: Wrong Answer

Solution code:
def transport(n,a,b,c,d,e):
    s = [a,b,c,d,e]
    x = min(s)
    return 5+int((n-x)/x+1)
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(transport(n,a,b,c,d,e))

Submission status: Wrong Answer

Solution code:
# TODO C - Five Transportations
# https://atcoder.jp/contests/abc123/tasks/abc123_c

NUM_TRANSPORTATIONS = 5
N = int(input())

min_t = float("inf")

for t in range(NUM_TRANSPORTATIONS):
    tt = int(input())
    if tt < min_t:
        min_t = tt

print "{}".format(N/min_t + 5)

Submission status: Wrong Answer

Solution code:
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
n =int(input())
sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)
z = 4
if n % min(sample_list) == 0:
  x = n // min(sample_list)
  print(z + x)
else:
  y = n // min(sample_list)
  print(z + y + 1)

Submission status: Wrong Answer

Solution code:
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
n =int(input())
sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)
z = 4
if n % min(sample_list) == 0:
  x = n % min(sample_list)
  print(z + x)
else:
  y = n // min(sample_list)
  print(z + y + 1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！

#import re

people_num = int(input())

Transport_list = [0 for i in range(0,5)]
for i in range(5):
    Transport_list[i] = int(input())

bottle_nec = min(Transport_list)

print(people_num//bottle_nec + 1 + 4)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

lmin = min(l)

ans = n // lmin + 1 + 4

print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
num = [int(input()) for i in range(5)]
if min(num)>=n:
    print(5)

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
num = [int(input()) for i in range(5)]
if min(num)>=n:
    print(5)

print(int(4+math.ceil(n/min(num))))

Submission status: Wrong Answer

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

bottleneck = min([A,B,C,D,E])
time = int(N/bottleneck + 5)

print(time)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

#N = 20
#A,B,C,D,E = (np.random.randint(1, 20, 5))

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


people_1 = []
people_2 = []
people_3 = []
people_4 = []
people_5 = []
people_6 = []

time = 0

for i in range(N):
    people_1.append(i)

while len(people_6) != N:
    time += 1
    for i in range(A):
        if people_1 != []:
            people_2.append(people_1.pop())
        
    for i in range(B):
        if people_2 != []:
            people_3.append(people_2.pop())
    
    for i in range(C):
        if people_3 != []:
            people_4.append(people_3.pop())
    
    for i in range(D):
        if people_4 != []:
            people_5.append(people_4.pop())
            
    for i in range(E):
        if people_5 != []:
            people_6.append(people_5.pop())

print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=[int(input()) for _ in range(5)]
arr=sorted(arr)
print(int(n/arr[0])+4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = [int(input()) for _ in range(5)]
mn = min(arr)
print(N // mn + 5)

Submission status: Wrong Answer

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

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

Lmin = min(L)
ans = (N+Lmin)//Lmin + 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())

groups = [N, 0, 0, 0, 0, 0]
capacities = [A, B, C, D, E]

def getNewPeople(oldGroups, newGroups, capacities, idx):
	if oldGroups[idx + 0] < capacities[idx]:
		newGroups[idx + 1] += oldGroups[idx + 0]
	else:
		newGroups[idx + 0] += oldGroups[idx + 0] - capacities[idx]
		newGroups[idx + 1] += capacities[idx]
	return newGroups

day = 0
while groups[5] != N:
	day += 1
	
	oldGroups = groups
	newGroups = [0, 0, 0, 0, 0, 0]
	for idx in range(0,5):
		newGroups = getNewPeople(oldGroups, newGroups, capacities, idx)
	newGroups[5] += oldGroups[5]
	
	groups = newGroups
	print(groups)
	
	if groups[5] == N:
		print(day)
		break

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil

info = [int(input()) for i in range(6)]
listdesu = []
for i in range(1,6):
  listdesu.append(ceil(info[0]/info[i]))
print(max(listdesu))

Submission status: Wrong Answer

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

timer = int(int(n)/min(trans))+5

print(timer)

Submission status: Wrong Answer

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

timer = 0
p = int(n)

for j, time in enumerate(trans):
    penalty = 0
    if p > time:
        penalty = int(p/time)
        p = time

    timer += 1 + penalty

print(timer)

Submission status: Wrong Answer

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

print((n - 1) // min(a) + 6)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = min([A,B,C,D,E])
T = int(1.0*N/1.0*F + 0.5) + 4
print(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())
F = min([A,B,C,D,E])
T = int(N/F + 1)
print(T + 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())
F = min([A,B,C,D,E])
T = int(N/F + 0.5)
print(T + 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())
F = min([A,B,C,D,E])
T = int(N/F+0.5)
print(T + 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())
F = min([A,B,C,D,E])
T = int(N/F)
print(T + 5)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
nums = [int(input()) for i in range(5)]

print(math.ceil(N-min(nums))+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) + 5)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
a = []
for i in range(5):
    inp = int(input())
    a.append(inp)
mini = min(a)
time = np.ceil(n/mini)
print(time+4)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
a = []
for i in range(5):
    inp = int(input())
    a.append(inp)
mini = min(a)
time = np.ceil(int(n/mini))
print(time+4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(input()) for i in range(5)]
l_min = min(l)
s = l.index(l_min)
t = n // l_min
ans = s + t + 4
if ans >= 5:
  print(ans)
else:
  print(5)

Submission status: Wrong Answer

Solution code:
ss=int(input())
rec=0
for i in range(5):
    t=int(input())
    if t>=ss:
        continue
    rec=max(rec,ss//t)
print(rec+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())

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

print(h)

Submission status: Wrong Answer

Solution code:
import numpy as np
#int(input())
n=10000000007
ae=np.array([2,3,5,7,11])
min_ae=min(ae)
num_ae=-(-n//ae)-1
#num_ae=-(-ae//min_ae)
print(5+max(num_ae))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

min_num = min(capa_list)
min_index = capa_list.index(min(capa_list))

hoge = 0 if n%min_num == 0 else 1

t = (min_index) + (n//min_num + hoge) + (len(capa_list[min_num:]))
print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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]
#print(lis)
mini=min(lis)
#print(mini)
count=5
if N<=mini:
    print(count)
#count=5
else:
    count+=N//mini
    #print(N%mini)
    print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
time = 0
before = 10 ** 15 + 1
for i in range(5):
    m = int(input())
    if m < before:
        time = (n + m -1) // m + i
    else:
        time += 1
    before = m

print(time)

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

ns = [int(i) for i in sys.stdin.read().split('\n') if i != '']
n = ns[0]
ns = ns[1:]
m = min(ns)

ans = n // m + 5
print(ans)

Submission status: Wrong Answer

Solution code:
inputs = [int(raw_input()) for i in range(6)]
bn = min(inputs[1:])
print inputs[0] / bn + 5

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a = int(input())
ar = []
for i in range(5):
    l = int(input())
    ar.append(l)
if min(ar) >= a:
    print(5)
else:
    print(math.ceil(a // (min(ar)))+ 5)

Submission status: Wrong Answer

Solution code:
a = int(input())
ar = []
for i in range(5):
    l = int(input())
    ar.append(l)
if min(ar) >= a:
    print(5)
else:
    print(a // (min(ar))+ 5)

Submission status: Wrong Answer

Solution code:
import math

input_num = [int(input()) for _ in range(5)]
N, place = input_num[0], input_num[1:]

print(math.ceil(N/min(place)) + len(place))

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:
# -*- coding: utf-8 -*-
n = int(input())
s_num = min([int(input()) for i in range(5)])
print(n//s_num+5)

Submission status: Wrong Answer

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

print((people // min(capacities)) + 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num.sort()

result = int(N/num[0])+5

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, L = int(input()), [int(input()) for i in range(5)]
A = N % min(L) + N // min(L)
B = L.index(min(L))
C = len(L) - L.index(min(L)) - 1
ans = 5 if N < min(L) else A + B + C
print(ans)

Submission status: Wrong Answer

Solution code:
N, L = int(input()), [int(input()) for i in range(5)]
ans = 5 if N < min(L) else (N % min(L) + N // min(L)) + (len(L) - L.index(min(L))) + L.index(min(L))-1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = []
for i in range(5):
    li.append(int(input()))
   
ans = 0
li2 = [n,0,0,0,0,0]
while li2[5] != n:
    ans += 1
    print(li2)
    for i in [4,3,2,1,0]:
        print(li2)
        if li2[i] == 0:
            pass
        elif li2[i] >= li[i]:
            li2[i] -= li[i]
            li2[i+1] += li[i]
        else:
            li2[i+1] += li2[i]
            li2[i] = 0

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
limits = []
t = 0
for _ in range(5):
    limits.append(int(input()))
for i in range(5):
    last_n = n % limits[i]
    t += (n - last_n) / limits[i] + 1
    n = last_n
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())

num = N

if num >= A:
    num = A 

if num >= B:
    num = B

if num >= C:
    num = C

if num >= D:
    num = D

if num >= E:
    num = E

print(N // num + 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())

num = N

if num >= A:
    num = A 

if num >= B:
    num = B

if num >= C:
    num = C

if num >= D:
    num = D

if num >= E:
    num = E

if N % num == 0:
    print(N // num + 4)
else:
    print((N + 1) // num + 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())

num = A

if num >= B:
    num = B

if num >= C:
    num = C

if num >= D:
    num = D

if num >= E:
    num = E

if N % num == 0:
    print(N // num + 4)
else:
    print((N + 1) // num + 4)

Submission status: Wrong Answer

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

minVal = pow(10, 15)
minIdx = -1

for i in range(5):
    carry.append(int(input()))
    if carry[i] < minVal:
        minIdx = i
        minVal = carry[i]

k = 0 if N%minVal == 0 else 1
print(N//minVal + 5 + k)

Submission status: Wrong Answer

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

minVal = pow(10, 15)
minIdx = -1

for i in range(5):
    carry.append(int(input()))
    if carry[i] < minVal:
        minIdx = i
        minVal = carry[i]

k = 0 if N%minVal else 1
print(N//minVal + 5 + k)

Submission status: Wrong Answer

Solution code:
n,a,b,c,d,e=[int(input()) for i in range(6)]
dist=[n,0,0,0,0,0]
move=[a,b,c,d,e]
t=0
while dist[5]<n:
  dist[0]=max(0,dist[0]-move[1])
  dist[5]=dist[5]+min(dist[4],move[4])
  for j in range(1,5):
    dist[j]=max(0,dist[j]-move[j])+min(dist[j-1],move[j-1])
  t=t+1
print(t)

Submission status: Wrong Answer

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

res = int(N / min(A) + 1) + 4

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

f=min(k)

print(N//f+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
Cap = [0]*5
time = 5
 
for i in range(5):
    Cap[i] = int(input())
 
    
#Capindex = Cap.index(min(Cap))
 
#time += math.floor(N/Cap[Capindex])
time += math.floor(N/min(Cap))
print(time)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
Cap = [0]*5
time = 5
 
for i in range(5):
    Cap[i] = int(input())
 
    
Capindex = Cap.index(min(Cap))
 
time += math.floor(N/Cap[Capindex])
print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d, e,f= [int(input()) for i in range(6)]
A = [b,c,d,e,f]
pos = 0;
min = 99999999999
for i in range(5):
  if(A[i] < min):
    min=A[i]
    pos = 5-i
res = int(a/min) + 5 
print(res)

Submission status: Wrong Answer

Solution code:
import numpy as np
v = []
for i in range(6):
    v.append(int(input()))

n = v[0]
v = np.array(v[1:])
min = np.min(v)

res = n // min + 5
print(res)

Submission status: Wrong Answer

Solution code:
a, b, c, d, e,f= [int(input()) for i in range(6)]
A = [b,c,d,e,f]
pos = 0;
min = 99999999999
for i in range(5):
  if(A[i] < min):
    min=A[i]
    pos = 5-i
res = int(a/min) + pos 
print(res)

Submission status: Wrong Answer

Solution code:
import sys
import math

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

mn = 10 ^ 16
for i in range(5):
    mn = min(mn, int(sys.stdin.readline()))

print(int(math.ceil(n/mn)+4))

Submission status: Wrong Answer

Solution code:
#Five Transportation
N = int(input())
TP_cap = list(range(5))
max_time = 0

for i in range(5):
    TP_cap[i] = int(input())
    if TP_cap[i] >= N:
        time = 1
    elif TP_cap[i] % N == 0:
        time = N / TP_cap[i]
    else:
        time = (N // TP_cap[i]) + 1
    if max_time < time:
        max_time = time
print(max_time + 4)

Submission status: Wrong Answer

Solution code:
import sys
import math

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

mn = 10 ^ 16
for i in range(5):
    mn = min(mn, int(sys.stdin.readline()))

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

m = min([A,B,C,D,E])
ad = (N//m)
print(ad+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())

m = min([A,B,C,D,E])
ad = (N//m)+1
print(ad+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())

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

print(N//m+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
a = list(map(int,[input() for i in range(5)]))
print(5+n//min(a))

Submission status: Wrong Answer

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

ans = 0
max = List[0]
for i in range(1, 6):
    if max > List[i]:
        if max % List[i] == 0:
            ans += max / List[i]
        else:
            ans += max // List[i] + 1
        max = List[i]
    else:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

min = x[1]
for i in range(5):
    if min > x[i+1]:
        min = x[i+1]

print(x[0]//min+5)

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

Submission status: Wrong Answer

Solution code:
n = map(int,input())
a = list(map(int,[input() for i in range(5)]))
print(5)

Submission status: Wrong Answer

Solution code:
n = input()
a = list(map(int,[input() for i in range(5)]))
print(min(a))

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())
miti=[a,b,c,d,e]
#sload=list(map(int,miti))
mini=min(miti)
retu=n//mini
if n<=mini:
  print(5)
else:
  print(5+retu)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
miti=list(map(int,input().split()))
mini=min(miti)
if n<=mini:
  print(5)
else:
  print(4+n//mini)

Submission status: Wrong Answer

Solution code:
n = int(input())
limits = [int(input()) for i in range(5)]
if (n+1)//min(limits)==0:
    print(5)
else:
    print((n+1)//min(limits)+4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(5)]
ans = 0
if min(A) >= N:
    ans = 5
    print(ans)
else:
    x = int(N/min(A))
    ans = x + 5
    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())
mati=[a,b,c,d,e]
hito=[(n-1)//a,(n-1)//b,(n-1)//c,(n-1)//d,(n-1)//e]
g=max(hito)
print(g+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())
mati=[a,b,c,d,e]
retu=math.ceil(n//min(mati))
print(retu+4)

Submission status: Wrong Answer

Solution code:
from math import floor
n = input()
a = list(map(int,[input() for i in range(5)]))
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())
mati=[a,b,c,d,e]
retu=n//min(mati)
if n<=min(mati):
  print(5)
else:
  print(retu+5)

Submission status: Wrong Answer

Solution code:
n=int(input())
mati=[int(input()) for i in range(5)]
retu=n//min(mati)
if n<=min(mati):
  print(5)
else:
  print(retu+5)

Submission status: Wrong Answer

Solution code:
n=int(input())
mati=[int(input()) for i in range(5)]
retu=n//min(mati)
if n<=min(mati):
  print(5)
else:
    print(retu+5)

Submission status: Wrong Answer

Solution code:
n=int(input())
mati=[int(input()) for i in range(5)]
retu=n//min(mati)
if n<min(mati):
  print(5)
else:
    print(retu+5)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
path = [0] * 5
dp = [0] * 6
min_path = 1000000000000001
for i in range(5):
    path[i] = int(input())
    if path[i] < min_path:
        min_path = path[i]
        min_index = i
dp[1] = dp[0] + math.ceil(N / path[0])
for i in range(2, 6):
    if i <= min_index + 1:
        if path[i - 2] <= path[i - 1]:
            dp[i] = dp[i - 1] + 1
        else:
            dp[i] = dp[i - 1] + math.ceil(N / path[i - 1]) - 1
    if i > min_index + 1:
        dp[i] = dp[i - 1] + 1

print(dp[5])