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 _*_

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

flow = min([a, b, c, d, e])
ans = 5 + n // flow

print(ans)

Submission status: Wrong Answer

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

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

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

ans = 4 + n // flow + n % flow

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

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

time = math.ceil(N//min(data)) + 4

print(time)

Submission status: Wrong Answer

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

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

time = N//min(data) + 5

print(time)

Submission status: Wrong Answer

Solution code:
a = input()
s = input()
d = input()
f = input()
g = input()
h = input()
j = min(int(s), int(d), int(f), int(g), int(h))

k = int(a)//j + 5

for i in str(k):
    print(i, end ='')

Submission status: Wrong Answer

Solution code:
a = input()
s = input()
d = input()
f = input()
g = input()
h = input()
j = min(int(s), int(d), int(f), int(g), int(h))
print(int(a)//j + 5)

Submission status: Wrong Answer

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

min_n = min(nums)

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

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

modtrans = [n//i + 1 for i in trans]

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

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

modtrans = [n//i for i in trans]

print(max(modtrans) + 5)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(5)]
T = [int((N+A[i]-1)//A[i]) for i in range(5)]
ans = T[0]
for i in range(1, 5):
    ans += max(T[i]-T[i-1], 0) + 1
print(ans)

Submission status: Wrong Answer

Solution code:
numberOfToorists = int(input())

minimumCapacity = 10.0**16

for i in range(5):
	vehicleCapacity = int(input())
	minimumCapacity = min(minimumCapacity, vehicleCapacity)

bottleNeckTime = numberOfToorists / vehicleCapacity
if numberOfToorists % vehicleCapacity > 0:
	bottleNeckTime += 1

requiredTime = bottleNeckTime + 4

print(requiredTime)

Submission status: Wrong Answer

Solution code:
import math
if __name__ =="__main__":
    N = input()
    N = float(N)-1
    cap_min=10.0*15
    for x in range(5):
        a = input()
        cap_min = min(float(a),cap_min)
    time = math.ceil(N/cap_min)+4
    print(time)

Submission status: Wrong Answer

Solution code:
import math
if __name__ =="__main__":
    N = input()
    N = float(N)
    cap_min=10.0*15
    for x in range(5):
        a = input()
        cap_min = min(float(a),cap_min)
    time = math.ceil(N/cap_min)+4
    print(time)

Submission status: Wrong Answer

Solution code:
import math
if __name__ =="__main__":
    N = input()
    N = int(N)
    cap_min=10*15
    for x in range(5):
        a = input()
        cap_min = min(int(a),cap_min)
    time = math.ceil(N/cap_min)+4
    print(time)

Submission status: Wrong Answer

Solution code:
if __name__ =="__main__":
    N = input()
    N = int(N)
    cap_min=10*15
    for x in range(5):
        a = input()
        cap_min = min(int(a),cap_min)
    time = int(N/cap_min)+1+4
    print(time)

Submission status: Wrong Answer

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


y = min(x)
if N%y==0:
    print(4+N/y)
else:
    print(4+N//y+1)

Submission status: Wrong Answer

Solution code:
data = [int(input()) for i in range(6)]
print(-(-data[0]//min(data[1:])+4))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def main():
    input = sys.stdin.readline
    n = float(input())
    tr = [float(input().replace('\n', '')) for i in range(5)] #なんで改行入るの 
    
    print( int(5 + (0 if n == min(tr) else n // min(tr))) )
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    tr = [int(input().replace('\n', '')) for i in range(5)] #なんで改行入るの   
    
    print( 5 + (0 if n == min(tr) else n // min(tr)) )
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    tr = [int(input().replace('\n', '')) for i in range(5)] #なんで改行入るの   
    
    print(5 + (0 if n == 1 else n // min(tr)))
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    tr = [int(input().replace('\n', '')) for i in range(5)] #なんで改行入るの   
    
    print( 5 + (n // min(tr)) )
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = n//capa_min + 5

if n <= capa_min:
    amari = 0
else:
    amari = n % capa_min

# 人数が割り切れたら
# if amari != 0:
#     ans -= 1
    
print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = math.floor(n/capa_min) + 5

if n < capa_min:
    amari = 0
else:
    amari = n % capa_min

# 人数が割り切れたらそれが答え
if amari != 0:
    # # 割り切れなかったら余りから残りの移動に要する時間を算出
    # # ゴールに近いほうから計算するために逆順でループ
    # for i in reversed(range(len(capa))):
    #     # ans += math.floor(amari / capa[i])
    #     if amari % capa[i] == 0:
    #         ans += i
    #         break
    #     else:
    #         amari = amari % capa[i]
    
    # 割り切れなかったら、運べる人数が一番少ないところからゴールまでを足せばいいのか
    # ゴールに近いほうから計算するために配列の順番を逆に
    capa.sort(reverse=True)
    for i in range(len(capa)):
        if capa[i] <= amari:
            ans += i+1 
            break

print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = math.floor(n/capa_min) + 5
amari = n % capa_min

# 人数が割り切れたらそれが答え
if amari != 0:
    # 割り切れなかったら余りから残りの移動に要する時間を算出
    # ゴールに近いほうから計算するために逆順でループ
    for i in reversed(range(len(capa))):
        # ans += math.floor(amari / capa[i])
        if amari % capa[i] == 0:
            ans += i
            break
        else:
            amari = amari % capa[i]

print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = math.floor(n/capa_min) + 5
amari = n % capa_min

# 人数が割り切れたらそれが答え
if amari != 0:
    # 割り切れなかったら余りから残りの移動に要する時間を算出
    # ゴールに近いほうから計算するために逆順でループ
    for i in reversed(range(len(capa))):
        ans += math.floor(amari / capa[i])
        if amari % capa[i] == 0:
            ans += i
            break
        else:
            amari = amari % capa[i]

print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = math.floor(n/capa_min) + 5
amari = n % capa_min

# 人数が割り切れたらそれが答え
if amari != 0:
    # 割り切れなかったら余りから残りの移動に要する時間を算出
    # ゴールに近いほうから計算するために逆順でループ
    for i in reversed(range(len(capa))):
        ans += math.floor(amari / capa[i])
        if amari % capa[i] == 0:
            ans += i
            break

print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = math.floor(n/capa_min) + 5
amari = n % capa_min

# 人数が割り切れたらそれが答え
if amari != 0:
    # 割り切れなかったら余りから残りの移動に要する時間を算出
    # ゴールに近いほうから計算するためにcapaを逆順にする
    capa.sort(reverse = True)
    for i in range(len(capa)):
        ans += math.floor(amari / capa[i])
        if amari % capa[i] == 0:
            ans += i + 1
            break

print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = math.floor(n/capa_min) + 5
amari = n % capa_min

# 人数が割り切れたらそれが答え
if amari != 0:
    # 割り切れなかったら余りから残りの移動に要する時間を算出
    # ゴールに近いほうから計算するためにcapaを逆順にする
    capa.sort(reverse = True)
    for i in range(len(capa)):
        ans += math.floor(amari / capa[i]) + i
        if amari % capa[i] == 0:
            # ans += i
            break

print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = math.floor(n/capa_min) + 5
amari = n % capa_min

# 人数が割り切れたらそれが答え
if amari != 0:
    # 割り切れなかったら余りから残りの移動に要する時間を算出
    # ゴールに近いほうから計算するためにcapaを逆順にする
    capa.sort(reverse = True)
    for i in range(len(capa)):
        ans += math.floor(amari / capa[i])
        if amari % capa[i] == 0:
            ans += i
            break

print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import copy
import math

# 整数の入力
n = int(input())

capa = []

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

# 各交通機関のうち、運べる人数が一番少ないものをベースとする
capa_min = min(capa)

ans = math.floor(n/capa_min) + 5
amari = n % capa_min

# 人数が割り切れたらそれが答え
if amari != 0:
    # 割り切れなかったら余りから残りの移動に要する時間を算出
    # ゴールに近いほうから計算するためにcapaを逆順にする
    capa.sort(reverse = True)
    for i in range(len(capa)):
        ans += math.floor(amari / capa[i])
        if amari % capa[i] == 0:
            break

print (str(ans))



# 以下の処理だとタイムオーバーになるからNG
# toshi = [n,0,0,0,0,0]
# next_toshi = copy.deepcopy(toshi)
# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1
#     for i in range(len(toshi)-1):
#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))
#     toshi = copy.deepcopy(next_toshi)
#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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


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

lenx = len(x)
for k in range(4):
    for w in range(lenx-1):
        cnt=0
        if x[w] <= x[w+1] :
            del x[w+1]
            lenx -=1
            break
        else:
            cnt+=1
            
ans=0
if lenx==0:
    print(5)
else:
    if N%x[0]==0:
        ans+=N/x[0]
    else:
        ans+=N//x[0]+1

    for p in range(1,lenx):
        d = N-(ans-p)*x[p]
        if d%x[p] == 0:
            ans+=d/x[p]
        else:
            ans+=d//x[p]+1

    print(ans+5-lenx)

Submission status: Wrong Answer

Solution code:

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


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

lenx = len(x)
while(0):
    for w in range(lenx-1):
        cnt=0
        if x[w] >= x[w+1] :
            del x[w+1]
            lenx -=1
        else:
            cnt+=1
            
    if cnt==lenx:
        break
        

ans=0
if lenx==0:
    print(5)
else:
    if N%x[0]==0:
        ans+=N/x[0]
    else:
        ans+=N//x[0]+1

    for p in range(1,lenx):
        d = N-(ans-p)*x[p]
        if d%x[p] == 0:
            ans+=d/x[p]
        else:
            ans+=d//x[p]+1

    print(ans+5-lenx)

Submission status: Wrong Answer

Solution code:

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


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

lenx = len(x)
ans=0
if lenx==0:
    print(5)
else:
    if N%x[0]==0:
        ans+=N/x[0]
    else:
        ans+=N//x[0]+1

    for p in range(1,lenx):
        d = N-(ans-p)*x[p]
        if x[i] >= x[i-1]:
            ans+=1
        elif d%x[p] == 0:
            ans+=d/x[p]
        else:
            ans+=d//x[p]+1

    print(ans+5-lenx)

Submission status: Wrong Answer

Solution code:

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


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

lenx = len(x)
ans=0
if lenx==0:
    print(5)
else:
    if N%x[0]==0:
        ans+=N/x[0]
    else:
        ans+=N//x[0]+1

    for p in range(1,lenx):
        d = N-(ans-p)*x[p]
        if d%x[p] == 0:
            ans+=d/x[p]
        else:
            ans+=d//x[p]+1

    print(ans+5-lenx)

Submission status: Wrong Answer

Solution code:

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


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

lenx = len(x)
ans = [0]*lenx
if lenx==0:
    print(5)
else:
    if N%x[0]==0:
        ans[0]=N/x[0]-1
    else:
        ans[0]=N//x[0]

    for p in range(1,lenx):
        d = N-x[i]*(sum(ans)-i+1)
        if d%x[i] == 0:
            ans[i]=d/x[i]-1
        else:
            ans[i]=d//x[i]

    print(5+sum(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
p=[0]*5
for i in range(5):
    p[i]=int(input())
p.sort()
ans=5+(n-n%p[0])/p[0]
print(int(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
p=[0]*5
for i in range(5):
    p[i]=int(input())
p.sort()
ans=5+(n-n%p[0])/p[0]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
p=[0]*5
for i in range(5):
    p[i]=int(input())
p.sort()
if n<=p[0]:
    ans=5
else:
    ans=(n-n%p[0])/p[0]+5
print(ans)

Submission status: Wrong Answer

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

r = 0
min = a[0]
for i in range(5):
  if min > a[i]:
    min = a[i]
    
r += int(n / min + 1) + 4
print (r)

Submission status: Wrong Answer

Solution code:

N = int(input())
x = [int(input()) for i in range(5)]
ans = [0]*5
if N%x[0]==0:
    ans[0] =  N//x[0]
else:
    ans[0] =  N//x[0] + 1

j = False
if x[0] == min(x):
    print(ans[0]+4)
else:

    for i in range(1,5):
        if j:
           break
        elif x[i] == min(x[i:]):
            j = True
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        elif x[i] < x[i-1]:
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        else:
            ans[i] =1 

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

Submission status: Wrong Answer

Solution code:

N = int(input())
x = [int(input()) for i in range(5)]
ans = [0]*5
if N%x[0]==0:
    ans[0] =  N//x[0]
else:
    ans[0] =  N//x[0] + 1

j = False
if x[0] == min(x):
    print(ans[0]+4)
else:

    for i in range(1,5):
        if j:
           break
        elif x[i] == min(x[i:]):
            j = True
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        elif x[i] <= x[i-1]:
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        else:
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i-1]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i-1]*(ans[i-1]-1)))//x[i] + 1


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

Submission status: Wrong Answer

Solution code:

N = int(input())
x = [int(input()) for i in range(5)]
ans = [0]*5
if N%x[0]==0:
    ans[0] =  N//x[0]
else:
    ans[0] =  N//x[0] + 1

j = False
if x[0] == min(x):
    print(ans[0]+4)
else:

    for i in range(1,5):
        if j:
           break
        elif x[i] == min(x[i:]):
            j = True
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        elif x[i] < x[i-1]:
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        else:
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i-1]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i-1]*(ans[i-1]-1)))//x[i] + 1


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

Submission status: Wrong Answer

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

r = 0
min = a[0]
for i in range(5):
  if min > a[i]:
    min = a[i]

  if a[i] <= min:
    r += int(a[i] / a[i+1] + 1)
  else:
    r += 1
    
print (r)

Submission status: Wrong Answer

Solution code:

N = int(input())
x = [int(input()) for i in range(5)]
ans = [0]*5
if N%x[0]==0:
    ans[0] =  N//x[0]
else:
    ans[0] =  N//x[0] + 1

j = False
if x[0] == min(x):
    print(ans[0]+4)
else:

    for i in range(1,5):
        if j:
           break
        elif x[i] == min(x[i:]):
            j = True
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        else:
            if (N-(x[i]*(ans[i-1]-1)))%x[i] == 0:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i]
            else:
                ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1

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

Submission status: Wrong Answer

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

j = False
if x[0] == min(x):
    print(ans[0]+4)
else:

    for i in range(1,5):
        if j:
           break
        elif x[i] == min(x[i:]):
            j = True
            ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        else:
            ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1

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

Submission status: Wrong Answer

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

    for i in range(1,5):
        if j:
           break
        elif x[i] == min(x[i:]):
            j = True
            ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1
        else:
            ans[i] = (N-(x[i]*(ans[i-1]-1)))//x[i] + 1

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

Submission status: Wrong Answer

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

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

print(sum(ans))

Submission status: Wrong Answer

Solution code:
move = []
min_time =0

N = int(input())
for i in range (5):
    move.append(int(input()))

if (N == min(move)):
    min_time = 5;
else:
    min_time = N//min(move) + 5;

print (min_time);

Submission status: Wrong Answer

Solution code:
move = []
min_time =0

N = int(input())
for i in range (5):
    move.append(int(input()))

min_time = N//min(move) + 5;

print (min_time);