Problem:


Score: 300 points

Problem Statement

In 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!

There are five means of transport in this empire:

Train: travels from City 1 to 2 in one minute. A train can occupy at most A people.

Bus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.

Taxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.

Airplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.

Ship: travels from City 5 to 6 in one minute. A ship can occupy at most E people.

For each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).

There is a group of N people at City 1, and they all want to go to City 6.

At least how long does it take for all of them to reach there? 
You can ignore the time needed to transfer.  

Constraints

1 \leq N, A, B, C, D, E \leq 10^{15}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A
B
C
D
E

Output

Print the minimum time required for all of the people to reach City 6, in minutes.

Sample Input 1

5
3
2
4
3
5

Sample Output 1

7

One possible way to travel is as follows.
First, there are N = 5 people at City 1, as shown in the following image:

In the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.

In the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.

In the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.

From then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.

There is no way for them to reach City 6 in 6 minutes or less.

Sample Input 2

10
123
123
123
123
123

Sample Output 2

5

All kinds of vehicles can occupy N = 10 people at a time.
Thus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.  

Sample Input 3

10000000007
2
3
5
7
11

Sample Output 3

5000000008

Note that the input or output may not fit into a 32-bit integer type.



Sample input:
5
3
2
4
3
5


Sample output:
7

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#conding utf-8
N=int(input())
A=[int(input()) for i in range(5)]
if min(A)==1:
  print(int(N/min(A))+4)
else:
  print(int(N/min(A))+4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

t=0
x=np.argmin(A)

t+=x

t+=N//A[x]+1

t+=4-x

print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0]*5
for i in range(5):
    A[i] = 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())

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

time = 0
if N%X !=0:
    time += N//X +5
else:
    time += N//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())

time = 0
if N%A !=0:
    time += N//A +1
    N= N%A
else:
    time += N//A
    N= A

if N%B !=0:
    time += N//B +1
    N= N%B
else:
    time += N//B
    N= B

if N%C !=0:
    time += N//C +1
    N= N%C
else:
    time += N//C
    N= C

if N%D !=0:
    time += N//D +1
    N= N%D
else:
    time += N//D
    N= D

if N%E !=0:
    time += N//E +1
    N= N%E
else:
    time += N//E
    N= E

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
time += N//A +1
NA= N%A
time += NA//B +1
NAB= NA%B
time += NAB//C +1
NABC= NAB%C
time += NABC//D +1
NABCD= NABC%D
time += NABCD//E +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())
lis = [a, b, c, d, e]
x = min(lis)
if n%x == 0:
    x = n/x
else:
    x = n//x + 1
print(5 + x-1)

Submission status: Wrong Answer

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

def main():
    n = int(input())
    bn = 10**16
    for i in range(5):
        bn = min(bn, int(input()))
    print(n // bn + 5)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

neck = min(ABCDE)
neck_index = ABCDE.index(neck)

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

Submission status: Wrong Answer

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

neck = min(ABCDE)
neck_index = ABCDE.index(neck)

ans = neck_index + (N // neck + 1) + (4 - neck_index)

print(ans)

Submission status: Wrong Answer

Solution code:
n,*p=map(int,open(0));t=5
for p in p:t+=n//p;n=min(n,p)
print(t)

Submission status: Wrong Answer

Solution code:
n = int(input())
trans = sorted(list(int(input()) for _ in range(5)))

if n > trans[0]:
    ans = n // trans[0] + 5
    print(ans)
else:
    print(5)

Submission status: Wrong Answer

Solution code:
n = int(input())
trans = sorted(list(int(input()) for _ in range(5)))

ans = n // trans[0] + 5
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [0] * 5
min_p = 10 ** 12
mi = -1
for i in range(5):
    arr[i] = int(input())
    if arr[i] < min_p:
        min_p = arr[i]
        mi = i

import math
print(4 + math.ceil(n / min_p))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [0] * 5
min_p = 10 ** 12
mi = -1
for i in range(5):
    arr[i] = int(input())
    if arr[i] < min_p:
        min_p = arr[i]
        mi = i

import math
print((6 - mi) + math.ceil(n / min_p) -2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
for i in range(5):
    ans+=1
    a=int(input())
    A=int(N//a)+1
    ans=max(ans,A+i)
print(ans)

Submission status: Wrong Answer

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

po=[0]*5

for i in range(5):
    po[i]=N//A[i]

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

Submission status: Wrong Answer

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

m = min(ride)
print(n, ride)

print(4 + (n+m-1)//m)

Submission status: Wrong Answer

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

t = 0

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

Submission status: Wrong Answer

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

ans = 0

ans += (N + A - 1) // A
ans += (min(N, A) + B - 1) // B
ans += (min(N, A, B) + C - 1) // C
ans += (min(N, A, B, C) + D - 1) // D
ans += (min(N, A, B, C, D) + E - 1) // E

print(ans)

Submission status: Wrong Answer

Solution code:
N,A,B,C,D,E = [int(input()) for i in range(6)]

cities = [N] + [0]*5
#print(cities)
trans = [A,B,C,D,E]
#print(trans)
cnt=0
while cities[5] < N:
  for i in [4,3,2,1,0]:
    if cities[i] >0:
      if cities[i] % trans[i] == 0:
        cities[i+1] += trans[i]
        cities[i] -= trans[i]
      else:
        cities[i+1] += cities[i] % trans[i]        
        cities[i] -= cities[i] % trans[i]
  cnt +=1
  #print(cnt, cities)
print(cnt)

Submission status: Wrong Answer

Solution code:
#n=int(input())
#n,m=map(int,input().split())
#sl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

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

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

print(n//mn+1+4)

Submission status: Wrong Answer

Solution code:
import sys
from bisect import bisect_left,bisect_right,insort
input = sys.stdin.readline

def main():
    n=int(input())
    x=[int(input()) for _ in range(5)]
    print(int(n//min(x)+5))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
from bisect import bisect_left,bisect_right,insort
input = sys.stdin.readline

def main():
    n=int(input())
    x=[0]*5
    for i in range(5):
        x[i]=int(input())
    minx=min(x)
    p=n//minx
    print(5+p)

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())
from math import floor
print(4+floor(n/min(a,b,c,d,e)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

m = min(q)

print(N//m+5)

Submission status: Wrong Answer

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

status = [0 for i in range(6)]
status[0] = n
status.reverse()

print(mov)
print(status)

count = 0
while True:
    count += 1
    for i in range(1,len(status)):
        status[i-1] += min(status[i],mov[i-1])
        status[i] -= min(status[i],mov[i-1])
    if status[0]==n:
        print(count)
        exit()
    elif status[-1]==0:
        status.pop(-1)
        mov.pop(-1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import math
n = int(input())
capa = [int(input()) for _ in range(5)]
print(5+math.ceil(n//min(capa)))

"""
ans = 4 #１セキで行けた時のタイム
real_pas = 10*15+1 # i に来るまでの一隻あたりの乗客数
ship_num = 1 #　合計で何回輸送するか？= 時間
for i in range(5):
    if capa[i] > real_pas:
        pass
    else:
        ship_num = math.ceil(n/capa[i])
        real_pas = capa[i]
        #print(i,ship_num,real_pas)
print(ans+ship_num)"""

Submission status: Wrong Answer

Solution code:
n = int(input())
abc = []
ans = 0

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

minabc = min(abc)
ans += n//minabc

if minabc >= n :
    print(5)
else :
    print(5 + ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
abc = []
ans = 0

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

minabc = min(abc)

ans += n//minabc + n%minabc
print(4 + ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
abc = []
ans = 0

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

minabc = min(abc)

ans += n//minabc
print(5 + 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())

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

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
l=[0]*5
for i in range(5):
  l[i]=int(input())
l.sort()
if l[0]>n:
  print(5)
else:
  print(math.ceil(n//l[0])+4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a=[int(input()) for _ in range(6)]
flag=a.index(min(a))
ans=5-flag
for i in range(flag):
    ans+=math.ceil(a[i]/a[i+1])
print(ans)

Submission status: Wrong Answer

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

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

mi = min(a_d)

print(n//mi+1+4)

Submission status: Wrong Answer

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

N = int(input().strip())
pas_list = [int(input().strip()) for _ in range(5)]

count = (N // min(pas_list) + 1) -1+5
print(count)

Submission status: Wrong Answer

Solution code:
N, A, B, C, D, E = [int(input()) for _ in range(6)]
m = min(A, B, C, D, E)
print(N//m + 1 + 4)

Submission status: Wrong Answer

Solution code:
from math import ceil
n, *A = map(int, open(0).readlines())
print(5 + max(ceil(n / a) for a in A))

Submission status: Wrong Answer

Solution code:
import math

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

t_list = [A, B, C, D, E]
min_t = 10*20
min_i = 0
for i in range(5):
    min_t = min(min_t, t_list[i])

t_1 = math.ceil(N/min_t)
t_1 = int((N+min_t-1) / min_t)
print(t_1+4)

Submission status: Wrong Answer

Solution code:
import math

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

t_list = [A, B, C, D, E]
min_t = 10*18
min_i = 0
for i in range(5):
    if t_list[i]<min_t:
        min_i = i
        min_t = t_list[i]

t_1 = int((N+min_t-1) / min_t)
print(t_1+4)

Submission status: Wrong Answer

Solution code:
import math

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

t_list = [A, B, C, D, E]
min_t = 10*18
min_i = 0
for i in range(5):
    if t_list[i]<min_t:
        min_i = i
        min_t = t_list[i]

t_1 = math.ceil(N/min_t)
print(t_1+4)

Submission status: Wrong Answer

Solution code:
import math

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

t_list = [A, B, C, D, E]
min_t = 10*16
min_i = 0
for i in range(5):
    if t_list[i]<min_t:
        min_i = i
        min_t = t_list[i]

t_1 = math.ceil(N/min_t)
t_2 = 6 - (min_i+2)
print(min_i+t_1+t_2)

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

t_list = [A, B, C, D, E]
min_t = 10*16
min_i = 0
for i in range(5):
    if t_list[i]<min_t:
        min_i = i
        min_t = t_list[i]

t_1 = math.ceil(N/min_t)
t_2 = 5 - (min_i+1)
print(min_i+t_1+t_2)

Submission status: Wrong Answer

Solution code:
N = int(input())
carry = [int(input()) for _ in range(5)]
min_carry = min(carry)
print((N + min_carry - 1) / min_carry + 4)

Submission status: Wrong Answer

Solution code:
import math
def main():
    N=int(input())
    A=int(input())
    B=int(input())
    C=int(input())
    D=int(input())
    E=int(input())
    min_num=N+1
    for i in (A,B,C,D,E):
        min_num=min(i,min_num)
    print(math.ceil(N/min_num)+1+4)
    
if __name__=="__main__":
    main()

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())
    min_num=N+1
    for i in (A,B,C,D,E):
        min_num=min(i,min_num)
    print((N//min_num+1)+4)
    
if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
# 2020/02/22
# AtCoder Beginner Contest 123 - C

# Input
n = int(input())
ae = list()
for i in range(5):
    ae.append(int(input()))

# Calc
ans = n // min(ae) + 5

# Output
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
MIN = float("inf")
for _ in range(5):
    MIN = min(MIN, int(input()))

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())
time =0
amin = min(a,b,c,d,e)
print(amin)
time=(n//amin+1 if n%amin != 0 else n/amin)+4
print(int(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
amin = min(a,b,c,d,e)
time=(n//amin+1 if n%amin != 0 else n/amin)+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())
time =0
amin = min(a,b,c,d,e)
time=(n//amin+1 if n%a != 0 else n/amin)+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())
time =0
amin = min(a,b,c,d,e)
time=(n//amin+1 if n%a != 0 else n/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())
time =0
amin = min(a,b,c,d,e)
time=(n//amin+1)+4
print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
toshi = []
for i in range(5):
    toshi.append(int(input()))
#ここまで入力
mn = min(toshi)
ans = n//mn+5
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
toshi = []
for i in range(5):
    toshi.append(int(input()))
#ここまで入力
mn = min(toshi)
ans = n//mn+6
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
toshi = []
for i in range(5):
    toshi.append(int(input()))
#ここまで入力
mn = min(toshi)
ans = n//mn+1
print(ans+4)

Submission status: Wrong Answer

Solution code:
import math

def solve():
    N = int(input())
    ABCDE = []
    for _ in range(5):
        ABCDE.append(int(input()))
        
    min_ = min(ABCDE)
    
    print(math.floor(N/min_)+5)
    
solve()

Submission status: Wrong Answer

Solution code:
N = int(input())
mati = [int(input()) for _ in range(5)]
print(N//min(mati)+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=min(A,B,C,D,E)
print(N//X+5)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(input()) for _ in [0] * 5]

print(int(n / min(l)) + 1 + 4)

Submission status: Wrong Answer

Solution code:
n,*L = map(int,open(0).read().split())

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

Submission status: Wrong Answer

Solution code:
n,*L = map(int,open(0).read().split())

print(n//min(L) + len(L))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(n, xs):

   # 5
   #   3 2 4 3 5
   # [5,0,0,0,0,0]

   # [2,3,0,0,0,0]

   # [0,3,2,0,0,0]
   # [0,1,2,2,0,0]
   # [0,0,1,2,2,0]
   # [0,0,0,1,2,2]

   # [0,0,0,0,1,4]
   # [0,0,0,0,0,5]
    min_lim_cost = 10**15+1
    min_lim_pos = -1
    for i in range(5):
        if xs[i] < min_lim_cost:
            min_lim_pos = i
            min_lim_cost = xs[i]

    init_cost = min_lim_pos
    init_reach =  5 - min_lim_pos
    final_reach = (n-min_lim_cost)//min_lim_cost + 1

#    print(min_lim_cost,
#          min_lim_pos,
#          init_cost,
#          init_reach,
#          final_reach)
    return init_cost+init_reach+final_reach


if __name__ == '__main__':
    n = int(input())
    xs= []
    for _ in range(5):
        xs.append(int(input()))
    print(solve(n, xs))

Submission status: Wrong Answer

Solution code:
N=int(input())
P=[0]*5
count=0
for i in range (5):
	P[i]=int(input())
for i in range (5):
	if P[i]>=N:
		count+=1
if count==5:
	print(5)
else:
	Q=sorted(P)
	R=N//Q[0]
	print(R+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(5)]
t = [-(-n//i) for i in a]
max_t = max(t)
max_i = t.index(max_t)
print(max_t+(min(4,5-max_i)))

Submission status: Wrong Answer

Solution code:
import math
N, AE = int(input()), [int(input()) for _ in range(5)]
print(math.ceil(min(AE)) + 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())

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
p = []
for i in range(5):
    p.append(int(input()))
ans = 0
for i in range(5):
    t = i + (n+p[i])//p[i]
    if t > ans:
        ans += t - ans
    else:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n,*l=map(int,open(0).read().split())
print(n+math.ceil(n/min(l)))

Submission status: Wrong Answer

Solution code:
import math
n,*l=map(int,open(0).read().split())
print(n+math.ceil(n//min(l)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n,a,b,c,d,e=map(int,open(0).read().split())
aa=n
bb=cc=dd=ee=0
mins=0
while ee<n:
#for i in range(7):    
    mins+=1
    if dd-d >= 0:
        ee+=d
        dd-=d
    else:
        ee+=dd
        dd=0
    if cc-c >= 0:
        dd+=c
        cc-=c
    else:
        dd+=cc
        cc=0
    if bb-b >= 0:
        cc+=b
        bb-=b
    else:
        cc+=bb
        bb=0
    if aa-a >=0:
        bb+=a
        aa-=a
    else:
        bb+=aa
        aa=0
print(mins+1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import math
n = int(input())
capa = [int(input()) for _ in range(5)]
ans = 4 #１セキで行けた時のタイム
real_pas = 10*15+1 # i に来るまでの一隻あたりの乗客数
ship_num = 1 #　合計で何回輸送するか？= 時間
for i in range(5):
    if capa[i] > real_pas:
        pass
    else:
        ship_num = math.ceil(n/capa[i])
        real_pas = capa[i]
        #print(i,ship_num,real_pas)
print(ans+ship_num)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(5)]
amin=min(a)
a1=int(n/amin+1)+4
print(a1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
people = np.array([int(input()) for _ in range(5)])
print(5 + n // min(people))

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

t = 0

t += math.ceil(N / A)

t += math.ceil(A / B)
t += math.ceil(B / C)
t += math.ceil(C / D)
t += math.ceil(D / E)

print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N, A, B, C, D, E = [int(input()) for _ in range(6)]
print(N, A, B, C, D, E)
print(math.ceil(N / min(A, B, C, D, E)) + 4)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

print(math.ceil(n // min([a,b,c,d,e])) + 4)

Submission status: Wrong Answer

Solution code:
import math

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

print(math.floor(n // min([a,b,c,d,e])) + 4)

Submission status: Wrong Answer

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

arrived_time = N//ABCDE[0] + 1
for i in range(4):
  if ABCDE[i] <= ABCDE[i+1]:
    arrived_time += 1
  else:
    num_left = N - (N//ABCDE[i]) * ABCDE[i+1]
    arrived_time += num_left//ABCDE[i+1]+1
    ABCDE[i+1] = ABCDE[i]

print(arrived_time)

Submission status: Wrong Answer

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

start_time = 0
arrived_time = N//ABCDE[0] + 1
for i in range(4):
  if ABCDE[i] <= ABCDE[i+1]:
    arrived_time += 1
  else:
    num_left = N - (N//ABCDE[i]) * ABCDE[i+1]
    arrived_time += num_left//ABCDE[i+1]+1

print(arrived_time)

Submission status: Wrong Answer

Solution code:
import math

def ceil(n,m):
    return int(math.ceil(n/m))

N = int(input())
A = []

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

ans = 0
remnant = N
time = 0

for i in range(5):
    if i == 0:
        time = ceil(N,A[i])
        ans += time
    else:
        remnant = min(N-A[i]+A[i-1],((time-1)*A[i-1] + remnant%A[i-1]) - (time-1)*A[i])
        time = max(1,ceil(remnant,A[i]))
        ans += time


print(ans)

Submission status: Wrong Answer

Solution code:
import math

def ceil(n,m):
    return int(math.ceil(n/m))

N = int(input())
A = []

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

ans = 0
remnant = N
time = 0

for i in range(5):
    if i == 0:
        time = ceil(N,A[i])
        ans += time
    else:
        remnant = ((time-1)*A[i-1] + remnant%A[i-1]) - (time-1)*A[i]
        time = max(1,ceil(remnant,A[i]))
        ans += time


print(ans)

Submission status: Wrong Answer

Solution code:
# むずかしい

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    times = []
    for _ in range(5):
        times.append(int(input()))
    min_capacity = min(times)
    if N <= min_capacity:
        print(5)
    else:
        print(5 + N // min_capacity)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


for i in range(len(traffics)-1):
    if traffics[i] < traffics[i+1]:
        traffics[i+1] = traffics[i]
print(5+n//traffics[-1])

Submission status: Wrong Answer

Solution code:
N, A, B, C, D, E = [int(input()) for _ in range(6)]

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

print(N // s + 5)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for _ in range(5)]
ret = (n + a[0] - 1) // a[0]
prev = ret
for i in range(1, 5):
    times = (n + a[i] - 1) // a[i]
    ret += max(0, times - prev) + 1
    prev = times
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
min1=11**15
for i in range(5):
    a=int(input())
    min1=min(min1,a)
print((n//min1+1)+4)

Submission status: Wrong Answer

Solution code:
n=int(input())
min1=9999999999999999999
for i in range(5):
    a=int(input())
    min1=min(min1,a)
print((n//min1+1)+4)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(10**15+1)
for _ in range(5):
  b=int(input())
  a=min(a,b)
print(5+(n//a))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=1000000
for _ in range(5):
  b=int(input())
  a=min(a,b)
print(5+(n//a))

Submission status: Wrong Answer

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

min_id = v.index(min(v))
ans = 5 + (n + 1) // v[min_id]

print(int(ans))

Submission status: Wrong Answer

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

min_id = v.index(min(v))
ans = 5 + (n + 0.5) // v[min_id]

print(int(ans))

Submission status: Wrong Answer

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

min_id = v.index(min(v))
ans = 5 + n+1 // v[min_id]

print(ans)

Submission status: Wrong Answer

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

min_id = v.index(min(v))
ans = 5 + n // v[min_id]

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
minnum=9999999999999999999999999
for _ in range(5):
    a= int(input())
    if a<minnum:
        minnum=a

print(n//minnum+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ss=n
l=[]
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
t=0
bb,cc,dd,ee,ff=0,0,0,0,0
while ff==0:
    if ee>0:
        ff+=min(ee,e)
        ee-=min(ee,e)
    if dd>0:
        ee+=min(dd,d)
        dd-=min(dd,d)
    if cc>0:
        dd+=min(cc,c)
        cc-=min(cc,c)
    if bb>0:
        cc+=min(bb,b)
        bb-=min(bb,b)
    if n>0:
        bb+=min(n,a)
        n-=min(n,a)
    t+=1
if ss==ff:
    print(t)
else:
    print(ss//ff+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
ss=n
l=[]
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
t=0
bb,cc,dd,ee,ff=0,0,0,0,0
while ff==0:
    if ee>0:
        ff+=min(ee,e)
        ee-=min(ee,e)
    if dd>0:
        ee+=min(dd,d)
        dd-=min(dd,d)
    if cc>0:
        dd+=min(cc,c)
        cc-=min(cc,c)
    if bb>0:
        cc+=min(bb,b)
        bb-=min(bb,b)
    if n>0:
        bb+=min(n,a)
        n-=min(n,a)
    t+=1
if ss==ff:
    print(t)
else:
    print(ss//ff+t)