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: Runtime Error

Solution code:
import math

N = input()
list = []
min = 0
for i in range(5):
	list.append(int(input()))
	if min > list[i] or i = 0:
      min = list[i]

print(math.ceil(N/min) + 4)

Submission status: Runtime Error

Solution code:
import numpy as np
N=int(input())
dp=np.full((6,N+6),-1)
cost=[]
for i in range(5):
  cost.append(int(input()))
def solve(i,time):
  if dp[i,time]!=-1:
    return dp[i,time]
  if time==0:
     if i==0:
       dp[i][time]=N
       return N
     else:
       dp[i][time]=0
       return 0
  if i==5:
    dp[i,time]=solve(i,time-1)+min(solve(i-1,time-1),cost[i-1])
  elif i>=1 and i< 5:
    dp[i,time]=solve(i,time-1)+min(solve(i-1,time-1),cost[i-1])-min(solve(i,time-1),cost[i])
  else:
    dp[i,time]=solve(i,time-1)-min(solve(i,time-1),cost[i])
  return dp[i,time]

i=0
while(1):
  if solve(5,i)>=N:
    print(i)
    break
  else:
    i+=1

Submission status: Runtime Error

Solution code:
import math

N = input()
list = []
min = 0
for i in range(5)
	list.append(int(input()))
	if min > list[i] or i == 0:
      min = list[i]

print(math.ceil(N/min) + 4)

Submission status: Runtime Error

Solution code:
import math

N = input()
list = []
min = 0
for i in range(5)
	list.append(int(input()))
	if min > list[i] or i = 0:
      min = list[i]

print(math.ceil(N/min) + 4)

Submission status: Runtime Error

Solution code:
# 2019/04/07

from numpy import array, zeros
IN_RANGE = 5


# 入力受け取り
N = int(input())
a_e = array([int(input()) for i in range(IN_RANGE)])


# どこに人がいるか
a_e_num = zeros(IN_RANGE+1)
a_e_num[0] = N


# 1分ずつの処理
minute = 0
while a_e_num[N] < N:
    minute += 1
    move_index = (a_e_num[:N] - a_e) >= 0
    move_num = a_e_num[:N].copy()
    move_num[move_index] = a_e[move_index]
    a_e_num[:N] = a_e_num[:N] - move_num
    a_e_num[1:] = a_e_num[1:] + move_num

print(minute)

Submission status: Runtime Error

Solution code:
X,Y,Z,K = map(int, input().split())
a_list = [int(i) for i in input().split()]
b_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]
a_b_total = [0 for _ in range(X*Y)]
for i in range(X):
    for j in range(Y):
        a_b_total[i*Y+j] = a_list[i] + b_list[j]
a_b_total.sort(reverse = True)
a_b_c_total = [0 for _ in range(min(K,X*Y)*Z)]
for i in range(min(K,X*Y)):
    for j in range(Z):
        a_b_c_total[i*Z+j] = a_b_total[i] + c_list[j]
a_b_c_total.sort(reverse = True)
for i in range(K):
    print(a_b_c_total[i])

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    // Your code here!
    long long N;
    long long A, B, C, D, E;
    cin >> N;
    cin >> A >> B >> C >> D >> E;
    
    long long MinMove = min({A, B, C, D, E});
    
    long long ans = (N + MinMove - 1) / MinMove + 4;
    cout << ans << endl;
    
}

Submission status: Runtime Error

Solution code:
import math
array1 = [int(input()) for i in range(6)]
array2 = array1[1:6]
num = array1[0]
minimum = min(array2)
print(math.ceil(num / minimum + 4)

Submission status: Runtime Error

Solution code:
x, y, z, k = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

AB = []
for a in A:
    for b in B:
        AB.append(a + b)

AB.sort(reverse=True)

ABC = []
for i in range(min(x * y, k)):
    for c in C:
        ABC.append(AB[i] + c)

ABC.sort(reverse=True)

for i in range(k):
    print(ABC[i])

Submission status: Runtime Error

Solution code:
population = int(input())
a2b = int(input())
b2c = int(input())
c2d = int(input())
d2e = int(input())
e2f = int(input())
vehicle_min = min(vehicle)
vehicle = [a2b,b2c,c2d,d2e,e2f]

print(int(population/vehicle_min) + 5)

Submission status: Runtime Error

Solution code:
population = int(input())
a2b = int(input())
b2c = int(input())
c2d = int(input())
d2e = int(input())
e2f = int(input())

vehicle = [a2b,b2c,c2d,d2e,e2f]

print(int(population/vehicle_min) + 5)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

X, Y, Z, K = read_int()
A = read_int()
A.sort(reverse=True)
B = sorted(read_int())
C = sorted(read_int())

yz = []
res = []
def solve():
    for i in range(Y):
        for j in range(Z):
            yz.append(B[i] + C[j])
    yz.sort(reverse=True)
    for i in range(X):
        for j in range(min(K,len(yz))):
            res.append(A[i] + yz[j])
    res.sort(reverse=True)
    for i in range(K):
        print(res[i])


if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
import math

N=int(input())

m=0

for i in range(5):
    if m<math.ceil(N/int(input())):
      m=math.ceil(N/int(input()))

print(m+4)

Submission status: Runtime Error

Solution code:
from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]
    ans = []
    X, Y, Z, K = (int(_) for _ in input().split())
    A = list(int(_) for _ in input().split())
    A.sort()
    B = list(int(_) for _ in input().split())
    B.sort()
    C = list(int(_) for _ in input().split())
    C.sort()
    for a in A:
        for b in B:
            for i in range(min(len(C),3001)):
                ans.append(a + b + C[i])
    ans.sort()
    ans = ans[::-1]
    ans = ans[:K]
    print('\n'.join(map(str,ans)))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
lists = [int(input()) for i in range(5)]
city = [0,0,0,0,0]
time = 0
phase = 1

while sum(city) < n*5:
    for i in range(phase):
        city[i] = min(n,city[i] + lists[i])
        for j in range(5):
            if city[j] > 0:
                phase = max(phase,j+2)
    time += 1

print(time)

Submission status: Runtime Error

Solution code:
n = int(input())
lists = [int(input()) for i in range(5)]
city = [0,0,0,0,0]
time = 0
phase = 1

while sum(city) < 25:
    for i in range(phase):
        city[i] = min(5,city[i] + lists[i])
        for j in range(5):
            if city[j] > 0:
                phase = max(phase,j+2)
    time += 1

print(time)

Submission status: Runtime Error

Solution code:
import math

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

cities = [a, b, c, d, e]
min_val = 10
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)

Submission status: Runtime Error

Solution code:
    #include<iostream>
    #include<vector>
    #include<algorithm>
    #define lli long long
    #define all(i) i.begin(),i.end()
    #define rall(i) i.rbegin(),i.rend()
    #define rep0(i,j) for(int i=0;i<j;i++)
    #define rep1(i,j) for(int i=1;i<=j;i++)
    #define rep0d(i,j) for(int i=j-1;i>=0;i--)
    #define MAX 1000000007
     
    using namespace std;
     
     
     
    int main() {
        lli n, mi = 1e16;
        lli min;
        cin >> n;
        vector<lli> vec(5,0);
        rep0(i,5){
            cin >> vec[i];
        
            if(vec[i]<mi){
                min = i;
                mi = vec[i];
            }
        }
        
        cout << n/vec[min] + 4 + (n%vec[min]==0)?0:1;
    }

Submission status: Runtime Error

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

Submission status: Runtime Error

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

M = min(AtoE)
print(N/M + 5)

Submission status: Runtime Error

Solution code:
AtoE = [""]*5
for i in range(5):
  AtoE[i] = int(input())

M = min(AtoE)
print(N/M + 5)

Submission status: Runtime Error

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

M = min([A, B, C, D, E])
print(N/M + 5)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <cassert>
using namespace std;
typedef long long ll;

int main() {
	ll n; cin >> n;
	vector<ll> a(5);
	for (int i = 0; i < 5; i++) cin >> a[i];
	ll mi = 1e18; int idx;
	for (int i = 0; i < 5; i++) {
		if (a[i] <= mi) {
			mi = a[i];
			idx = i;
		}
	}
	cout << (n + a[idx] - 1) / a[idx] + 4 << endl;
	return 0;
}

Submission status: Runtime Error

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

ct = 4
BIG = N
MIN = S[0]
Mp = 0

for i in range(5):
    if BIG <= S[i]:
        continue
    else :
        BIG = S[i]
        Mp = math.seil(N / S[i])
        continue
                
ct = ct + Mp

print(ct)

Submission status: Runtime Error

Solution code:
import math
import sys

N = int(input())
city_cap = [int(input()) for _ in range(5)]
time = 0
min = float('inf')
min_index = 0

for i in range(5):
    if (min > city_cap[i]):
        min = city_cap[i]
        min_index = i
if (N <= min):
    print(cost)
    sys.exit()

cost = 5 + math.floor(N / min)
print(cost)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
print(math.ceil(N / min(A)) * (mi + 1) + 4)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
mi = 0
mA = 1e18
for i in range(0,5):
    if (A[i] < mA):
        mA = A[i]
        mi = i
print(math.ceil(N / mA) * (mi + 1) + 4)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
capacity = min([int(input()) for i in range(6)])

print(math.ceil(N/capacity)+4)

Submission status: Runtime Error

Solution code:
from math import ceil
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
mi = 0
mA = 1e18
for i in range(0,5):
    if (A[i] < mA):
        mA = A[i]
        mi = i
print(math.ceil(N / mA) * (mi + 1) + 4)

Submission status: Runtime Error

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

print(N//s_min + 5)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
t = map(int, input())
bottle_neck = min(t)
ti = math.ceil(n/bottle_neck)
print(ti+4)

Submission status: Runtime Error

Solution code:
ABC = [N,0,0,0,0]
time = 0
flag = 0
i = 0
while ABC[4] > 0 or flag == 0:
    print(ABC)
    if i >= 4:
        if ABC[4] >= E:
            ABC[4]-=E
        else:
            ABC[4]=0
    if i >= 3:
        if ABC[3] >= D:
            ABC[3]-=D
            ABC[4]+=D
            flag = 1
        else:
            ABC[4]+=ABC[3]
            flag = 1
            ABC[3]=0
    if i >= 2:
        if ABC[2] >= C:
            ABC[2]-=C
            ABC[3]+=C
        else:
            ABC[3]+=ABC[2]
            ABC[2]=0
    if i >= 1:
        if ABC[1] >= B:
            ABC[1]-=B
            ABC[2]+=B
        else:
            ABC[2]+=ABC[1]
            ABC[1]=0
    if ABC[0] >= A:
        ABC[0]-=A
        ABC[1]+=A
    else:
        ABC[1]+=ABC[0]
        ABC[0]=0
        
        
    time += 1
    i += 1
print('end',ABC)
print(time)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
t = map(int, input())
bottle_neck = min(t)[0]
ti = math.ceil(n/bottle_neck)
print(ti+4)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int main(){
    int n; scanf("%d",&n);
    int move[5]={};

    for (int i = 0; i<5;i++){
        scanf("%d",&move[i]);
    }
    int men[6] = {n,0,0,0,0,0};

    int cnt = 0;
    while(men[5]!=n){
        for (int i=4;i>-1;i--){
            if(men[i]>0){
                for (int j = 0;j<move[i];j++){
                    men[i] --; men[i+1] ++;
                    if(men[i] == 0){
                        break;
                    }
                }
            }
        }
        cnt++;
    }
    printf("%d"\n,cnt);


    return 0;
}

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
L = [A,B,C,D,E]
L.sort()
if L[0] =>N:
  M = 1
else:
  K = N // L[0]
  M = K + 1
print(M + 4)

Submission status: Runtime Error

Solution code:
n = int(input())
t=[]
t = map(int, input())
bottle_neck = min(t)[0]
ti = int(n/bottle_neck)
if bottle_neck * ti > n:
    ti=1
else:
    ti+=1
print(ti+4)

Submission status: Runtime Error

Solution code:
n=nt(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if n % min([a,b,c,d,e]) ==0:
    res=5+ n//(min[a,b,c,d,e])
else:
    res=5+ (n//(min[a,b,c,d,e])+1)
print(res)

Submission status: Runtime Error

Solution code:
n=nt(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if min([a,b,c,d,e])==1:
    res=5+ n//(min[a,b,c,d,e])
else:
    res=5+ (n//(min[a,b,c,d,e])+1)
print(res)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
ans=0
arr=[b,c,d,e,f]
amari=0
gurupu=0
syou=0

for i in range(6):
    if i == 1:
        amari=a % b
        gurupu=a // b + 1
        syou=b
    elif arr[i-1]<arr[i]:
        if amari>arr[i]:
            amari=amari % arr[i]
            gurupu=syou // arr[i] + 1
        else:
            gurupu=syou // arr[i] + 1
            

print(gurupu + 4)

Submission status: Runtime Error

Solution code:
ar = []
raw = raw_input()
ar.append(int(raw))
raw = raw_input()
ar.append(int(raw))
raw = raw_input()
ar.append(int(raw))
raw = raw_input()
ar.append(int(raw))
raw = raw_input()
ar.append(int(raw))
raw = raw_input()
ar.append(int(raw))

total = 0

n = ar[0]
a = ar[1]
b = ar[2]
c = ar[3]
d = ar[4]
e = ar[5]

c1 = n                                             
c2 = 0
c3 = 0                                             
c4 = 0                                             
c5 = 0                                             
c6 = 0                                             

i = 0                                              

i += n / a
if n % a != 0:
    i += 1

if b >= a and b % a != 0:
    i += 1
else:
    i += (a - b) / b
    if (a - b) % b != 0:
        i += 1

if c >= b and c % b != 0:
    i += 1
else if c >= a and c % a != 0:
    i += 1
else if min(a,b,c) == c:
    (min(a,b) - c) / c
    if (min(a,b) - c) % c != 0:
        i += 1


if d >= c and d % c != 0:
    i += 1
else if d >= b and d % b != 0:
    i += 1
else if min(b,c,d) == d:
    (min(b,c) - d) / d
    if (min(b,c) - d) % d != 0:
        i += 1
   
if e >= d and e % d != 0:
    i += 1
else if e >= c and e % c != 0:
    i += 1
else if min(c,d,e) == e:
    (min(c,d) - e) / e
    if (min(c,d) - e) % e != 0:
        i += 1

print i

Submission status: Runtime Error

Solution code:

n = int(input())
lists = [int(input()) for i in range(5)]
city = [0,0,0,0,0]
time = 0
phase = 1

while sum(city) < 25:
    for i in range(phase):
        city[i] = min(5,city[i] + lists[i])
        for j in range(5):
            if city[j] > 0:
                phase = max(phase,j+2)
    time += 1

print(time)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

min_index = capacity.index(min(capacity))

ans = N // capacity[min_index]

if N <= capacity[0] and max(capacity) == capacity[0] and capacity[1:] not in capacity[0]:
    print(ans+4)
    exit()
print(ans+5)

Submission status: Runtime Error

Solution code:
inputs = [input() for i in range(6)]
N = int(inputs[0])
l = [1]*N
t = 0
while 1 in l or 2 in l or 3 in l or 4 in l or 5 in l:
    for a in range(int(inputs[5])):
        if 5 in l:
            l[l.index(5)] = 6
        else:
            break
    for a in range(int(inputs[4])):
        if 4 in l:
            l[l.index(4)] = 5
        else:
            break
    for a in range(int(inputs[3])):
        if 3 in l:
            l[l.index(3)] = 4
        else:
            break
    for a in range(int(inputs[2])):
        if 2 in l:
            l[l.index(2)] = 3
        else:
            break
    for a in range(int(inputs[1])):
        if 1 in l:
            l[l.index(1)] = 2
        else:
            break
    t = t+1
print(t)

Submission status: Runtime Error

Solution code:
n = int(input())
t = map(int, input())
bottle_neck = min(t)
ti = int(n/bottle_neck)
if bottle_neck * ti > n:
    ti=1
else:
    ti+=1
print(ti+4)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
if n%a==0:
    A=1
else:
    A=int(n//a)+1
B=int(n//b)
C=int(n//c)
D=int(n//d)
E=int(n//e)
f=A
g=n%a
def sakana(k):
    if g%listA[k-1]==0:
        g=listB[k-1]
    else:
        g=g%listA[k-1]
    
listA=[A,B,C,D,E]
listB=[a,b,c,d,e]
for i in range(1,5):
    sakana(i)
    if listA[i-1]-1>=listA[i]:
        f=f+1
    elif listA[i-1]-1<listA[i]:
        f=g//listB[i]
print(f)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n=int(input())
array=[int(input()) for i in range(5)]
array2=array
array2.sort()
t=5
s=0
n-array[0]
for i in range(1,4):
    if s+=array2[i]-array2[0]>0:s+=array2[i]-array2[0]
print(t+s)

Submission status: Runtime Error

Solution code:
n=input();a=input();b=input();c=input();d=input();e=input()
turn=1
turn+=n//a+1
if n%a==0 and n!=a:
  A=n/a
elif n==a:
  A=n
else:
  A=n%a
turn+=A//b+1
if A%b==0 and A!=b:
  B=A/b
elif A==b:
  B=A
else:
  B=A%b
turn+=B//c+1
if B%c==0 and B!=c:
  C=B/c
elif B==c:
  C=B
else:
  C=B%c
turn+=C//d+1
if C%d==0 and C!=d:
  D=C/d
elif C==d:
  D=C
else:
  D=C%d
turn+=D//e+1
print(turn)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input();a=input();b=input();c=input();d=input();e=input()
turn=1
turn+=n//a+1
if n%a==0 and n!=a:
  A=n/a
elif n==a:
  A=n
else:
  A=n%a
turn+=A//b+1
if A%b==0 and n!=b:
  B=A/b
elif A==b:
  B=A
else:
  B=A%b
turn+=B//c+1
if B%c==0 and n!=c:
  C=B/c
elif B==c:
  C=B
else:
  C=B%c
turn+=C//d+1
if C%d==0 and n!=d:
  D=C/d
elif C==d:
  D=C
else:
  D=C%d
turn+=D//e+1
print(turn)

Submission status: Runtime Error

Solution code:
from math import modf

n, a, b, c, d, e = [int(input()) for _ in range(6)]
r = min([h for h in [a,b,c,d,e] if h != 1])
if 1 in [a,b,c,d,e]:
  r -= 1
dd, ii = modf(n/r)
ll = int(ii)+int(dd*10)
print(5 if ll == 0 else ll)

Submission status: Runtime Error

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

min_num = 0
group_num = 1
member_num = n

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

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

Submission status: Runtime Error

Solution code:
ans = 5
cnt = 0
N = int(input())
for i in range(5):
    c = int(input())
    if N <= c:
        continue
    else:
        if i == 0:
            ans += N // c
            minn = c
        else:
            if minn - c > 0:
                cnt += 1
                minn = c
for i in range(cnt):
    ans += 2 ** i
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
L = [int(input()) for i in range(5)]
J = [_ for _ in L if _ != 1]
if min(L) != 1:
    ans = n //min(L) + 5
else:
    ans = n // min(J) + L.count(1)*n
print(ans)

Submission status: Runtime Error

Solution code:
from math import modf

n, a, b, c, d, e = [int(input()) for _ in range(6)]
r = [h for h in [a,b,c,d,e] if h != 1]
if 1 in [a,b,c,d,e]:
  r = min(r)-1
dd, ii = modf(n/min(r))

print(max(5, int(ii)+int(dd*10)))

Submission status: Runtime Error

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

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

min_idx = cs.index(min(cs))

if min_idx == 0:
    t = int(n / cs[min_idx]) + 1
elif min_idx == 1:
    amari = n % cs[min_idx-1]
    t = int(cs[min_idx-1] / (cs[min_idx-1] - cs[min_idx])) + 1
    if amari <= cs[min_idx]:
        t = t - 1
else:
    amari = cs[min_idx-2] % cs[min_idx-1]
    t = int(cs[min_idx-1] / (cs[min_idx-1] - cs[min_idx])) + 1
    if aamari <= cs[min_idx]:
        t = t - 1

print(4 + t)

Submission status: Runtime Error

Solution code:
nn = [0] * 6
nn[0] = n
count = 0
while nn[5] != n:
    idou_1 = min(a[0],nn[0])
    idou_2 = min(a[1],nn[1])
    idou_3 = min(a[2],nn[2])
    idou_4 = min(a[3],nn[3])
    idou_5 = min(a[4],nn[4])
    nn[0] -= idou_1
    nn[1] += idou_1
    nn[1] -= idou_2
    nn[2] += idou_2
    nn[2] -= idou_3
    nn[3] += idou_3
    nn[3] -= idou_4
    nn[4] += idou_4
    nn[4] -= idou_5
    nn[5] += idou_5
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
from math import modf

n, a, b, c, d, e = [int(input()) for _ in range(6)]
r = [h for h in [a,b,c,d,e] if h != 1]
if 1 in [a,b,c,d,e]:
  r -= 1
dd, ii = modf(n/min(r))

Submission status: Runtime Error

Solution code:
n, a, b, c, d, e = [int(input()) for _ in range(6)]
r = [h for h in [a,b,c,d,e] if h != 1]
if 1 in [a,b,c,d,e]:
  r -= 1
dd, ii = modf(n/min(r))

Submission status: Runtime Error

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

c = [0] * 5
for i in range(len(l)):
    if N > l[i]:
        c[i] = N - l[i]
        N = l[i]

res = 0
for i in range(5):
    if c[i] > 0:
        if i == 0:
            res += int(c[i]/l[i]) + 1
            m = c[i] - int(c[i]/l[i]) * l[i]
        else:
            c[i] = max(0,c[i] - l[i] * res)
            c[i] += m
            res += int((c[i])/l[i])
            m = c[i] - int((c[i])/l[i]) * l[i]
    

print(5+res)

Submission status: Runtime Error

Solution code:
n = int(input())
t = map(int, input())
bottle_neck = min(t)
ti = int(n/bottle_neck)
if n % bottle_neck == 0:
    pass
else:
    ti+=1
print(ti+4)

Submission status: Runtime Error

Solution code:
ans = 5
cnt = 0
N = int(input())
for i in range(5):
    c = int(input())
    if N < c:
        continue
    else:
        if i == 0:
            ans += N // c
            minn = c
        else:
            if minn - c > 0:
                cnt += 1
                minn = c
for i in range(cnt):
    ans += 2 ** i
print(ans)

Submission status: Runtime Error

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

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


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

Submission status: Runtime Error

Solution code:
n=input();a=input();b=input();c=input();d=input();e=input()
turn=1
turn+=n//a+1
turn+=n%a//b+1
turn+=n%a%b//c+1
turn+=n%a%b%c//d+1
turn+=n%a%b%c%d//e+1
print(turn)

Submission status: Runtime Error

Solution code:
n=int(input())
lst=[int(input()) for i in range(5)]
l=[0]*5
l.insert(0,n)
def counting(l,lst,ans):
    if l[5]==n:
        return ans
    else:
        for i in range(5,0,-1):
            res=min(l[i-1],lst[i-1])
            l[i]+=res
            l[i-1]-=res
        ans+=1
        return counting(l,lst,ans)
print(counting(l,lst,0))

Submission status: Runtime Error

Solution code:
import numpy as np

n = float(input())
list = [int(input()) for i in range(5)]

l = np.array(list)

d = np.amin(l)
dm = np.argmin(l)
'''                                                                                 
if dm == 4:                                                                         
    print(int(n//d))                                                                
'''
else:
    print(int(n//d+5))

Submission status: Runtime Error

Solution code:
import math

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

cities = [a, b, c, d, e]
min_val = 1e6
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)

Submission status: Runtime Error

Solution code:
from math import modf

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
list=[]
for i in range(5):
    list.append(int(input()))
if n==1:
    print(5)
elif:
    print(5+n//min(list))

Submission status: Runtime Error

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

class Transporter():
    def __init__(self, cap_out, temp=0):
        self.temp_num = temp
        self.cap_out = cap_out

    def transport(self):
        if self.temp_num < self.cap_out:
            num = self.temp_num
            self.temp_num = 0
            return num
        else:
            self.temp_num -= self.cap_out
            return self.cap_out

A_ = Transporter(A, temp=N)
B_ = Transporter(B)
C_ = Transporter(C)
D_ = Transporter(D)
E_ = Transporter(E)

time = 0
while (A_.temp_num!=0):
    time += 1
    a=A_.transport()
    b=B_.transport()
    c=C_.transport()
    d=D_.transport()
    e=E_.transport()
    B_.temp_num+=a
    C_.temp_num+=b
    D_.temp_num+=c
    E_.temp_num+=d

while (B_.temp_num!=0):
    time += 1
    b=B_.transport()
    c=C_.transport()
    d=D_.transport()
    e=E_.transport()
    C_.temp_num+=b
    D_.temp_num+=c
    E_.temp_num+=d

while (C_.temp_num!=0):
    time += 1
    c=C_.transport()
    d=D_.transport()
    e=E_.transport()
    D_.temp_num+=c
    E_.temp_num+=d

while (D_.temp_num!=0):
    time += 1
    d=D_.transport()
    e=E_.transport()
    E_.temp_num+=d

whileD(E_.temp_num!=0):
    time += 1
    E_.transport()
print(time)

Submission status: Runtime Error

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces


li = []
n = int(input())
for i in range(5):
    li.append(int(input()))
if n == min(i):
    print(5)
else:
    print(5 + n // min(li))

Submission status: Runtime Error

Solution code:
N,A,B,C,D,E=input().split()

Submission status: Runtime Error

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

list_t = [A,B,C,D,E]
lowest = list_t[0]

for i in range(len(list_t)):
    if lowest >= list_t[i]:
        lowest = list_t[i]
    
a = N // lowest
print(a + 5

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10000)
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

ps = [n, 0, 0, 0, 0, 0]
ts = [a, b, c, d, e]
t = 0

def move(ps, t):
    if ps[len(ps)-1] == n:
        return print(t)
    ds = [0, 0, 0, 0, 0, 0]
    for i in range(len(ps) - 1):
        if ps[i] > 0:
            diff = min(ts[i], ps[i])
            ds[i] -= diff
            ds[i + 1] += diff
    move([ps[j] + ds[j]  for j in range(len(ds))], t +1)

move(ps, t)