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 math

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

def main():
    print(int(math.floor(N / min([A, B, C, D, E]))) + 5)

if __name__ == '__main__':
    main()

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
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())
A=int(n//a)+1
B=int(n//b)+1
C=int(n//c)+1
D=int(n//d)+1
E=int(n//e)+1
f=A
listA=[A,B,C,D,E]
for i in range(1,5):
    if listA[i-1]-1>=listA[i]:
        f=f+1
    elif listA[i-1]-1<listA[i]:
        f=f+listA[i]-listA[i-1]+1
print(f)

Submission status: Wrong Answer

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

l=[b,c,d,e]
min=a
for x in l:
    if x<min:
        min=x
print((n//min)+5)

Submission status: Wrong Answer

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

m = min(A)
times = 5 + (N // m)

print(times)

Submission status: Wrong Answer

Solution code:
N = int(input())
Cap = [0]*5
time = 5

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

    
Capindex = Cap.index(min(Cap))

time += int(N/Cap[Capindex])
print(time)

Submission status: Wrong Answer

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

ans = N//min(m) + 5

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(n//min(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())

status = [n, 0, 0, 0, 0, 0]

for i in range(10):
    status[5] += min(status[4], e)
    status[4] -= min(status[4], e)

    status[4] += min(status[3], d)
    status[3] -= min(status[3], d)

    status[3] += min(status[2], c)
    status[2] -= min(status[2], c)

    status[2] += min(status[1], b)
    status[1] -= min(status[1], b)

    status[1] += min(status[0], a)
    status[0] -= min(status[0], a)

#    print(status)

    if status == [0, 0, 0, 0, 0, n]:
        #        print('finish!')
        print(i+1)
        exit()

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
bkita = A

c = 1
cita = 0
ckita = B

d = 1
dita = 0
dkita = C

e = 1
eita = 0
ekita = D

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

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

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

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

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

Submission status: Wrong Answer

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


time = [0,0,0,0,0]
board = [N,0,0,0,0]

t = 0
i = 0
while i <= 4:
    time[i] = board[i] // li[i]
    t += time[i] + 1
    board[i+1] = li[i] - li[i+1] + N % li[i]
    if board[i] > li[i+1]:
        i += 1
    else:
        t += 4 - i
        i = 5

print(t)

Submission status: Wrong Answer

Solution code:
import bisect
from collections import deque
from collections import defaultdict
from fractions import gcd
#from math import factorial
from math import sqrt
from math import ceil
from itertools import permutations
N=int(input())
A=[]
B=[]
mi=10**20
T=1
for i in range(5):
    a=float(input())
    mi=min(a,mi)
    A.append(a)
B.append(ceil(N/A[0]))
if A[0]==mi:
    T=0
for i in range(4):
    if A[i+1]<A[i]:
        B.append(B[i]-T*(ceil(N/A[i])-ceil(N/A[i+1]))+1)
        if A[i+1]==mi:
            T=0
    else:
        B.append(B[i]+1)
print(int(B[-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())
X=[a,b,c,d,e]
if n%a==0:
    cnt=n//a+4
else:
    cnt=n//a+5 
    


for i in range(4):
    if n%X[i]==0:
        p=n//X[i]
    else:
        p=n//X[i]+1
    
    if n%X[i+1]==0:
        q=n//X[i+1]
    else:
        q=n//X[i+1]+1
    
    
        
    if X[i]<=X[i+1]:
        continue
    else:
        cnt+=q-p
        

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

trans = int(1e+15)

for _ in range(5):
    tmp = int(input())
    if tmp < trans:
        trans = tmp

if trans > n:
    print(5)
else:
    print(5 + n // trans)

Submission status: Wrong Answer

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

print(5 + a[0] // min(a)) if min(a) < a[0] else print(5)

Submission status: Wrong Answer

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

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

t = N//r4+5

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

Submission status: Wrong Answer

Solution code:
import sys
import io
import math
import re

menu_num = 5
menu_sum = 0
menu_time_divided = 9
flag_a = 0
flag_b = 0

time_info_min = 10000000000000000

data_info = input().split()
passenger_info = int(data_info[0])

for num in range(menu_num):
    data_info = input().split()
    time_info = int(data_info[0])
    if time_info < time_info_min:
        time_info_min = time_info

print( 5 + math.floor(passenger_info/time_info_min))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
ls = []
dic = {}
for i in range(5):
    ls.append(int(input()))
for i in range(5):
    dic[ls[i]] = i+1
print(math.ceil(n / min(dic.keys())) + 5)

Submission status: Wrong Answer

Solution code:
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
 
N, *num = [int(input()) for i in range(6)]
min = sorted(num)[0]

print(N//min + 4)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
su = 5
d = 0
for i in range(5):
    k = int(input())
    a.append([k,-(-1*n//k)])

for i in range(5):
    if i == 0:
        su += a[i][1] - 1
    else:
        if a[i-1][1] < a[i][1]:
            if d < a[i][1] - a[i-1][1]:
                su += (a[i][1] - a[i-1][1]) - d
                d += a[i][1] - a[i-1][1]

print(su)

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)
print(5 + n // x)

Submission status: Wrong Answer

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

list = {n,0,0,0,0,0}
i = a
if n>a or n>b or n>c or n>d or n>e :
  for j in {b,c,d,e} :
    if i>j :
      i = j
  print(5+n//i)
else :
  print(5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for _ in range(5):
    transes.append(int(input()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

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

time = 0
n = N

for i in range(5):
  time += max(math.ceil(n / abcde[i]), 1)
  last = n % abcde[i]
  if last == 0:
    last = abcde[i]
  if i < 4:
    n = last + max(N - time * abcde[i+1], 0)

print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(N, limits):
    min_limit = min(limits)
    return 5 + N // min_limit


N = int(input())
limits = []
for _ in range(5):
    limits.append(int(input()))
print(solve(N, limits))

Submission status: Wrong Answer

Solution code:
N = int(input())
former_capacity = 0
ans = 0
for _ in range(5):
    capacity = int(input())
    if former_capacity == 0:
        ans += int(N/capacity) + 1
    elif capacity < former_capacity:
        ans += int(N/capacity) - int(N/former_capacity) + 1
    else:
        ans += 1
    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:
    minutes += people // capacity
    people = capacity
  
print(minutes)

Submission status: Wrong Answer

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

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

kaisuu = 0

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

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

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

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

            if minsuu % li[i] == 0:
                kaisuu += minsuu // li[i]
            else:
                kaisuu += minsuu // li[i] + 1

print(kaisuu)

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=[n//a,n//b,n//c,n//d,n//e]
print(max(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())
if N < min(A,B,C,D,E):
    print(5)
else:
    print(5 + N //min(A,B,C,D,E))

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 + N%cap

print(b + 4)

Submission status: Wrong Answer

Solution code:
n=int(input())
pt=[int(input()) for _ in range(5)]
if n%2==0:
  print(n//min(pt)+4)
else:
  print(n//min(pt)+5)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
ls = []
dic = {}
for i in range(5):
    ls.append(int(input()))
for i in range(5):
    dic[ls[i]] = i+1
print(math.ceil(n // min(dic.keys())) + 5)

Submission status: Wrong Answer

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

bottleneck = min(caps)

if bottleneck >= N:
    print(5)
    exit()

t_start2bn = 0
sepnum = 0
t_bn2goal = 0

for idx,item in enumerate(caps):
    if item == bottleneck:
        t_start2bn = idx
        sepnum = N // bottleneck + N % 2
        t_bn2goal = 5 - idx
        print(t_start2bn + t_bn2goal + sepnum - 1)
        exit()

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()))
#n = int(input())
long = min(t)

ti = int(n/long +0.5)
if ti ==0:
    ti=1

print(ti+4)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N, A, B, C, D, E = (int(input()) for i in range(6))
x = min([A, B, C, D, E])
if N <= x:
    ans = 5
else:
    ans = (N // x) + 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())

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

hun.sort()

risso=hun[0]
if n<=risso:
  print(5)
else:
  if risso==1:
    print(5+(n-1))
  else:
    print(5+((n+1)//risso)-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

mn = min(a)
for i in range(5):
    if a[i] == mn:
        cnt += 1

if cnt == 5:
    if n % mn == 0:
        ans = 4 + n // mn
    else:
        ans = 4 + n // mn + 1
else:
    if n % mn == 0:
        ans = 5 - cnt + n // mn
    else:
        ans = 5 - cnt + n // mn + 1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
an=[int(input()) for _ in range(5)]
m = min(an)
if m == 1:
    print(n*2-1)
elif m >= n:
    print(5)
else:
    if n%m != 0:
        print(n//min(an)+5)
    else:
        print(n//min(an)+4)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
transporter = [0]*5
transporter_lag = [0]*5
for i in range(5):
    transporter[i] = int(input())
for i in range(1,5):
    if transporter[i] >= transporter[i-1]:
        transporter_lag[i] = 0
    else :
        transporter_lag[i] = math.ceil(transporter[i-1]/transporter[i]) - 1
if math.ceil(N/transporter[0]) <= 5:
    ans = 5+ sum(transporter_lag)
else :
    ans = math.ceil(N/transporter[0]) + sum(transporter_lag) + 4
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

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

time = 0
n = N

for i in range(5):
  time += max(math.ceil(n / abcde[i]), 1)
  if i < 4:
    n = max((n % abcde[i]) + max(N - time * abcde[i+1], 0), 1)

print(time)

Submission status: Wrong Answer

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

print(int(5 + (n - min(trans)) / min(trans)) + 1) if n > min(trans) else print(5)

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(5)]
import math
t=0
l=[10000000007,2,3,5,7,11]
N,*l=l
# print(N,l)
minl=min(l)
minidx=l.index(min(l))

if N>minl:
    t=math.ceil(N/minl)+1+3
else:
    t=5
print(t)

Submission status: Wrong Answer

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

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

print(str(int(n/min(a))+5))

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える

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

traffic_time.sort()

wait_time = n//traffic_time[0]
# print(wait_time)
if wait_time <= 1:
    wait_time = 0
if n%traffic_time[0] == 0:
    wait_time -= 1

wait_time = max(wait_time,0)

print(wait_time+5)

Submission status: Wrong Answer

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

fst = 0
lst = 0

for i in range(5):
    time = math.ceil(N/AE[i])
    fst += 1
    if i > 0:
        if AE[i] >= AE[i-1]:
            lst += 1
        else:
            lst = fst + math.ceil(N/AE[i])
    else:
        lst = math.ceil(N/AE[i])

print(lst)

Submission status: Wrong Answer

Solution code:
import numpy as np

num = [] #５個の料理の必要時間

n=input()
n=int(n)

for i in range(5): #入力
    a = input()
    a = int(a)
    num.append(a)



mini=min(num)
i=max(0,int(n/mini))

print(5+i)

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 + N%cap

print(b + 4)

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+=max(iA[i+1]-iA[i]+1,math.ceil((N%A[i])/A[i+1]))
    else:
        t+=1

print(t)

Submission status: Wrong Answer

Solution code:
n = int(input())
lim = [0]+[int(input()) for i in range(5)]+[0]
now = [n,0,0,0,0,0]
t = 0

def f(t_a,lim,now):
     for i in range(6):
          if t_a-i >= 0:
               now[i] += lim[i]*(t_a+1-i)-lim[i+1]*(t_a-i)
               if now[i]<0:
                    now[i]=0
     return now

def move(town1,lim,now):
     if now[town1] <= lim[town1+1]:
          now[town1+1] += now[town1]
          now[town1] = 0
     else:
          now[town1] -= lim[town1+1]
          now[town1+1] += lim[town1+1]
     return now

for i in range(5):
     t_a = now[i]//lim[i+1]
     now = f(t_a,lim,now)
     t += t_a
     for j in range(5):
          now = move(4-i,lim,now)
     t += 1
print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    M = []
    for _ in range(5):
        M.append(int(input()))
    x = min(M)
    if x > N:
        print(5)
    else:
        print(N // x + N % x - 1 + 5)


main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as ddic
from collections import deque
from itertools import combinations, permutations, product
import bisect
import heapq
import math
import sys

stdout = sys.stdout
rr = lambda: input().strip()
rri = lambda: int(rr())
rrm = lambda: list(map(int, rr().split()))


n = rri()
a = rri()
b = rri()
c = rri()
d = rri()
e = rri()

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

plus = n // tiny
if n <= max([a,b,c,d,e]):
    plus = 0

print(5 + plus)

Submission status: Wrong Answer

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

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

mint = min(lim)

print(n//mint+5)

Submission status: Wrong Answer

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

P = [0]*5
P[0] = capa[0]
No_G = [0]*5
No_G[0] = math.ceil(N/capa[0])
time = 4 + No_G[0]
for j in range(3):
    if capa[j+1]<capa[j]:
        if P[j]>capa[j+1]:
            No_G[j+1] = math.ceil(N/capa[j+1])
            P[j+1] = capa[j+1]
            time += No_G[j+1] - No_G[j]
        else:
            P[j+1] = P[j]
    else:
        P[j+1] = P[j]
print(time)

Submission status: Wrong Answer

Solution code:
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
 
N, *num = [int(input()) for i in range(6)]
min = sorted(num)[0]

print(N//min + 5)

Submission status: Wrong Answer

Solution code:
input_lines = input().split()
N = int(input_lines[0])
min_value = 10 ** 15
for i in range(5):
    input_lines = input().split()
    value = int(input_lines[0])
    if value < min_value:
        min_value = value
print(int(N / min_value) + 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())
if N < min(A,B,C,D,E):
    print(N)
else:
    print(5 + N //min(A,B,C,D,E))

Submission status: Wrong Answer

Solution code:
import numpy as np

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

# status=np.array([n,0,0,0,0,0])
# end=np.array([0,0,0,0,0,n])
# t=0

# while (status==end).all()==False:
#     A=min(a,status[0])
#     B=min(b,status[1])
#     C=min(c,status[2])
#     D=min(d,status[3])
#     E=min(e,status[4])
#     status=status-np.array([A,B-A,C-B,D-C,E-D,-E])
#     t+=1
#     # print(status)

# print(t)

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

if n<=m:
    print(5)
else:
    print(n//m+1+4)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []
while True:
    try:
        a.append(int(input()))
    except:
        break

bt = min(a)
bt_i = a.index(bt)
t = N // bt + 1 + 4
print(t)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import bisect
from collections import deque
from collections import defaultdict
from fractions import gcd
#from math import factorial
from math import sqrt
from math import ceil
from itertools import permutations
N=int(input())
A=[]
B=[]
mi=10**20
T=False
for i in range(5):
    a=float(input())
    mi=min(a,mi)
    A.append(a)
B.append(ceil(N/A[0]))
if A[0]==mi:
    T=True
for i in range(4):
    if T:
        B.append(B[i]+1)
        continue
    if A[i+1]<A[i]:
        B.append(B[i]-ceil(N/A[i])+ceil(N/A[i+1])+1)
        if A[i+1]==mi:
            T=True
    else:
        B.append(B[i]+1)
print(int(B[-1]))

Submission status: Wrong Answer

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

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

num_s = sorted(num)
if N % num_s[0] == 0:
    print(N / num_s[0] + 4)
else:
    print(int(N / num_s[0]+0.5) + 4)

Submission status: Wrong Answer

Solution code:
import math
import sys

def main():
    N = int(input())
    caps = [int(input()) for _ in range(5)]
    ans = 0
    n = N
    n_r = 0

    for c in caps:
        if c >= n and c >= n_r:
            ans += 1
            continue
        if ans == 0:
            ans = 1
        ans *= math.ceil(n/c) + math.ceil(n_r/c)
        n = c
        n_r = n%c

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np


def read():
    n = int(input().strip())
    capacities = np.empty((5, ), dtype=np.int64)
    for i in range(5):
        capacities[i] = int(input().strip())
    return n, capacities


def solve(n, capacities):
    return 5 + n // np.min(capacities)


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    # 最低これだけは利用しないといけない
    A_count = N // A + 0 if N % A == 0 else 1
    B_count = N // B + 0 if N % B == 0 else 1
    C_count = N // C + 0 if N % C == 0 else 1
    D_count = N // D + 0 if N % D == 0 else 1
    E_count = N // E + 0 if N % E == 0 else 1

    # 利用順序は関係ないので, 最大のところがボトルネックとなる
    max_count = max([A_count, B_count, C_count, D_count, E_count])

    # これにこれを最後に置くとして, 4回だけ増やす
    print(max_count + 4)


if __name__ == '__main__':
    main()

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

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


print(m + n//neck)

Submission status: Wrong Answer

Solution code:
N = int(input())
a=[]
for i in range(5):
    a.append(int(input()))
a_min = min(a)
if N%a_min == 0:
    print(4 + N/a_min)
else:
    print(5+ int(N/a_min))

Submission status: Wrong Answer

Solution code:
import numpy as np


def read():
    n = int(input().strip())
    capacities = np.empty((5, ), dtype=np.int32)
    for i in range(5):
        capacities[i] = int(input().strip())
    return n, capacities


def solve(n, capacities):
    return 5 + n // np.min(capacities)


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

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

time = 0
n = N

for i in range(5):
  time += max(math.ceil(n / abcde[i]), 1)
  if i < 4:
    n = (n % abcde[i]) + max(N - time * abcde[i+1], 0)

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
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) * t + after
  else:
    time += 1
print(time)

Submission status: Wrong Answer

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

P = [0]*5
P[0] = capa[0]
No_G = [0]*5
No_G[0] = math.ceil(N/capa[0])
time = 4 + No_G[0]
for j in range(3):
    if capa[j+1]<capa[j]:
        if P[j]>capa[j+1]:
            No_G[j+1] = math.ceil(N/capa[j+1])
            P[j+1] = capa[j+1]
            time += No_G[j+1] - No_G[j]
    else:
        P[j+1] = P[j]
print(time)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
List=[int(input()) for i in range(5)]
sList = sorted(List, reverse=True)
if sList[4]>=N:
  print(5)
else:
  print(round(N/sList[4])+5)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N, A, B, C, D, E = (int(input()) for i in range(6))
x = min([A, B, C, D, E])
ans = (N // x) + 5
print(ans)

Submission status: Wrong Answer

Solution code:
a = [int(input()) for _ in range(6)]
ans = 5
x = min(a[0], a[1])
if a[0] > a[1]:
    if a[0] % a[1] == 0:
        ans += a[0] // a[1] - 1
    else:
        ans += a[0] // a[1]

for i in a[2:]:
    if x > i:
        if x & i == 0:
            ans += x // i - 1
        else:
            ans += x // i
        x = i
print(ans)

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える

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

traffic_time.sort()

wait_time = n//traffic_time[0]
# print(wait_time)
if wait_time <= 1:
    wait_time = 0
if n%traffic_time[0] == 0:
    wait_time -= 1
print(wait_time+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
time = 1
people = int(input())
mass = []
for i in range(5):
    mass.append(int(input()))
city = [0]*5
city[0] = people

while city[4] < people:
    time += 1
    for i in range(4):
        t = min(mass[3-i],city[3-i])
        city[3-i] -= t
        city[4-i] += t

print(time)

Submission status: Wrong Answer

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

div_list = []
for i in range(5):
    data.append(int(input()))
    div_list.append(int(N/data[i])+1)
count = max(div_list)+4
print(count)

Submission status: Wrong Answer

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

time = 5
time = time + (t[0] // min(t) -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())

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

Submission status: Wrong Answer

Solution code:
n=int(input())
an=[int(input()) for _ in range(5)]
m = min(an)
if m == 1:
    print(n*2-1)
elif m > n:
    print(5)
else:
    print(n//min(an)+5)

Submission status: Wrong Answer

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

res = 0
for i in range(len(l)):
    if N > l[i]:
        res += int(N/l[i])
        N = l[i]

print(res+5)

Submission status: Wrong Answer

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

m = min(A)
times = 5 + (N // m)

print(times)

Submission status: Wrong Answer

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

div = min(a,b,c,d,e)
ans = n//div + 5

print(ans)

Submission status: Wrong Answer

Solution code:
import math
l=[int(input()) for i in range(5)]
t=0
N,*l=l
minl=min(l)
minidx=l.index(min(l))

if N>minl:
    t=math.ceil(N/float(minl))+1+3
else:
    t=5
print(t)

Submission status: Wrong Answer

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

P = [0]*5
P[0] = capa[0]
No_G = [0]*5
No_G[0] = math.ceil(N/capa[0])
time = 4 + No_G[0]
for j in range(3):
    if capa[j+1]<capa[j]:
        if P[j]>capa[j+1]:
            No_G[j+1] = math.ceil(N/capa[j+1])
            time += No_G[j+1] - No_G[j]
    else:
        P[j+1] = P[j]
print(time)