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:
# import copy
import math

m_num = []  # 各交通機関の運搬上限人数
p_num = int(input())
for i in range (5):
    m_num.append(int(input()))

CITY = 6

pos = [0] * CITY  # 現在、都市にいる人数
pos[0] = p_num

pos_next = [0] * CITY  # 1分経過後の、都市にいる人数
pos_next[0] = p_num
total_time = 0

# 素直に計算する版。時間足りないっぽい。
# while pos[5] != p_num:
#     for p in range(CITY - 1):
#         if pos[p] > 0:
#             if pos[p] > m_num[p]:
#                 pos_next[p] -= m_num[p]
#                 pos_next[p + 1] += m_num[p]
#             else:
#                 pos_next[p] -= pos[p]
#                 pos_next[p + 1] += pos[p]
#     # pos = pos_next  # こうすると同じポインタを指すっぽい
#     pos = copy.deepcopy(pos_next)
#     total_time += 1
#     print(total_time, pos)

# ボトルネックのところで時間が決まる？
min_m = min(m_num)
total_time = math.floor(p_num / min_m) + 5  # 最低5分かかる
print(total_time)

Submission status: Wrong Answer

Solution code:
input_data = []
hum = int(input())
for i in range(5):
    input_data.append(int(input()))
    
diff = int(hum/min(input_data))
amari= int(hum%min(input_data))
if diff == 1 and amari==0:
    diff=0 
print(5+diff)

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]
min_sub = min(sub)
time = 0

if N %min_sub == 0:
    print(int((N/min_sub)) + 5 + 1)
else:
    print(int(N/min_sub) + 5 )

Submission status: Wrong Answer

Solution code:
N = int(input())
X = [int(input()) for _ in range(5)]
cap = min(X)
if (N <= cap):
  b = 1
else:
  b = N//cap + 1

print(b + 4)

Submission status: Wrong Answer

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

import math
sList = sorted(List, reverse=True)
if sList[4]>=N:
  print(5)
else:
  print(math.ceil(N//sList[4])+5)

Submission status: Wrong Answer

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

P1toP2 = math.ceil(N / iList[0])
P2toP3 = math.ceil(iList[0] / iList[1])
P3toP4 = math.ceil(min(iList[:1]) / iList[2])
P4toP5 = math.ceil(min(iList[:2]) / iList[3])
P5toP6 = math.ceil(min(iList[:3]) / iList[4])


print(P1toP2 + P2toP3 + P3toP4 + P4toP5 + P5toP6)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=[0,0,0,0,0]
n=[0,0,0,0,0]
N=int(input())
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
for i in range(5):
  n[i]=-(-N // a[i])
time=n[0]  
for i in range(4):
  if n[i]>=n[i+1]:
    time+=1
  else:
    time+=n[i+1]-n[i]+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]
            d[i] = 0
            
        else:
            d[i+1] +=  list[i]
            d[i] -=  list[i]
           
    j += 1
        
print(j)

Submission status: Wrong Answer

Solution code:
import numpy as np

n = []
s = 0
l = int(input())

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

n = np.array(n)
for idx in range(len(n)-1):
    if l % n[idx] == 0:
        k = int(np.floor(l/n[idx]))
    else:
        k = int(np.floor(l/n[idx])+1)
    s += k
#    print(str(idx)+':'+str(l)+';'+str(s))
    if n[idx]/n[idx+1] <= 1:
        if l % n[idx] != 0:
            l = l % n[idx]
        else:
            l = n[idx]
    else:
        l -=n[idx+1]*(k-1)
s += int(np.floor(l/n[4])+1)
print(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())

time = 0
cnt = 1
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) + N % prev
  else:
    time += 1
  cnt += 1
print(time)

Submission status: Wrong Answer

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

box = []
for a in abcde:
    c = N / a
    if N % a != 0:
        c += 1
    box.append(c)

ans = box[0] + 5

for i in range(4):
    if box[0] + i < box[i+1]:
        ans += box[i+1] - box[i]

print(int(ans) - 1)

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)
if mini_no==1 or mini_no==5:
    time = int(n/mini) +1
    print(time+4)
else:
    time = int(n/mini) + (mini_no-1)
    print(time+(5-mini_no))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
ListN=[A,B,C,D,E]
ListN.sort()
q=ListN[0]
w=(N//q)+1 #律速段階の輸送回数
if q==A:
  print(w+4)
elif q==B:
  print(w+4)
elif q==C:
  print(w+4)
elif q==D:
  print(w+4)
elif q==E:
  print(w+4)

Submission status: Wrong Answer

Solution code:
N = int(input())
former_capacity = 0
ans = 0
areas = [0] * 6
areas[0] = N
capacity_list = []
for i in range(5):
    capacity_list.append(int(input()))
for i, capacity in enumerate(capacity_list):
    n = areas[i]
    if former_capacity == 0:
        diff = int(n/capacity) + 1
    elif capacity < former_capacity:
        diff = int(n/capacity) - int(n/former_capacity) + 1
    else:
        diff = 1
    ans += diff
    former_cap = 0
    trans = 0
    for idx, orig_cap in enumerate(capacity_list):
        area = areas[idx]
        if former_cap != 0:
            cap = min(orig_cap, former_cap)
            area = min(capacity_list[idx-1]*(diff-1), trans)
        else:
            cap = orig_cap
        trans = min(cap * diff, area)
        former_cap = orig_cap
        areas[idx] -= trans
        areas[idx+1] += trans
    former_capacity = capacity
print(ans)

Submission status: Wrong Answer

Solution code:
minutes = 5

people = int(input())

for i in range(5):
  capacity = int(input())
  if people > capacity:
    if people % capacity == 0:
      minutes += people // capacity - 1
    else:
      minutes += people // capacity
    people = capacity
    
print(minutes)

Submission status: Wrong Answer

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

min_num = 0
curr_num = 0
group_num = 1
member_num = n

for num in num_list:
    if member_num > num:
        split_num = math.ceil(member_num / num)
        if min_num < num:
            split_num -= 1
        min_num = member_num % num
        group_num = group_num * split_num
        member_num = num

if group_num == 1:
    group_num -= 1
print(group_num + 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())
route=[a,b,c,d,e]
min_route=a
for i in route:
    if i < min_route:
        min_route=i
if n%min_route != 0:
    time=n//min_route+4
else:
    time=n//min_route+5
print(time)

Submission status: Wrong Answer

Solution code:
from math import modf

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

dd, ii = modf(n/a)
print(max(5, int(ii)+int(dd*10)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
min = 0
for i in range(5):
    x = int(input())
    if i == 0:
        min = x
    if min > x :
        min = x
#print("N={} min={}".format(N,min))
if N <= min:
    print(5)
else:
    print(N // min + 5)

Submission status: Wrong Answer

Solution code:
li =[int(input()) for i in range(6)]
sum_b=0
for i in range(2,6,1):
    if li[i]<li[1]:
        sum_b+=1
answer= 5 + int(li[0]/li[1])+sum_b
print(answer)

Submission status: Wrong Answer

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

min_num = 0
curr_num = 0
group_num = 1
member_num = n

for num in num_list:
    if member_num > num:
        split_num = math.ceil(member_num / num)
        if min_num < num:
            split_num -= 1
        min_num = member_num % num
        group_num = group_num * split_num
        member_num = num

if group_num ==0:
    group_num -= 1
print(group_num + 5)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
S = [0,0,0,0,0]
S[0] = int(input())
S[1] = int(input())
S[2] = int(input())
S[3] = int(input())
S[4] = int(input())

ct = 5
MIN = S[0]
f = 0

if N <= S[0] :
    f = 0
else :
    ct = ct + (N // S[0])
    f = 1

for i in range(4):
    if f == 0 and N <= S[i+1] :
        continue
    elif S[i+1] >= MIN:
        f = 1
        continue
    else:
        ct = ct + (S[i] // S[i+1])
        MIN = S[i+1]
        f = 1
        
print(ct)

Submission status: Wrong Answer

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

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

print(time)

Submission status: Wrong Answer

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

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

print(time, "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())

#import numpy as np
#arr=np.array([a,b,c,d,e])
#botne=np.argmin(arr)+1
#botne_num=np.min(arr)
botne_num=min([a,b,c,d,e])
print(5 + N//botne_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())

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

print(int(n//mini+5))

Submission status: Wrong Answer

Solution code:
import math
n,a,b,c,d,e=[int(input()) for _ in range(6)]
num=[a,b,c,d,e]
ans=0
ab=0
for i in range(1,len(num)):
    ab+=num[i]-num[i-1]
ans+=math.ceil(n/a)
ans+=math.ceil(a/b)
ans+=math.ceil((a/b)/c)
ans+=math.ceil(((a/b)/c)/d)
ans+=math.ceil((((a/b)/c)/d)/e)
if ab<0:
    ans=math.ceil(n/min(num))+4
print(ans)

Submission status: Wrong Answer

Solution code:
print(5)

Submission status: Wrong Answer

Solution code:
N = int(input())
min = 0
for i in range(5):
    x = int(input())
    if i == 0:
        min = x
    if min > x :
        min = x
#print("N={} min={}".format(N,min))
if N // min == 1:
    print(5)
else:
    print(N // min + 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=[A,B,C,D,E]
a=[1,1,1,1,1]
a2=[0,0,0,0,0]
if(A<N):
    a[0]=-(-N // A)
mn=A
if(B<mn):
    mn=B
    a[1]=-(-N // B)
    if(a[0]>1):
        a[0]=1
if(C<mn):
    mn=C
    a[2]=-(-N // C)
    for i in range(0,2):
        if(a[i]>(2-i)):
            a[i]=2-i
if(D<mn):
    mn=D
    a[3]=-(-N // D)
    for i in range(0,3):
        if(a[i]>(3-i)):
            a[i]=3-i
if(E<mn):
    mn=E
    a[4]=-(-N // E)
    for i in range(0,4):
        if(a[i]>(4-i)):
            a[i]=4-i
time=a[0]+a[1]+a[2]+a[3]+a[4]
print(time)

Submission status: Wrong Answer

Solution code:
li =[int(input()) for i in range(6)]
sum_b=0
for i in range(2,6,1):
    if li[i]<li[1]:
        sum_b+=1
print(sum_b)
answer= 5 + int(li[0]/li[1])+sum_b
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())

X = min (A,B,C,D,E)
Y = N // X

print(5+Y)

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
if n >A[0]:
  ans+=(n//A[0] if n%A[0] else n//A[0]-1)
  n=A[0]

for a in A[1:]:
  if n>a:
    ans+=(n//a)
    n=a
print(ans+5)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

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

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 == 0:
    print(int(n//d+4))

else:
    print(int(n//d+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())

x = [A,B,C,D,E] 
pace = min(x) 
y = int(N/pace)+1
print(y+4)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = []
for i in range(5):
  li.append(int(input()))
c = n//li[0]
d = li[0]
e = n%li[0]
for i in range(1,5):
  if li[i] < d:
    c = (e)//li[i] + (d*c)//li[i]
    d = li[i]
    e = n%li[i]
print(c+5)

Submission status: Wrong Answer

Solution code:
import sys
import math

def main(inp):
    N=int(next(inp).split()[0])
    cap = [int(next(inp).split()[0]) for _ in range(5)]
    
    time=math.ceil(N/cap[0])
    
    for i in range(1,5):
        if(cap[i-1]<=cap[i]):
            cap[i]=cap[i-1]
            time+=1
        else: time+=math.ceil(N/cap[i])-1
            
    return time
  
print(main(sys.stdin))

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]

min = 100000000

for inp in inputs:
	if min > inp:
		min = inp

nn = int(n / min)
if nn != 0:
	if n % min != 0:
		nn += 1
	nn = nn -1

nn = 5 + nn

print(nn)

Submission status: Wrong Answer

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

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

print(int(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())
input_list = [a,b,c,d,e]
input_list.sort()
k = int(n // input_list[0])
print(k + 5)

Submission status: Wrong Answer

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

import itertools

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

trans = [a, b, c, d, e]
toshi = [n, 0, 0, 0 ,0, 0]
t = 0

min_i = min(trans)

for i in range(5):
    if trans[i] == min_i:
        t += n // min_i
        if n % min_i > 0:
            t += 1
    else:
        t +=1

print(int(t))

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)
#print(mini_no)
time = int(n/mini) + (mini_no-1)
print(time+(5-mini_no))

Submission status: Wrong Answer

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

box = []
for a in abcde:
    c = N / a
    if N % a != 0:
        c += 1
    box.append(c)

ans = box[0] + 5

for i in range(4):
    if box[i] < box[i+1]:
        ans += box[i+1] - box[i]

print(int(ans) - 1)

Submission status: Wrong Answer

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

min_num = 0
curr_num = 0
group_num = 1
member_num = n

for num in num_list:
    if member_num > num:
        split_num = math.ceil(member_num / num)
        if min_num < num:
            split_num -= 1
        min_num = member_num % num
        group_num = group_num * split_num
        member_num = num

print(group_num + 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())

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
    if bkita == 0:
        bkita = A
    b = (bita + bkita) // B + 1
else:
    ckuru = bkuru

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

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

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

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

Submission status: Wrong Answer

Solution code:
input_list=[input() for i in range(5)]
N = int(input_list[0])
trs = [int(n) for n in input_list[1:]]

mintrs = min(trs)
t = 4 + N//mintrs + 1
print(t)

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:
    ans=5
    print(ans)

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]:
            minus = cap[i] * (i - b_ni)
            b_neck = cap[i]
            ans += (N - minus) // 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:
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)

print(int(n//d+5))

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:
  if l.index(min(l))==0:
    ans = N//min(l)+5
    print(ans)
  else:
    ans = 0
    ans += (N//min(l))+1
    ans += 5-l.index(min(l))
    print(ans)

Submission status: Wrong Answer

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

w=sorted(a)

b=[i  for i in range(5)if a[i]==w[0] and n>a[i]]
#b=a.index(w[0])
ans=0
m=1
b.append(6)
for i in b:
    ans=ans+i-m
    m=i



x=(n//w[0] if n>w[0] else 0)


ans=x*a.count(w[0])+ans
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())
route=[a,b,c,d,e]
min_route=a
for i in route:
    if i < min_route:
        min_route=i
time=n//min_route+5
print(time)

Submission status: Wrong Answer

Solution code:
import sys
import math

input = sys.stdin.readline

n = int(input())

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

p = n
count = 5
lis1 = []

for i in range(5):
    if (lis[i] < p):
        lis1.append(i)
        p = lis[i]

if(len(lis1) > 0):
    print(int(n/lis[lis1[-1]])-1+(n % lis[lis1[-1]])+5)
else:
    if (n > lis[0]):
        if(n % lis[0] != 0):
            print(5 + int(n / lis[0]))
        else:
            print(5 + int(n / lis[0]) - 1)
    else:
        print(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:
    tunnel = 0
    for i in range(len(numbers)-1):
        if numbers[i+1] < numbers[i]:
            tunnel = 1
    print(5 + tunnel + N // numbers[0])

Submission status: Wrong Answer

Solution code:
import numpy as np

n = []
s = 0
l = int(input())

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

n = np.array(n)
for idx in range(len(n)-1):
    if l % n[idx] == 0:
        k = int(np.floor(l/n[idx]))
    else:
        k = int(np.floor(l/n[idx])+1)
    s += k
#    print(str(idx)+':'+str(l)+';'+str(s))
    if n[idx]/n[idx+1] < 1:
        if l % n[idx] != 0:
            l = l % n[idx]
        else:
            l = n[idx]
    else:
        l -=n[idx+1]*(k-1)
s += int(np.floor(l/n[4])+1)
print(s)

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)
neck_count = t.count(bottle_neck)

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

print(ti+4 + neck_count -1)

Submission status: Wrong Answer

Solution code:
from math import modf

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

dif = 0
ss = [a,b,c,d,e]
for i in range(4):
  if ss[i] > ss[i+1]:
    dif += ss[i]-ss[i+1]
dd, ii = modf(n/max(dif, min(ss)))
print(max(5, int(ii)+int(dd*10)))

Submission status: Wrong Answer

Solution code:
#coding: utf-8
N = int(input())
l = []
pre = 0
ans = 0
dp = [0] * 5
for i in range(5):
    l.append(int(input()))

for i in range(5):
    tmp = N // l[i] + N % l[i] if N > l[i] else 1    
    ans += tmp - pre if tmp > pre else 1 
    N -= pre * l[i + 1] if i < 4 else 0
    pre = tmp
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]
mi = l.index(min(l))

if n <= l[mi]:
  print(5)
else:
  print(5 + n//l[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())
s=[A,B,C,D,E]
a=[1,1,1,1,1]
a2=[0,0,0,0,0]
if(A<N):
    a[0]=-(-N // A)
mn=A
if(B<mn):
    mn=B
    a[1]=-(-N // B)
    if(a[0]>1):
        a[0]=1
if(C<mn):
    mn=C
    a[2]=-(-N // C)
    for i in range(0,2):
        if(a[i]>(2-i)):
            a[i]=1
if(D<mn):
    mn=D
    a[3]=-(-N // D)
    for i in range(0,3):
        if(a[i]>(3-i)):
            a[i]=1
if(E<mn):
    mn=E
    a[4]=-(-N // E)
    for i in range(0,4):
        if(a[i]>(4-i)):
            a[i]=1
time=a[0]+a[1]+a[2]+a[3]+a[4]
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())

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

print(n//mini+5)

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

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


def func(city_a, a, b):
    if city_a % a != 0:
        time = city_a // a + 1
        if b >= a:
            city_b = city_a % a
        else:
            city_b = city_a % a + (a - b)*(time - 1)
    else:
        time = int(city_a / a)
        if b >= a:
            city_b = a
        else:
            city_b = a + (a - b)*(time - 1)
    return time, city_b


time_1, city_1 = func(N, a, b)
time_2, city_2 = func(city_1, b, c)
time_3, city_3 = func(city_2, c, d)
time_4, city_4 = func(city_3, d, e)
time_5 = func(city_4, e, e+1)[0]

print(time_1 + time_2 + time_4 + time_4 + time_5)

Submission status: Wrong Answer

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

for _ in range(5):
  li.append(int(input()))
ans = N
aa = 0
count = 0
ll = list()
for i in range(5):
  ak = ans // li[i]
  ll.append(li[i])
  if ak != 0 and i != 4:
    count += ak+1
    if min(ll) > li[i+1]:
      ans = N-(li[i+1]*(count-i-1))
  aa += ak+1
    
print(aa)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t = [int(input()) for i in range(5)]
p = n
time = 0
for i,k in enumerate(t):
  p = p-(time-i)*k
  if p <= k:
    time+=1
  else:
    if p%k>0:
      time += int(p/k)+1
    else:
      time+= int(p/k)
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())

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

min_idx = cs.index(min(cs))

if min_idx == 0:
    t = int(n / cs[min_idx]) + 1
else:
    t = int(cs[min_idx-1] / (cs[min_idx-1] - cs[min_idx]))

print(4 + t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

min_num=min(num_list)

if N < min_num :
  print(5)
else:
  count=int(N//min_num)
  print(5+count)

Submission status: Wrong Answer

Solution code:
N = int(input())
trans = [int(input()) for i in range(5)]
t = min(trans)
if N <= t:
    print(5)
else:
    print(N//t + 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=[A,B,C,D,E]
a=[1,1,1,1,1]
a2=[0,0,0,0,0]
if(A<N):
    a[0]=-(-N // A)
mn=A
if(B<mn):
    mn=B
    a[1]=-(-N // B)
    if(a[0]>1):
        a[0]=1
if(C<mn):
    a[2]=-(-N // C)
    for i in range(0,2):
        if(a[i]>(2-i)):
            a[i]=1
if(D<mn):
    a[3]=-(-N // D)
    for i in range(0,3):
        if(a[i]>(3-i)):
            a[i]=1
if(E<mn):
    a[4]=-(-N // E)
    for i in range(0,4):
        if(a[i]>(4-i)):
            a[i]=1
time=a[0]+a[1]+a[2]+a[3]+a[4]
print(time)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
S = [0,0,0,0,0]
S[0] = int(input())
S[1] = int(input())
S[2] = int(input())
S[3] = int(input())
S[4] = int(input())

ct = 5
MIN = S[0]
f = 0

if N <= S[0] :
    f = 0
else :
    ct = ct + (N // S[0])
    f = 1

for i in range(4):
    if f == 0 and N < S[i+1] :
        continue
    elif S[i+1] >= MIN:
        f = 1
        continue
    else:
        ct = ct + (S[i] // S[i+1])
        MIN = S[i+1]
        f = 1
        
print(ct)

Submission status: Wrong Answer

Solution code:
N = int(input())
min = 0
for i in range(5):
    x = int(input())
    if i == 0:
        min = x
    if min > x :
        min = x
#print("N={} min={}".format(N,min))
print(N // min + 5)

Submission status: Wrong Answer

Solution code:
import numpy as np

n = []
s = 0
l = int(input())

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

n = np.array(n)
for idx in range(len(n)-1):
    if l % n[idx] == 0:
        k = int(np.floor(l/n[idx]))
    else:
        k = int(np.floor(l/n[idx])+1)
    s += k
#    print(str(idx)+':'+str(l)+';'+str(s))
    if n[idx]/n[idx+1] < 1:
        if l != n[idx]:
            l = l % n[idx]
    else:
        l -=n[idx+1]*(k-1)
s += int(np.floor(l/n[4])+1)
print(s)

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