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 copy
import bisect
#input=sys.stdin.readline
#sys.setrecursionlimit(10 ** 9)
import math
import heapq
 
#N, K = list(map(int, input().split()))
 
N = int(input())
 
x = []
for i in range(5):
	x.append(int(input()))
 
bottle = min(x)
times = math.ceil(N/bottle)
print(times + 4)
import sys
from collections import deque, defaultdict
import copy
import bisect
#input=sys.stdin.readline
#sys.setrecursionlimit(10 ** 9)
import math
import heapq

#N, K = list(map(int, input().split()))

N = int(input())

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

bottle = min(x)
times = math.ceil(N/bottle)
print(times + 4)

Submission status: Runtime Error

Solution code:
N = int(input())

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

bottle = min(x)
times = math.ceil(N/bottle)
print(times + 4)

Submission status: Runtime Error

Solution code:
C = list(map(int, input().split()))
C.sort(reverse=True)
 
L = []
 
for i in range(min(200,len(A))):
    for j in range(min(200,len(B))):
        for k in range(min(200,len(C))):
            tmp = A[i] + B[j] + C[k]
            L.append(tmp)
 
L.sort(reverse=True)
 
for i in range(K):
    print(L[i])

Submission status: Runtime Error

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

m = min(L)
print(4 + (L+m-1)//m)

Submission status: Runtime Error

Solution code:
N = int(input())

A = [0, 0, 0, 0, 0]
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

class person:
    def __init__(self):
        #現在の居場所
        self.now = 1
        #最後の都市まできたかどうか
        self.end = False
        #乗り物に乗っているかどうか
        self.ride = False
    def ridee(self, Info):
        if self.end == False and self.ride == False:
            if self.now == 1 and Info.train_now < Info.train_max:
                self.ride = True
                Info.train_now = Info.train_now + 1
            elif self.now == 2 and Info.buss_now < Info.buss_max:
                self.ride = True
                Info.buss_now = Info.buss_now + 1
                Info.train_now = Info.train_now - 1
            elif self.now == 3 and Info.taxi_now < Info.taxi_max:
                self.ride = True
                Info.taxi_now = Info.taxi_now + 1
                Info.buss_now = Info.buss_now - 1
            elif self.now == 4 and Info.airplane_now < Info.airplane_max:
                self.ride = True
                Info.airplane_now = Info.airplane_now + 1
                Info.taxi_now = Info.taxi_now - 1
            elif self.now == 5 and Info.ship_now < Info.ship_max:
                self.ride = True
                Info.ship_now = Info.ship_now + 1
                Info.airplane_now = Info.airplane_now - 1


class info:
    def __init__(self, N):
            self.train_max    = A[0]
            self.buss_max     = A[1]
            self.taxi_max     = A[2]
            self.airplane_max = A[3]
            self.ship_max     = A[4]

            self.train_now    = 0
            self.buss_now     = 0
            self.taxi_now     = 0
            self.airplane_now = 0
            self.ship_now     = 0
            self.people = []
            self.people = [person()] * N
    def ride(self, N):
        for i in range(N):
            self.people[i].ridee(self)

    def end_check(self):
        if self.people[N-1].end  == True:
                return 1
        return 0
    def update(self):
        for i in range(N):
            if self.people[i].ride == True:
                self.people[i].now = self.people[i].now + 1
                self.people[i].ride = False
            if self.people[i].now == 6:
                self.ship_now = self.ship_now - 1
                self.people[i].end = True

#infoインスタンスを生成する
INFO = info(N)

time = 0

while True:
    INFO.ride(N)
    INFO.update()
    time = time + 1
    if INFO.end_check() == 1:
        break

print(time)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
neck = int(input())
for i in range(N-1):
  neck = min(neck, int(input()))
res = math.ceil(N/neck)
print(res + 4)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
neck = int(input())
for i in range(N-1):
  neck = min(min, int(input()))
res = math.ceil(N/neck)
print(res)

Submission status: Runtime Error

Solution code:
import math

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

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

print(math.ceil(N/min(tr)))

Submission status: Runtime Error

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

min_city = min(cities)
if N < min_city:
  print(5)
else:
  times = N//min_city
  print(5+times)

Submission status: Runtime Error

Solution code:
ri = lambda: int(input())
n = ri()
x = min([ri() for _ range(5)])
print(n//x+min(1,n%x)+4)

Submission status: Runtime Error

Solution code:
def main():

    capa = []
    n = int(raw_input())
    ans = 0

    for i in range(5):
        capa.append(int(raw_input()))
    if n % sorted_capa[0] == 0:
        ans = 4 + n//sorted_capa[0]
    else:
        ans = 4 + n//sorted_capa[0] + 1
        print(ans)
    """
    people = [n]
    for i in range(5):
        people.append(0)
    print(capa,people)
    while people[-1] < n:
        for i in reversed(range(0,6)):
            if i != 0:
                people[i] += min(people[i-1],capa[i-1])
                people[i-1] -= min(people[i-1],capa[i-1])
        time += 1
        print(people,time)
    print(time)

    """
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
inf = input().split()
X = int(inf[0])
Y = int(inf[1])
Z = int(inf[2])
K = int(inf[3])

A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
ab = []
for a in A:
  for b in B:
    ab +=[a+b]
ab.sort(reverse=True)
C.sort(reverse=True)
state = [ab[0]+i for i in C]
count  = 0
while count<K:
  x = max(state)
  print(x)
  count += 1
  i = state.index(x)
  j = ab.index(x-C[i])
  if j<X*Y-1:
    state[i] = ab[j+1]+C[i]
  else:
    state[i]=-1

Submission status: Runtime Error

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

print(4 + math.ceil(N/min(A,B,C,D,E)))

Submission status: Runtime Error

Solution code:
x, y, z, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))[:k]

e = []

for va in a:
    for vb in b:
        e.append(va+vb)

e.sort(reverse=True)

e = e[:k]

d = []
for vc in c:
    for ve in e:
        d.append(vc+ve)

d.sort(reverse=True)
d = d[:k]

for vd in d:
    print(vd)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import os
import math

f = open('input.txt', 'r')
sys.stdin = f
N=int(input())
p=[0]*5
for i in range(5):
    p[i]=int(input())

pmin=min(p)
g=math.ceil(N/pmin)
#g=int(N/pmin)
print(5+g-1)

Submission status: Runtime Error

Solution code:
N, *x = map(int, input(0))
print(5 + (N // min(x)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
x = [int(i) for i in input()]
print(len(x) + (N // min(x)))

Submission status: Runtime Error

Solution code:
n = int(input())
 
c = [int(input()) for _ in range(n)]
b = min(c)

if b >= n:
  print(5)
else:
  t = (n - b) // b
  if t % b != 0:
    t += 1
  print(t + 5)

Submission status: Runtime Error

Solution code:
n = int(input())

c = [int(input()) for _ in range(n)]
b = min(c)

if b > n:
  print(5)
else:
  ans = (n - b) // b
  if ans % b != 0:
    ans += 1
  print(ans)

Submission status: Runtime Error

Solution code:
#Coding: utf-8
N=int(input())
a=[]
for i in 5:
  a.append(int(input()))
import math
print(math.ceil(N/min(a))-4)

Submission status: Runtime Error

Solution code:
#Coding: utf-8
2.N=int(input())
3.a=[]
4.for i in 5:
5.  a.append(int(input()))
6.import math
7.print(math.ceil(N/min(a))-4)

Submission status: Runtime Error

Solution code:
#Coding: utf-8
N=in(input())
a=[]
for i in 5:
  a.append(int(input()))
import math
print(math.ceil(N/min(a))-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())

a = N
b = 0
c = 0
d = 0
e = 0


for i in range(N+5):
  if a != 0:
    if a > A:
      a = a - A
      b = b + A
    else :
      a = a - a
      b = b + a
    
  if b != 0:
    if b > B:
      b = b - B
      c = c + B
    else :
      b = b - b
      c = c + b
    
  if c != 0:
    if c > C:
      c = c- c
      d = d + c
    else:
      c = c - C
      d = d + C
  
  if d != 0:
    if d > D:
      d = d-d
      e = e+d
    else : 
      d = d-D
      e = e+D
      
  if e != 0:
    if e > E :
      e = e-e
    else:
      e = e-E
    
  if a = 0 and b = 0 and c = 0 and d = 0 and e = 0:
    break

print(i)

Submission status: Runtime Error

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

m = min(n)

if t < m:
    t = m

tmp = t//m

if t % m != 0:
    tmp += 1

print(tmp+4)

Submission status: Runtime Error

Solution code:
li = []
n=np.log10(int(input()))
for i in range(5):
    k = np.log10(int(input()))
    li.append(k)
li.sort()
if 10**(n-li[0])-int(10**(n-li[0]))<10**(-15):
    g=int(10**(n-li[0]))
else:
    g=int(10**(n-li[0]))+1
print(g+4)

Submission status: Runtime Error

Solution code:
li = []
n=np.log10(int(input()))
for i in range(5):
    k = np.log10(int(input()))
    li.append(k)
li.sort()
if 10**(n-li[0])-int(10**(n-li[0]))<10**(-5):
    g=10**(n-li[0])
else:
    g=int(10**(n-li[0]))+1
print(g+4)

Submission status: Runtime Error

Solution code:
import numpy as np
n = np.log10(int(input()))
st = np.log10(int(input()))
g = 10**(n-st) if g==int(g) else 10**(n-st)+1
nm = 0
for i in range(4):
  k = np.log10(int(input()))
  if st>k:
    nm+=1
  st=k
g+=nm
print(g)

Submission status: Runtime Error

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

print(ceil(n%min(l)) + 4)

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())
print(math.ceil(N/min(A,B,C,D,E)+4)

Submission status: Runtime Error

Solution code:
import fractions

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

m_r = min(r)
print(fractions.ceil(N/m_r) + 4)

Submission status: Runtime Error

Solution code:
import fractions

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

m_r = min(r)
print(fractions.ceil(N/r) + 4)

Submission status: Runtime Error

Solution code:
import math

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

m_r = min(r)
print(math.ceil(N/r) + 4)

Submission status: Runtime Error

Solution code:
N = input()
A = input()
B = input()
C = input()
D = input()
E = input()
mLsit = [A, B, C, D, E]
m = min(mList)
if N % m == 0:
    print(N // m)
else:
    print(N // m + 1)

Submission status: Runtime Error

Solution code:
N = input()
ABCDE = []
for i in range(4):
    A = input()
    ABCDE.append(A)
m = min(ABCDE)
if N % m == 0:
    print(N // m)
else:
    print(N // m + 1)

Submission status: Runtime Error

Solution code:
N = input()
ABCDE = []
for i in range(4):
    A = input()
    ABCDE.append(A)
m = min(ABCDE)
if N % n == 0:
    print(N // m)
else:
    print(N // m + 1)

Submission status: Runtime Error

Solution code:
N = input()
ABCDE = []
for i in range(5):
    A = input()
    ABCDE.append(A)
m = min(ABCDE)
if N % n == 0:
    print(N // m)
else:
    print(N // m + 1)

Submission status: Runtime Error

Solution code:
n = int(input())
buf = []
for i in range(5):
  buf.apend(int(input()))
  
print(n // min(buf) + 6 - (n % min(buf) == 0))

Submission status: Runtime Error

Solution code:
from math import ceil


def main(N, A, B, C, D, E):
    loads = [A, B, C, D, E]
    min_val = min(loads)
    min_index = loads.index(min_val)

    res = min_index + ceil(N / min_val) + (5 - (min_index + 1))

    return res


if __name__ == "__main__":
    N = input()
    A = input()
    B = input()
    C = input()
    D = input()
    E = input()
    print(main(N, A, B, C, D, E))

Submission status: Runtime Error

Solution code:
n = int(input())
l = [int(input()) for i in range(5)]
m = min(l)
if m % l == 0:
  ans = l // m + 4
else:
  ans = l // m + 5
print(ans)

Submission status: Runtime Error

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

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

P = [A, B, C, D, E]
p = min(P)
if p>=N:
    print(5)
else:
    ans = 4+ceil(N/p)
    print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
cap_list = [int(input()) fot i in range(5)]
min_cap = min(cap_list)
c = (n + min_cap - 1) // min_cap
print(c + 4)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(N):
    trans.append(int(input()))

trans.sort()

if N % trans[0] == 0:
    print(N // trans[0] + 4)
else:
    print(N // trans[0] + 5)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
A=[int(input())for i in range(5)]
if n//min(A)==0 print(n//min(A)+4) else print((n//min(A)+5)

Submission status: Runtime Error

Solution code:
N = int(input())
cyapa = []
for i in range (1,6):
    cyapa.append(int(input()))
city1 = N
city2 = 0
city3 = 0
city4 = 0
city5 = 0
city6 = 0
mi = 0
while city6 < N:
    city6 = city6 + min(city5,cyapa[6])
    city5 = city5 + min(city4,cyapa[5]) - min(city5,cyapa[6])
    city4 = city4 + min(city3,cyapa[4]) - min(city4,cyapa[5])
    city3 = city3 + min(city2,cyapa[3]) - min(city3,cyapa[4])
    city2 = city2 + min(city1,cyapa[2]) - min(city2,cyapa[3])
    city1 = city1 - min(city1,cyapa[2])
    mi = mi + 1

Submission status: Runtime Error

Solution code:
n = int(input())
def move(max_num,before):
  return min(max_num,before)

people = [n,0,0,0,0,0]
max_nums = []
for i in range(5):
  max_nums.append(int(input()))

time = 0
while True:
  time += 1
  move_p = [0] * 6
  for i in range(5):
    move_p[i] -= min(max_num[i],people[i])
    move_p[i+1] += min(max_num[i],people[i])
  people += move_p
  if people[-1] == n:
    break

Submission status: Runtime Error

Solution code:
src = [int(input()) for _ in range(6)]
t = min(src[1:])
    if src[0]%t:
        print(4 + src[0]//t + 1)
    else:
        print(4 + src[0]//t)

Submission status: Runtime Error

Solution code:
src = [int(input()) for _ in range(6)]
t = min(src[1:])
	if src[0]%t:
		print(4 + src[0]//t + 1)
	else:
		print(4 + src[0]//t)

Submission status: Runtime Error

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 = 4 + int(N/min)
    if N % min != 0:
        ans = ans + 1
print(ans)

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = []
for _ in range(5):
    ls.append(int(input()))
if N <= min(ls):
    print(5)
else:
    mint = min(ls)
    ans = 5 + min//N +1
    print(ans)

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = []
for _ in range(5):
    ls.append(int(input()))
if N <= min(ls):
    print(5)
    else:
        mint = min(ls)
        ans = 5 + min//N +1
        print(ans)

Submission status: Runtime Error

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

if int(a)%j == 0:
    k = int(a)//j + 4
else:
    k = int(a)//j + 5
print(i)

Submission status: Runtime Error

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

if int(a)%j = 0:
    k = int(a)//j + 4
else:
    k = int(a)//j + 5
print(i)

Submission status: Runtime Error

Solution code:
n=int(input())
li = [int(input()) for _ in range(n)]  # li = ['hoge', 'bar', 'foo']

m = li.sort()[0]
ans = 0
if n % m == 0:
    ans += n//m
else:
    ans += n//m + 1
ans += 4
print(ans)

Submission status: Runtime Error

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

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

Solution code:
n = import math
n = int(input())

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

min_num = min(A)

ans = math.ceil(n/min_num)+4


print(ans)

Submission status: Runtime Error

Solution code:
def solve(n, traffic_list):
    min_val = min(traffic_list)
	if n % min_val == 0:
        return n // min_val + len(traffic_list) - 1
    else:
        return n // min_val + len(traffic_list)


def main():
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    ans = solve(n, [a, b, c, d, e])
    print(ans)


main()

Submission status: Runtime Error

Solution code:
n = int(input())
List = []
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))

#import math
print(math.ceil(n/min(List))+4)

Submission status: Runtime Error

Solution code:
print(n // min([a,b,c,d,e]) + 5)

Submission status: Runtime Error

Solution code:
n, a, b, c, d, e = map(int, input().split())
x = min(a, b, c, d, e)
print((n + x - 1) // x + 4)

Submission status: Runtime Error

Solution code:
X,Y,Z,K = map(int,input().split())

A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

A.sort(reverse=True)
A = A[0:K]
B.sort(reverse=True)
B = B[0:K]
AB = [a+b for a in A for b in B]

AB.sort(reverse=True)

AB = AB[0:K]

C.sort(reverse=True)
C=C[0:K]
ABC = [ab+c for ab in AB for c in C]

ABC.sort(reverse=True)

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

Submission status: Runtime Error

Solution code:
import math
N = int(input())
towns = [int(input()) for _ in range(5)]
bn = min(towns)
if N <= bn:
  print(5)
else:
  result = int(math.ceil(N/bn)) + 4
print(result)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
towns = [int(input()) for _ in range(5)]
bn = min(towns)
if N <= bn:
  print(5)
else:
  bn_idx = towns.index(bn)
  result = int(math.ceil(N/bn)) + 4
print(result)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
towns = [int(input()) for _ in range(5)]
bn = min(towns)
if N <= bn:
  print(5)
else:
  bn_idx = towns.index(bn)
  if N%bn == 0:
  	result = int(math.floor(N/bn)) + 5
  else:
    result = int(math.floor(N/bn)) + 6 - (bn_idx)
print(result)

Submission status: Runtime Error

Solution code:
import numpy as np
#int(input())
n=int(input())
ae=[]
for _ in range(n):
    ae.append(int(input()))
ae=np.array(ae)
min_ae=min(ae)
num_ae=-(-n//ae)-1
#num_ae=-(-ae//min_ae)
print(5+max(num_ae))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print((N+M-1)//M=+4)

Submission status: Runtime Error

Solution code:
v = list(map(int, input().split()))
m = v[0]//min(v[1:])
r = v[0]%min(v[1:])
if r == 0:
    print(4+m)
else:
    print(5+m)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import heapq
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
asort,bsort,csort = sorted(A,reverse=True),sorted(B,reverse=True),sorted(C,reverse=True)
already = set((0,0,0))
print(asort[0] + bsort[0] + csort[0])
x,y,z = 0,0,0
check = []
for k in range(K - 1):
    if (x + 1,y,z) not in already and x + 1 < X:
        already.add((x + 1,y,z))
        heapq.heappush(check,(-(asort[x + 1] + bsort[y] + csort[z]),x + 1,y,z))
    if (x,y + 1,z) not in already and y + 1 < Y:
        already.add((x,y + 1,z))
        heapq.heappush(check,(-(asort[x] + bsort[y + 1] + csort[z]),x,y + 1,z))
    if (x,y,z + 1) not in already and z + 1 < Z:
        already.add((x,y,z + 1))
        heapq.heappush(check,(-(asort[x] + bsort[y] + csort[z + 1]),x,y,z + 1))
    maxsum = heapq.heappop(check)
    print(-maxsum[0])
    x,y,z = maxsum[1],maxsum[2],maxsum[3]

Submission status: Runtime Error

Solution code:
ans = 0
n = int(input())
li = []
for i in range(5):
    li.append(int(input())
li2 = [n,0,0,0,0,0]

while li2[5] != n:
    ans ++
    for i in range(5):
        if li2[i] == 0:
            pass
        else if li2[i] >= li[i]:
            li2[i] -= li[i]
            li2[i+1] += li[i]
        else:
            li2[i+1] += li2[i]
            li2[i] = 0

print(minute)

Submission status: Runtime Error

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

num = A

if num >= B:
    num = B
else:
    continue

if num >= C:
    num = C
else: 
    continue

if num >= D:
    num = D
else: 
    continue

if num >= E:
    num = E
else: 
    continue

if N % num == 0:
    print(N // num + 4)
else:
    print((N + 1) // num + 4)

Submission status: Runtime Error

Solution code:
n,a,b,c,d,e=[int(input()) for i in range(6)]
dist=[n,0,0,0,0,0]
move=[a,b,c,d,e,0]
t=0
for while dist[5]<n:
  dist_t=[max(0,dist[0]-move[0])]
  for j in range(1,6):
    dist_t.append(max(0,dist[j]-move[j])+min(dist[j-1],move[j-1]))
  t=t+1
  dist=dist_t
print(t)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;
typedef long long LL;
typedef pair<LL, LL> P;

#define NUM 5

int main(void)
{
  LL N, a[NUM];
  cin >> N;
  for (int i = 0; i < NUM; i++) {
    cin >> a[i];
  }

  cout << 4 + ceil((double)N / (*min_element(a, a + NUM))) << endl;

  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
bimport math
n=int(input())
miti= list([map(int,input()) for i in range(5)])
print(4+math.ceil(n/min(miti)))

Submission status: Runtime Error

Solution code:
bimport math
n=int(input())
miti= list(map(int,[input() for i in range(5)]))
print(4+math.ceil(n/min(miti)))

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())
miti=[a,b,c,d,e]
print(4+ceil(n/min(miti)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n = map(int,input())
a = list(map(int,[input() for i in range(5)]))
print(floor(n / min(a)) + 5)

Submission status: Runtime Error

Solution code:
import math
n = input()
a = list(map(int,[input() for i in range(5)]))
print(floor(n / min(a)) + 5)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
a = list(map(int,[input() for i in range(5)]))
b = n // min(a) + 5
print(b)

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())
miti=[a,b,c,d,e]
mini=min(miti)
retu=math.ceil(n/miti)
  print(4+retu)

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())
miti=[a,b,c,d,e]
mini=min(miti)
retu=n//miti
if n<=mini:
  print(5)
else:
  print(4+retu)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
miti=list(map(int,input().split()))
mini=min(miti)
retu=n//miti
if n<=mini:
  print(5)
else:
  print(4+retu)

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())
mati=[a,b,c,d,e]
hito=[(n-1)//a,(n-1)//b,(n-1)//c,(n-1)//d,(n-1)//e]
print(hito+4)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import floor
n = input()
a = list(map(int,[input() for i in range(5)]))
print(floor(n / min(a)) + 5)

Submission status: Runtime Error

Solution code:
from math import floor
n = input()
a = list(map(int,[input() for i in range(5)]))
print(floar(n / min(a)) + 5)

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_list.sort(reverse = True)
b_list.sort(reverse = True)
c_list.sort(reverse = True)
total_list = [0 for _ in range(min(106307,X*Y*Z))]
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if (i+1)*(j+1)*(k+1) <= K:
                total_list[i*(Z*Y)+j*Z+k] = (a_list[i] + b_list[j] + c_list[k])
            else:
                break
total_list =  sorted(total_list, reverse = True)
for i in range(K):
    print(total_list[i])

Submission status: Runtime Error

Solution code:
n = input()
a = list(map(int,[input() for i in range(5)]))
print(floar(n / min(a)) + 5)

Submission status: Runtime Error

Solution code:
hito=int(input())
mini=min(hito[1:6])
retu=hito[0]//mini
print(retu+5)

Submission status: Runtime Error

Solution code:
hito=list(map(int,input()))
mini=min(hito[1:6])
retu=hito[0]//mini+1
print(retu+4)

Submission status: Runtime Error

Solution code:
hito=list(map(int,input()))
mini=min(hito[1:6])
retu=hito[0]//mini
print(retu+4)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
line=map(int,sys.readlines())
n=line[1]
_min=min(line[1:])
print(n//_min+1+5)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
 
N = int(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)