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:
# -*- coding: utf-8 -*-
import math

n = int(input())

time = []

for _ in range(5):
    temp = int(input())
    time.append(temp)
    
if min(time) >= n:
    print(5)
else:
    print(math.floor(n/min(time)) + 5)

Submission status: Wrong Answer

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

n = int(input())

time = []

for _ in range(5):
    temp = int(input())
    time.append(temp)
    bttlNeck = min(time)

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

Submission status: Wrong Answer

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

n = int(input())

bttlNeck = 10**15 + 1

for _ in range(5):
    temp = int(input())
    if bttlNeck > temp:
        bttlNeck = temp

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

Submission status: Wrong Answer

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

n = int(input())

bttlNeck = 10**15 + 1

for _ in range(5):
    temp = int(input())
    if bttlNeck > temp:
        bttlNeck = temp

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

Submission status: Wrong Answer

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

n = int(input())

bttlNeck = 10**15 + 1

for _ in range(5):
    temp = int(input())
    if bttlNeck > temp:
        bttlNeck = temp

if n // bttlNeck >= n:
    print(5)
else:
    print(n % bttlNeck + 5)

Submission status: Wrong Answer

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

n = int(input())

bttlNeck = 10**15 + 1

for _ in range(5):
    temp = int(input())
    if bttlNeck > temp:
        bttlNeck = temp
        
print(int(n/bttlNeck) + 4)

Submission status: Wrong Answer

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

n = int(input())

bttlNeck = 10**15 + 1

for _ in range(5):
    temp = int(input())
    if bttlNeck > temp:
        bttlNeck = temp
        
print(n // bttlNeck + 5)

Submission status: Wrong Answer

Solution code:
N=int(input())
L=[int(input()) for _ in range(5)]
print(5 if min(L)>=5 else 4 -((-N)//min(L)))

Submission status: Wrong Answer

Solution code:
N=int(input())
L=[int(input()) for _ in range(5)]
print(5 if min(L)>=5 else 5 -((-N)//min(L))-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())

int_list = [A, B, C, D, E]
min_int = min(int_list)

if N%min_int == 0:
    aaa = N//min_int
    print(5+aaa)
else:
    aaa = N//min_int
    print(5+aaa+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())

int_list = [A, B, C, D, E]
min_int = min(int_list)

if min_int >= N:
    print(5)
else:
    aaa = N//min_int
    print(5+aaa)

Submission status: Wrong Answer

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

int_list = [A, B, C, D, E]
min_int = min(int_list)

if min_int == N:
    print(5)
else:
    aaa = N//min_int
    print(5+aaa)

Submission status: Wrong Answer

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

int_list = [A, B, C, D, E]
min_int = min(int_list)

if min_int == N:
    aaa = N//min_int
    print(5+aaa-1)
else:
    aaa = N//min_int
    print(5+aaa)

Submission status: Wrong Answer

Solution code:
from sys import exit
from math import ceil
# A,B,C = [int(n) for n in input().split()]
N = int(input())
ABCDE = [int(input()) for _ in range(5)]
mostn = min(ABCDE)
ans = 0
print(mostn + 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())

int_list = [A, B, C, D, E]
min_int = min(int_list)

aaa = N//min_int

print(5+aaa)

Submission status: Wrong Answer

Solution code:
N=int(input())

for i in range(5):
  if i==0:
    a=int(input())
  else:
    b=int(input())
    if b<a:
      a=b
print(int(N/a)+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())

int_list = [A, B, C, D, E]
min_int = min(int_list)

aaa = (N//min_int)

print(5+aaa)

Submission status: Wrong Answer

Solution code:
from sys import exit
from math import ceil
# A,B,C = [int(n) for n in input().split()]
N = int(input())
ABCDE = [int(input()) for _ in range(5)]
mostn = min(ABCDE)
ans = 0
for n in ABCDE:
    if n != mostn:
        ans+=1
    else:
        ans+=ceil(N/mostn)
print(ans)

Submission status: Wrong Answer

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

mini = min(a)
print(N // mini + 5 if N % mini != 0 else 4)

Submission status: Wrong Answer

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

mini = min(a)
print(N // mini + 5 if N % mini else 4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

import re

n = int(input())
p = []
min = 1000000000000000

for i in range(5):
    x = int(input())
    p.append(x)
    if(min > x):
        min = x

print(int(n/min)+5)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

import re

n = int(input())
p = []
min = 123

for i in range(5):
    x = int(input())
    p.append(x)
    if(min > x):
        min = x

print(int(n/min)+5)

Submission status: Wrong Answer

Solution code:
import math
l=[int(input()) for i in range(5)]
t=0
N,*l=l
minl=min(l)
t=math.ceil(N-1/float(minl))+5
print(t)

Submission status: Wrong Answer

Solution code:
import math
l=[int(input()) for i in range(5)]
t=0
N,*l=l
minl=min(l)
t=math.ceil(N+minl-1/float(minl))+1+3
print(t)

Submission status: Wrong Answer

Solution code:
import math
l=[int(input()) for i in range(5)]
t=0
N,*l=l
minl=min(l)
t=math.ceil(N/float(minl))+1+3
print(t)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
vehicles = [int(input()) for i in range(5)]
print(math.floor(N/min(vehicles))+5)

Submission status: Wrong Answer

Solution code:
x = [int(input()) for i in range(6)]
t = 1
before = [x[0],0,0,0,0]
after = before[:]
while before[4] < x[0]:
    for i in range(4):
        if before[i] > 0:
            if before[i] > x[i+1]:
                after[i] -= x[i+1]
                if after[i] < 0:
                    after[i] = 0
                after[i+1] += x[i+1]
            else:
                after[i] -= before[i]
                if after[i] < 0:
                    after[i] = 0
                after[i+1] += before[i]
    t += 1
#    print(before,"→",after)
    before = after[:]
print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

A = []
N = int(input())
for i in range(5):
    a = int(input())
    A.append(a)
min_t = min(A)
"""
if N % min_t == 0:
    a = N // min_t
else:
    a = N // min_t + 1
"""
a = math.ceil(N / min_t)
print(a + 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())

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

print(int(n/min)+5)

Submission status: Wrong Answer

Solution code:
#入力値を定義
N, A, B, C, D, E = eval("int(input())," * 6)
# Nをmin(A~E)で割った時の商の分だけ、移動が余計にかかる
print(5 + N // min(A, B, C, D, E))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

def main():
    N = int(input())
    d = []
    for _ in range(5):
        d.append(int(input()))
    print(-(-N // min(d)) + 4)


if __name__ == '__main__':
    main

Submission status: Wrong Answer

Solution code:
import math

N=int(input().strip())
a=[0]*5
ans=0
for i in range(5):
    a[i]=int(input().strip())
b=a.index(min(a))
ans=5+math.floor(N/a[b])
print(ans)

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math


n = int(input())
capacity = []
for _ in range(5):
  capacity.append(math.ceil(n / int(input())))

ans = 5 + capacity[0]-1
mn = capacity[0]
for i in range(4):
  if mn < capacity[i]:
    ans += capacity[i] - mn
    mn = capacity[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import math

A = []
N = int(input())
for i in range(5):
    a = int(input())
    A.append(a)
min_t = min(A)
"""
if N % min_t == 0:
    a = N // min_t
else:
    a = N // min_t + 1
"""
a = math.ceil(N // min_t)
print(a + 5)

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math


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

bneck = math.floor(n/min(capacity))
print(bneck+5)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = [int(input()) for _ in range(5)]
li2 = [int(n/li[i]) if li[i]%n!=0 else int(n/li[i])-1 for i in range(5)]

print(5+max(li2))

Submission status: Wrong Answer

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

bottleneck = min(time)
print(round(N / bottleneck, 0) + 4)

Submission status: Wrong Answer

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

bottleneck = min(time)
print(N // bottleneck + 1 + 4)

Submission status: Wrong Answer

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

tmp = min(max_available)
if tmp >= N:
    print(5)
else:
    print(5 + N // tmp)

Submission status: Wrong Answer

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

nar = min(l)
print((n//nar+1)+4)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math

def main():
    N = int(input())
    ABCDE = [int(input()) for _ in range(5)]
    abcde = [math.ceil(N / i) for i in ABCDE]
    result = abcde[0]
    for i, j in enumerate(abcde[1:]):
        result = result + 1 if abcde[i] >= abcde[i+1] else result - 1 + j
    print(result)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n, a, b, c, d, e = [int(input()) for _ in range(6)]
l = [a,b,c,d,e]
ans = 0
city = [n] * 6
# 値が小さくなる点を探す
# indmin = 0
# for i in range(4):
#     if l[i] > l[i + 1]:
#         indmin = i + 1
#         break
indmin = l.index(min(l))
# 値が小さくなるところまでのコスト
ans += indmin
# 値が小さくんなる点が0になるまでのコスト
import math
ans += math.ceil(n / l[indmin])
ans += (5 - (indmin + 1))
if indmin == 4:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for _ in range(5)]
if min(a)>=n:
    print(5)
else:
    t=n//min(a)+5
    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())

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

add=N//x
if add == 1:
    add-=1

print(5+add)

Submission status: Wrong Answer

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

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

add=N//x

print(5+add)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = [int(input(a)) for a in range(5)]
print(math.ceil(N / min(A)) + 4)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
li = [a,b,c,d,e]

m = min(li)

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

m = min(li)
f = li.index(m)
print(n//li[f] + 4)

Submission status: Wrong Answer

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

lst=[A,B,C,D,E]
neck=min(lst)
if neck==N:
    ans=5
else:
    ans=N//neck+5

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

lst=[A,B,C,D,E]
neck=min(lst)
ans=N//neck+5

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

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

ans = N // min_capacity + 5

print(ans)

Submission status: Wrong Answer

Solution code:
a,*b=eval('int(input()),'*6);print(4+a//min(b))

Submission status: Wrong Answer

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

ans=4+1+n//m

print(ans)

Submission status: Wrong Answer

Solution code:
n,*a=eval('int(input()),'*6);print(4-~n//min(a))

Submission status: Wrong Answer

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

# ボトルネックを探し，そこに詰まらない量だけ流す
n = int(input())
a_e = [int(input()) for _ in range(5)]

min_ae = min(a_e)
ans = n // min_ae if n % min_ae == 0 else n//min_ae + 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

city = sorted(city)

ans = N // city[0] + 5
    
print(ans)

Submission status: Wrong Answer

Solution code:
#解説の方向で通したくない
import sys
N = int(input())
aD = [int(_) for _ in sys.stdin.readlines()]
def fAdd(aS,s,a):
    if s in aS:
        aS[s] += a
    else:
        aS[s] = a
iT = 0
aS = {N:1}
for iLim in aD:
    iM =  0
    bF = False
    aS2= {}
    for s in sorted(aS.keys(),reverse=True):
        iC = aS[s]
        if iM :
            if  s < iLim and iM < (iLim - s) * iC :
                iD = iM // (iLim -s)
                if iD:
                    fAdd(aS2,iLim,iD)
                iDM = iM % (iLim -s)
                if iDM:
                    fAdd(aS2,s+iDM,1)
                aS2[s] = iC - iD - (1 if iDM else 0)
                bF = True
            else:
                del aS[s]
                iS = s * iC + iM
                iD = iS // iLim
                iM = iS % iLim
                fAdd(aS2,iLim,iD)
                if s <= iLim:
                    bF = True
        elif iLim < s:
            del aS[s]
            iD = s // iLim
            iM = s % iLim
            fAdd(aS2,iLim,iC*iD)
        else:
            aS2[s] = iC
            bF = True
    if iM :
        fAdd(aS2,iM,1)
    if bF:
        iT += 1
    aS = aS2
if iT == 5:
    print(5)
else:
    for s in aS:
        iT += aS[s]
    print(iT)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#解説の方向で通したくない
import sys
N = int(input())
aD = [int(_) for _ in sys.stdin.readlines()]
def fAdd(aS,s,a):
    if s in aS:
        aS[s] += a
    else:
        aS[s] = a
iT = 0
aS = {N:1}
for iLim in aD:
    iM =  0
    bF = False
    aS2= {}
    for s in sorted(aS.keys(),reverse=True):
        iC = aS[s]
        if iM :
            if  s < iLim and iM < (iLim - s) * iC :
                iD = iM // (iLim -s)
                if iD:
                    fAdd(aS2,iLim,iD)
                iDM = iM % (iLim -s)
                if iDM:
                    fAdd(aS2,s+iDM,1)
                aS2[s] = iC - iD - (1 if iDM else 0)
            else:
                del aS[s]
                iS = s * iC + iM
                iD = iS // iLim
                iM = iS % iLim
                fAdd(aS2,iLim,iD)
                bF = True
        elif iLim < s:
            del aS[s]
            iD = s // iLim
            iM = s % iLim
            fAdd(aS2,iLim,iC*iD)
        else:
            aS2[s] = iC
            bF = True
    if iM :
        fAdd(aS2,iM,1)
    if bF:
        iT += 1
    aS = aS2
if iT == 5:
    print(5)
else:
    for s in aS:
        iT += aS[s]
    print(iT)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
aD = [int(_) for _ in sys.stdin.readlines()]
def fAdd(aS,s,a):
    if s in aS:
        aS[s] += a
    else:
        aS[s] = a
iT = 0
aS = {N:1}
for iLim in aD:
    iM =  0
    bF = False
    aS2= {}
    for s in sorted(aS.keys(),reverse=True):
        iC = aS[s]
        if iM :
            if  s < iLim and iM < (iLim - s) * iC :
                iD = iM // (iLim -s)
                if iD:
                    fAdd(aS,iLim,iD)
                iDM = iM % (iLim -s)
                if iDM:
                    fAdd(aS2,s+iDM,1)
                aS2[s] = iC - iD - (1 if iDM else 0)
            else:
                del aS[s]
                iS = s * iC + iM
                iD = iS // iLim
                iM = iS % iLim
                fAdd(aS2,iLim,iD)
                bF = True
        elif iLim < s:
            del aS[s]
            iD = s // iLim
            iM = s % iLim
            fAdd(aS2,iLim,iC*iD)
        else:
            aS2[s] = aS[s]
            bF = True
    if iM :
        fAdd(aS2,iM,1)
    if bF:
        iT += 1
    aS = aS2
if iT == 5:
    print(5)
else:
    for s in aS:
        iT += aS[s]
    print(iT)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
aD = [int(_) for _ in sys.stdin.readlines()]
def fAdd(aS,s,a):
    if s in aS:
        aS[s] += a
    else:
        aS[s] = a
iT = 0
aS = {N:1}
for iLim in aD:
    iM =  0
    bF = False
    for s in sorted(aS.keys(),reverse=True):
        iC = aS[s]
        if iM :
            if  s < iLim and iM < (iLim - s) * iC :
                iD = iM // (iLim -s)
                if iD:
                    fAdd(aS,iLim,iD)
                iDM = iM % (iLim -s)
                if iDM:
                    fAdd(aS,s+iDM,1)
                aS[s] = iC - iD - (1 if iDM else 0)
            else:
                del aS[s]
                iS = s * iC + iM
                iD = iS // iLim
                iM = iS % iLim
                fAdd(aS,iLim,iD)
                bF = True
        elif iLim < s:
            del aS[s]
            iD = s // iLim
            iM = s % iLim
            fAdd(aS,iLim,iC*iD)
        else:
            bF = True
    if iM :
        fAdd(aS,iM,1)
    if bF:
        iT += 1
if iT == 5:
    print(5)
else:
    for s in aS:
        iT += aS[s]
    print(iT)

Submission status: Wrong Answer

Solution code:
N, *capacity = [int(input()) for _ in range(6)]

# min_index = capacity.index(min(capacity))

ans = N // min(capacity)

print(ans+4)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
aD = [int(_) for _ in sys.stdin.readlines()]
def fCeil(b):
    b *= 10
    return  b//10 + 1 if b % 10 else b//10
iT = 0
aS = {N:1}
for i in range(5):
    iLim = aD[i]
    bF = False
    for s in aS.copy():
        if iLim < s:
            iC = aS[s]
            del aS[s]
            iD = s // iLim
            iM = s % iLim
            if iLim in aS:
                aS[iLim] += iC * iD
            else:
                aS[iLim] = iC*iD
            if iM:
                if iM in aS:
                    aS[iM]+=1
                else:
                    aS[iM] = 1
        else:
            bF = True
    if bF:
        iT += 1
if iT == 5:
    print(5)
else:
    for s in aS:
        iT += aS[s]
    print(iT)

Submission status: Wrong Answer

Solution code:
N, *capacity = [int(input()) for _ in range(6)]

min_index = capacity.index(min(capacity))

ans = N // capacity[min_index] + 1

print(ans+4)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
aD = [int(_) for _ in sys.stdin.readlines()]
def fCeil(b):
    b *= 10
    return  b//10 + 1 if b % 10 else b//10
iT = 0
iC = 0
iS = N
for i in range(5):
    iLim = aD[i]

    if iLim < iS:
        if iT == 0:
            iT = fCeil(iS / iLim)
        else:
            iT *= fCeil(iS / iLim)
    else:
        iT += 1
    if iLim < iS :
        iS = iLim
print(int(iT))

Submission status: Wrong Answer

Solution code:
print((int(input())+1)//sorted([int(input()) for _ in range(5)])[4]+5)

Submission status: Wrong Answer

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


bottle_neck = min(lst_AtoE)
ans = (N//bottle_neck + 1) + 4
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
li=[]
for i in range(5):
  li.append(int(input()))
li.sort()
print((n-1)//li[0])

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

Submission status: Wrong Answer

Solution code:
n,*a=[int(input()) for i in range(4)]
m=sorted(a)[0]
print(n//m+5 if n%m>0 else n//m+4)

Submission status: Wrong Answer

Solution code:
n,*a=[int(input()) for i in range(4)]
m=sorted(a)[0]
print(n//m++5 if n%m>0 else n//m+4)

Submission status: Wrong Answer

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

for i in range(1, 5):
    if cost[i] > cost[i - 1]:
        cost[i] = cost[i - 1]

last = N
t = 0

for i in range(5):
    add = (last + cost[i] - 1) // cost[i]
    t += add
    last = last % cost[i]
    if i != 4 and cost[i] > cost[i + 1]:
        last += (cost[i] - cost[i + 1]) * (add - 1)
print(t)

Submission status: Wrong Answer

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

for i in range(1, 5):
    if cost[i] > cost[i - 1]:
        cost[i] = cost[i - 1]

last = N
t = 0
for i in range(5):
    t += ((last + cost[i] - 1) // cost[i])
    last = last % cost[i] + (cost[i] % cost[i + 1] if i != 4 else 0)
    if last == 0:
        last = cost[i]
print(t)

Submission status: Wrong Answer

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

for i in range(1, 5):
    if cost[i] > cost[i - 1]:
        cost[i] = cost[i - 1]

last = N
t = 0
for i in range(5):
    if last == cost[i]:
        t += 1
        continue
    t += ((last + cost[i] - 1) // cost[i])
    last = cost[i]

print(t)

Submission status: Wrong Answer

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

for i in range(1, 5):
    if cost[i] > cost[i - 1]:
        cost[i] = cost[i - 1]

last = N
t = 0
for i in range(5):
    t += ((last + cost[i] - 1) // cost[i])
    last = cost[i]
    if last == 0:
        last = cost[i]
print(t)

Submission status: Wrong Answer

Solution code:
import math

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

print(math.ceil(N / min(a)) - 4)

Submission status: Wrong Answer

Solution code:
population = int(input())
a2b = int(input())
b2c = int(input())
c2d = int(input())
d2e = int(input())
e2f = int(input())
city = [population,0,0,0,0,0]
vehicle = [a2b,b2c,c2d,d2e,e2f]
print(round(population/min(vehicle)) + 4)

Submission status: Wrong Answer

Solution code:
population = int(input())
a2b = int(input())
b2c = int(input())
c2d = int(input())
d2e = int(input())
e2f = int(input())
city = [population,0,0,0,0,0]
vehicle = [a2b,b2c,c2d,d2e,e2f]
vehicle_min = min(vehicle)
print(int(population/vehicle_min) + 5)

Submission status: Wrong Answer

Solution code:
population = int(input())
print(population)
a2b = int(input())
b2c = int(input())
c2d = int(input())
d2e = int(input())
e2f = int(input())
city = [population,0,0,0,0,0]
vehicle = [a2b,b2c,c2d,d2e,e2f]
time = 0
while(city[5]!=population):
    for i in range(5):
        if city[4-i] >= vehicle[4-i]:
            city[5-i] += vehicle[4-i]
            city[4-i] -= vehicle[4-i]
        else:
            city[5-i] += city[4-i]
            city[4-i] = 0
    time += 1

print(time)

Submission status: Wrong Answer

Solution code:
population = int(input())
print(population)
a2b = int(input())
b2c = int(input())
c2d = int(input())
d2e = int(input())
e2f = int(input())
city = [population,0,0,0,0,0]
vehicle = [a2b,b2c,c2d,d2e,e2f]
time = 0
while(city[5]!=population):
    for i in range(5):
        if city[4-i] >= vehicle[4-i]:
            city[5-i] += vehicle[4-i]
            city[4-i] -= vehicle[4-i]
        else:
            city[5-i] += city[4-i]
            city[4-i] = 0
    print(city)
    time += 1

print(time)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

human = [n,0,0,0,0,0]
next_human = [n,0,0,0,0,0]

t = 0

print(human)
print()

while not human[-1]==n:
    if not human[0] == 0:
        x = min(human[0], a)
        next_human[0] -= x
        next_human[1] += x
    if not human[1] == 0:
        x = min(human[1], b)
        next_human[1] -= x
        next_human[2] += x
    if not human[2] == 0:
        x = min(human[2], c)
        next_human[2] -= x
        next_human[3] += x
    if not human[3] == 0:
        x = min(human[3], d)
        next_human[3] -= x
        next_human[4] += x
    if not human[4] == 0:
        x = min(human[4], e)
        next_human[4] -= x
        next_human[5] += x
    t += 1
    human[:] = next_human[:]

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())
time= 0

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

time = (n//minroute) + 5

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())
time= 0

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

time = n/minroute + 4

print(time)

Submission status: Wrong Answer

Solution code:
inputs=[int(input()) for i in range(6)]
N,A,B,C,D,E=inputs
a,b,c,d,e,f=[N,0,0,0,0,0]
T=0

def ship(station,destination,capacity):
    if station>=capacity:
        s=capacity
    else:
        s=station
    destination=destination+s
    station=station-s
    return station,destination

while True:
    if f==N:
        print(T)
        break
    if e!=0:
      e,f=ship(e,f,E)
    if d!=0:
      d,e=ship(d,e,D)
    if c!=0:
      c,d=ship(c,d,C)
    if b!=0:
      b,c=ship(b,c,B)
    if a!=0:
      a,b=ship(a,b,A)
    print("{}{}{}{}{}{}".format(a,b,c,d,e,f))
    T=T+1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inputs=[int(input()) for i in range(6)]
N,A,B,C,D,E=inputs
a,b,c,d,e,f=[N,0,0,0,0,0]
T=0

def ship(station,destination,capacity):
    if station>=capacity:
        s=capacity
    else:
        s=station
    destination=destination+s
    station=station-s
    return station,destination

while True:
    if f==N:
        print(T)
        break
    e,f=ship(e,f,E)
    d,e=ship(d,e,D)
    c,d=ship(c,d,C)
    b,c=ship(b,c,B)
    a,b=ship(a,b,A)
    print("{}{}{}{}{}{}".format(a,b,c,d,e,f))
    T=T+1

Submission status: Wrong Answer

Solution code:
import sys
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)+1+4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

A=[]
iA=[]

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

for i in range(5):
    iA.append(math.ceil(N/A[i]))

t=iA[0]

for i in range(4):
    if iA[i]<iA[i+1]:
        t+=iA[i+1]-iA[i]+1
    else:
        t+=1

print(t)

Submission status: Wrong Answer

Solution code:
import sys


def main():
    input = sys.stdin.readline
    n = float(input())
    nin_list = [int(input()) for _ in range(5)]
    print(int(4 + round(n / min(nin_list))))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
inputs=[int(input()) for i in range(6)]
N,A,B,C,D,E=inputs
a,b,c,d,e,f=[N,0,0,0,0,0]
T=0

def ship(station,destination,capacity):
    if station>=capacity:
        s=capacity
    else:
        s=station
    destination=destination+s
    station=station-s
    return station,destination

while True:
    if f==N:
        print(T)
        break
    a,b=ship(a,b,A)
    b,c=ship(b,c,B)
    c,d=ship(c,d,C)
    d,e=ship(d,e,D)
    e,f=ship(e,f,E)
    T=T+1