Problem:


Score: 300 points

Problem Statement

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

There are five means of transport in this empire:

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

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

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

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

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

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

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

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

Constraints

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

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A
B
C
D
E

Output

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

Sample Input 1

5
3
2
4
3
5

Sample Output 1

7

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

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

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

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

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

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

Sample Input 2

10
123
123
123
123
123

Sample Output 2

5

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

Sample Input 3

10000000007
2
3
5
7
11

Sample Output 3

5000000008

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



Sample input:
5
3
2
4
3
5


Sample output:
7

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(6)]
n=l[0]
min_=min(l[1:])
print(n//min_+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())

T12 = (N-1) // A
N2 = (N-1) % A + 1 + T12 * max(0, A - B)
T23 = (N2-1) // B
N3 = (N2-1) % B + 1 + T23 * max(0, B - C)
T34 = (N3-1) // C
N4 = (N3-1) % C + 1 + T34 * max(0, C - D)
T45 = (N4-1) // D
N5 = (N4-1) % D + 1 + T45 * max(0, D - E)
T56 = (N5-1) // E

print(T12 + T23 + T34 + T45 + T56 + 5)

Submission status: Wrong Answer

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

T12 = N // A
N2 = N % A + T12 * max(0, A - B)
T23 = N2 // B
N3 = N2 % B + T23 * max(0, B - C)
T34 = N3 // C
N4 = N3 % C + T34 * max(0, C - D)
T45 = N4 // D
N5 = N4 % D + T45 * max(0, D - E)
T56 = N5 // E

print(T12 + T23 + T34 + T45 + T56 + 5)

Submission status: Wrong Answer

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

T12 = N // A
N2 = N % A + T12 * max(0, A - B)
T23 = N2 // B
N3 = N2 % B + T23 * max(0, B - C)
T34 = N3 // C
N4 = N3 % C + T34 * max(0, C - D)
T45 = N4 // D
N5 = N4 % D + T45 * max(0, D - E)

print(T12 + T23 + T34 + T45 + 5)

Submission status: Wrong Answer

Solution code:
#--import&define---------------------
import math

def yes():
    print("Yes")
def no():
    print("No")
#--my_library--------------------------------
#mapを利用したリストの入力
# x,y = map(int,input().split())

#forを利用したリストの入力
#l = []
#for i in range():
#    l.append(int(input()))

#intの最大値と最小値
#maxX = 2147483647
#minX =-2147483648
#--以下解答---------------------------------

n = int(input())
l = []
min = 2147483647
for i in range(5):
    l.append(int(input()))
    min = l[i] if l[i]<min else min

print(int((n+min-1)/min) +4)
# if n%min == 0:
#     print(n//min +4)
# else:
#     tmp = int(n//min) +1
#     print(tmp+4)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = []
min = 2147483647
for i in range(5):
    l.append(int(input()))
    min = l[i] if l[i]<min else min

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

Submission status: Wrong Answer

Solution code:
#--import&define---------------------
import math

def yes():
    print("Yes")
def no():
    print("No")
#--my_library--------------------------------
#mapを利用したリストの入力
# x,y = map(int,input().split())

#forを利用したリストの入力
#l = []
#for i in range():
#    l.append(int(input()))

#intの最大値と最小値
#maxX = 2147483647
#minX =-2147483648
#--以下解答---------------------------------

n = int(input())
l = []
min = 2147483647
for i in range(5):
    l.append(int(input()))
    min = l[i] if l[i]<min else min

if n%min == 0:
    print(n//min +4)
else:
    tmp = int(n//min) +1
    print(tmp+4)

Submission status: Wrong Answer

Solution code:
#--import&define---------------------
import math

def yes():
    print("Yes")
def no():
    print("No")
#--my_library--------------------------------
#mapを利用したリストの入力
# x,y = map(int,input().split())

#forを利用したリストの入力
#l = []
#for i in range():
#    l.append(int(input()))

#intの最大値と最小値
#maxX = 2147483647
#minX =-2147483648
#--以下解答---------------------------------

n = int(input())
l = []
min = 2147483647
for i in range(5):
    l.append(int(input()))
    min = l[i] if l[i]<min else min

if n%min == 0:
    print(n/min+4)
else:
    tmp = int(n/min) +1
    print(tmp+4)

Submission status: Wrong Answer

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

time = n//mv[0]
mod = n%mv[0]

for i in range(4):
    if mv[i] > mv[i+1]:
        time,mod = time + ((mv[i]-mv[i+1])*time+mod)//mv[i+1],mod + ((mv[i]-mv[i+1])*time+mod)%mv[i+1]
    else:
        mv[i+1] = mv[i]
else:
    if mod != 0:
        time += 1
    ans = time + 4

print(ans)

Submission status: Wrong Answer

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

time = ceil(n/mv[0])
mod = n%mv[0]

for i in range(4):
    if mv[i] > mv[i+1]:
        time -= 1
        time += ceil((mod + (mv[i]-mv[i+1])*time)/mv[i+1])
        mod = (mod + (mv[i]-mv[i+1])*time)%mv[i+1]
else:
    ans = time + 4

print(ans)

Submission status: Wrong Answer

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

time = ceil(n/mv[0])

for i in range(4):
    if mv[i] > mv[i+1]:
        time -= 1
        time += ceil((n%mv[i] + (mv[i]-mv[i+1])*time)/mv[i+1])
else:
    ans = time + 4

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

worst = min(args)

print(5 + n // worst)

Submission status: Wrong Answer

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

worst = min(args)

print(6 + n // worst)

Submission status: Wrong Answer

Solution code:

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
lis=[]
for i in range(6):
    lis.append(int(input()))
g=[]
t=10**16
for i in range(5):
    if i==0:
       if lis[i]>lis[i+1]:
          t=min(lis[i+1],t)
          g.append(i+1+lis[0]//t)
       else:
          g.append(i+1)
    else:
       if lis[i]>lis[i+1]:
          t=min(lis[i+1],t)
          g.append(i+1+lis[0]//t)
       else:
          t=min(lis[i],t)
          g.append(i+1+lis[0]//t)
print(max(g))

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def time_to_zero(n, carry):
    ans = 0
    amari = 0
    if n % carry:
        amari = 1
    return n // carry + amari

def main():
    N = I()
    l = []
    ans = 0
    for i in range(5):
        al = I()
        l.append(al)
    A, B, C, D, E = l
    city_capa = N
    prev_tr_capa = A
    for tr_capa, next_tr_capa in zip(l, l[1:]+[0]):
        t = time_to_zero(city_capa, tr_capa)
        # print('city_capa: {}, next_tr_capa: {}, tr_capa: {}, t: {}'.format(city_capa, next_tr_capa, tr_capa, t))
        city_capa = city_capa - (t-1) * min(tr_capa, next_tr_capa)
        ans += t
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc123/tasks/abc123_c


def move(f_value, t_value, capacity):
  value = capacity if f_value > capacity else f_value
  t_value += value
  f_value -= value
  return f_value, t_value


def unit_move(persons, capacities):
  ans = 0
  while max(persons[:5]) != 0:
    for i in [4, 3, 2, 1, 0]:
      persons[i], persons[i + 1] = move(persons[i], persons[i + 1], capacities[i])
    ans += 1
  return ans


def unit_move2(persons, capacities):
  ans = 0
  while persons[0] > 0:
    for i in [4, 3, 2, 1, 0]:
      persons[i], persons[i + 1] = move(persons[i], persons[i + 1], capacities[i])
    ans += 1
  return ans, persons


UNIT_SIZE = 1000
n = int(input())
capacities = [int(input()) for i in range(5)]

unit_v, mod_v = divmod(n, UNIT_SIZE)

if unit_v > 0:
  persons = [mod_v, 0, 0, 0, 0, 0]
  ans, persons = unit_move2(persons, capacities)

  persons[0] = UNIT_SIZE
  wk, persons = unit_move2(persons, capacities)
  ans += wk * unit_v

  ans += unit_move(persons, capacities)
else:
  persons = [mod_v, 0, 0, 0, 0, 0]
  ans = unit_move(persons, capacities)

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc123/tasks/abc123_c


def move(f_value, t_value, capacity):
  value = capacity if f_value > capacity else f_value
  t_value += value
  f_value -= value
  return f_value, t_value


def unit_move(persons, capacities):
  ans = 0
  while max(persons[:5]) != 0:
    for i in [4, 3, 2, 1, 0]:
      persons[i], persons[i + 1] = move(persons[i], persons[i + 1], capacities[i])
    ans += 1
  return ans


def unit_move2(persons, capacities):
  ans = 0
  while persons[0] > 0:
    for i in [4, 3, 2, 1, 0]:
      persons[i], persons[i + 1] = move(persons[i], persons[i + 1], capacities[i])
    ans += 1
  return ans, persons


UNIT_SIZE = 100000
n = int(input())
capacities = [int(input()) for i in range(5)]

unit_v, mod_v = divmod(n, UNIT_SIZE)

if unit_v > 0:
  persons = [mod_v, 0, 0, 0, 0, 0]
  ans, persons = unit_move2(persons, capacities)

  persons[0] = UNIT_SIZE
  wk, persons = unit_move2(persons, capacities)
  ans += wk * unit_v

  ans += unit_move(persons, capacities)
else:
  persons = [mod_v, 0, 0, 0, 0, 0]
  ans = unit_move(persons, capacities)

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc123/tasks/abc123_c


def move(f_value, t_value, capacity):
  value = capacity if f_value > capacity else f_value
  t_value += value
  f_value -= value
  return f_value, t_value


def unit_move(persons, capacities, unit):
  ans = 0
  while persons[5] < unit:
    for i in [4, 3, 2, 1, 0]:
      persons[i], persons[i + 1] = move(persons[i], persons[i + 1], capacities[i])
    ans += 1
  return ans


UNIT_SIZE = 100000
n = int(input())
capacities = [int(input()) for i in range(5)]

unit_v, mod_v = divmod(n, UNIT_SIZE)
persons = [mod_v, 0, 0, 0, 0, 0]
ans = unit_move(persons, capacities, mod_v)

if unit_v > 0:
  persons = [UNIT_SIZE, 0, 0, 0, 0, 0]
  wk = unit_move(persons, capacities, UNIT_SIZE) - 4
  ans += wk * unit_v
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc123/tasks/abc123_c


def move(f_value, t_value, capacity):
  value = capacity if f_value > capacity else f_value
  t_value += value
  f_value -= value
  return f_value, t_value


def unit_move(persons, capacities, unit):
  ans = 0
  while persons[5] < unit:
    for i in [4, 3, 2, 1, 0]:
      persons[i], persons[i + 1] = move(persons[i], persons[i + 1], capacities[i])
    ans += 1
  return ans


UNIT_SIZE = 100000
n = int(input())
capacities = [int(input()) for i in range(5)]

unit_v, mod_v = divmod(n, UNIT_SIZE)
persons = [mod_v, 0, 0, 0, 0, 0]
ans = unit_move(persons, capacities, mod_v)

persons = [UNIT_SIZE, 0, 0, 0, 0, 0]
wk = unit_move(persons, capacities, UNIT_SIZE) - 4
ans += wk * unit_v
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc123/tasks/abc123_c


def move(f_value, t_value, capacity):
  value = capacity if f_value > capacity else f_value
  t_value += value
  f_value -= value
  return f_value, t_value


def unit_move(persons, capacities, unit):
  ans = 0
  while persons[5] < unit:
    for i in [4, 3, 2, 1, 0]:
      persons[i], persons[i + 1] = move(persons[i], persons[i + 1], capacities[i])
    ans += 1
  return ans


UNIT_SIZE = 100000
n = int(input())
capacities = [int(input()) for i in range(5)]

unit_v, mod_v = divmod(n, UNIT_SIZE)
persons = [mod_v, 0, 0, 0, 0, 0]
ans = unit_move(persons, capacities, mod_v)
print(ans)

persons = [UNIT_SIZE, 0, 0, 0, 0, 0]
wk = unit_move(persons, capacities, UNIT_SIZE) - 4
ans += wk * unit_v
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
if N<A:NA=math.ceil(N/A)
else:NA=round(N/A)
if A<B:AB=math.ceil(A/B)
else:AB=round(A/B)
if B<C:BC=math.ceil(B/C)
else:BC=round(B/C)
if C<D:CD=math.ceil(C/D)
else:CD=round(C/D)
if D<E:DE=math.ceil(D/E)
else:DE=round(D/E)
# NA=math.ceil(N/A)
# AB=round(A/B)
# BC=round(B/C)
# CD=round(C/D)
# DE=round(D/E)
# ans=math.ceil(+math.ceil(AB)+math.ceil(BC)+math.ceil(CD)+math.ceil(DE))
ans=NA+AB+BC+CD+DE
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
NA=N/A
AB=A/B
BC=B/C
CD=C/D
DE=D/E
ans=math.ceil(math.ceil(NA)+math.ceil(AB)+math.ceil(BC)+math.ceil(CD)+math.ceil(DE))
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
print(max(map(lambda num: N // num, (int(input()) for _ in range(5)))) + 5)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[int(input()) for i in range(5)]
m=min(A)
for i in range(5):
    if A[i]==m:
        print(max(n//m+5,5))
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = [int(input()) for _ in range(6)]
m = 0
for i in range(5):
  n[i + 1] = min(n[i], n[i + 1])
  m += max(1 + (n[i] - 1) // n[i + 1], 1)
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=[input() for i in range(6)]
A=list(map(float, A))
N=A[0]
mini=min(A[1:])
print(int(((N+mini)//mini)+4))

Submission status: Wrong Answer

Solution code:
A=[input() for i in range(6)]
A=list(map(int, A))
N=A[0]
mini=min(A[1:])
print(max(((N+mini)//mini)+4,5))

Submission status: Wrong Answer

Solution code:
A=[input() for i in range(6)]
A=list(map(int, A))
N=A[0]
print(max((N//min(A[1:])+5),5))

Submission status: Wrong Answer

Solution code:
A=[int(input()) for i in range(6)]
N=A[0]
print(max((N//min(A[1:])+4),5))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(5+-int(-n/min(x)))

Submission status: Wrong Answer

Solution code:
import math

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

if min(A) >= n:
    print(5)
else:
    print(math.ceil(n//min(A))+4)

Submission status: Wrong Answer

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

if min(A) >= n:
    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 min(A) >= n:
    print(5)
else:
    print(n//2+5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

lis = []
min_num = min(a, b, c, d, e)
passed_min_flg = False

cnt = 0
for x in (a, b, c, d, e):
  if not passed_min_flg and x == min_num:
    passed_min_flg = True
    passed_num = cnt
    
  e = min_num if passed_min_flg else x 
  lis.append(e)
  cnt += 1

if n <= min_num:
  print(5)
elif passed_num == 0:
  print(n//2 + 5)
else:
  i = 0
  number = n
  ans = 0
  for x in (a, b, c, d, e):
    if i < passed_num:
      ans += math.ceil(number / x)
      number = x
    elif i == passed_num and number % x == 0:
      ans += 1
    i += 1

  print(ans + n - passed_num + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
abcde =[ int(input()) for _ in range(5)]
min_num = min(abcde)
print(5+math.ceil(N//min_num))

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil

def main():
    n, *capacity = map(int, sys.stdin.read().split())

    time = 0
    min_cap = capacity[0]
    for i in range(5):
        # 現時点で何人city i にいるか
        remain = n - (time - i) * min_cap
        min_cap = min(min_cap, capacity[i])
        time += ceil(remain / min_cap)

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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil

def main():
    n, *capacity = map(int, sys.stdin.read().split())

    time = 0
    min_cap = capacity[0]
    for i in range(5):
        # 現時点で何人city i にいるか
        remain = n - (time - i) * min_cap
        time += ceil(remain / min_cap)
        min_cap = min(min_cap, capacity[i])

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

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

a = min(A, B, C, D, E)
ans = 5
if N % a != 0:
    ans += (N // a) 
else:
    ans += (N // a) - 1
if a >= 5:
    ans = 5
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil

def main():
    n, *capacity = map(int, sys.stdin.read().split())

    max_peop = n
    time = 0
    for c in capacity:
        time += ceil(max_peop / c)
        if max_peop > c:
            max_peop = c

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
caps = [ int(input()) for _ in range(5) ]
times = [0]*5

for i,cap in enumerate(caps) :
  times[i] = math.ceil(n/cap)
  
#print(times)
a = [1,2,3,4,5]
b = []

for t,a in zip(times,a) :
  c = t-a if 0 <= t-a else 0
  b.append(c)

#print(b)
if sum(b) < 5 :
  print(sum(b)+5)
else:
  print(max(b)+5)

Submission status: Wrong Answer

Solution code:
N = int(input())
C = []
for _ in range(5):
    C.append(int(input()))
minA = min(C)
if N // 2 == 0:
    print(5 + (N // minA) - 1)
else:
    print(5 + (N // minA))

Submission status: Wrong Answer

Solution code:
import math

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

if A > N and B > N and C > N and D > N:
    print(5)

else:
    if A % 2 == 0:
        print(N // A + 5)

    else:
        print(math.ceil(N / A) + 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(4 + ((N+1) // min(A, B, C, D, E)))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC123 C - Five Transportations
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
min_num = 10**16
ans = 5
n = 0
for i in range(6):
    t = int(input())
    if i==0:
        n = t
    min_num = min(min_num,t)

if n==min_num:
    print(ans)
    exit()

a = n%min_num
if a == 0:
    ans += a-1
else:
    ans += (n//min_num)

print(ans)

Submission status: Wrong Answer

Solution code:
# ABC123 C - Five Transportations
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
min_num = 10**16
ans = 5
for i in range(5):
    if i==0:
        n = int(input())
    t = int(input())
    min_num = min(min_num,t)
a = n%min_num
if a == 0:
    ans += a-1
else:
    ans += (n//min_num)

print(ans)

Submission status: Wrong Answer

Solution code:
N,*C = [int(input()) for i in range(6)]
ans = 0
prew = 0 # 前回の待機時間
prep = 0 # 都市iに現在いる人数
curp = N # 都市i+1に現在いる人数
for i in range(5):
    if 0 < i:
        # 待機時間中に都市i-1から流入した人数 - 待機時間中に都市iから流出した人数 + 最後に都市i-1から流入した人数
        curp = max(0, prew*(C[i-1]-C[i])) + min(prep, C[i-1])
    w = max(0, curp // C[i] - 1 if curp % C[i] == 0 else curp // C[i])
    ans += w
    prew = w
    prep = max(0, curp - w*C[i])
print(ans+5)

Submission status: Wrong Answer

Solution code:
N,*C = [int(input()) for i in range(6)]
ans = 0
prew = 0 # 前回の待機時間
prep = 0 # 都市iに現在いる人数
curp = N # 都市i+1に現在いる人数
for i in range(5):
    if 0 < i:
        # 待機時間中に都市i-1から流入した人数 - 待機時間中に都市iから流出した人数 + 最後に都市i-1から流入した人数
        curp = max(0, prew*(C[i-1]-C[i])) + min(prep, C[i-1])
    w = max(0, curp // C[i] - 1 if curp % C[i] == 0 else curp // C[i])
    ans += w
    prew = w
    prep = curp - w * C[i]
print(ans+5)

Submission status: Wrong Answer

Solution code:
N,*C = [int(input()) for i in range(6)]
ans = 0
prew = 0 # 前回の待機時間
popu = N # 都市i+1に現在いる人数
for i in range(5):
    if i == 0:
        p = popu
    else:
        # 都市i+1に現在いる人数
        # 前回の待機時間+1分間に都市iから流入してきた人数 - 待機時間中に都市iから出ていった人数
        p = max(0, min(popu, (prew+1) * C[i-1]) - (prew) * C[i])
    w = max(0, p // C[i] - 1 if p % C[i] == 0 else p // C[i])
    ans += w
    prew = w
    popu = p
print(ans+5)

Submission status: Wrong Answer

Solution code:
N,*C = [int(input()) for i in range(6)]
ans = 0
prew = 0 # 前回の待機時間
popu = N # 都市i+1に現在いる人数
for i in range(5):
    if i == 0:
        p = popu
    else:
        # 都市i+1に現在いる人数
        # 前回の待機時間に都市iから流入してきた人数 - 待機時間-1分間で都市iから出ていった人数
        p = max(0, min(popu, (prew) * C[i-1]) - (prew-1) * C[i])
    w = p // C[i] - 1 if p % C[i] == 0 else p // C[i]
    ans += w
    prew = w
    popu = p
print(ans+5)

Submission status: Wrong Answer

Solution code:
N,*C = [int(input()) for i in range(6)]
ans = 0
prew = 0 # 前回の待機時間
for i in range(5):
    if i == 0:
        p = N
    else:
        # 都市i+1に現在いる人数
        # 前回の待機時間に都市iから流入してきた人数 - 待機時間-1分間で都市iから出ていった人数
        p = max(0, prew * C[i-1] - (prew-1) * C[i])
    w = max(0, p // C[i] - 1 if p % C[i] == 0 else p // C[i])
    ans += w
    prew = w
print(ans+5)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = [int(input()) for _ in range(5)]
last_time = 0
math.ceil(N / min(A)) + 4

Submission status: Wrong Answer

Solution code:
n=int(input())
b=min([int(input()) for i in range(5)])
if b>=n:
	print(5)
else:
	print(5+(n+b-1//b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
b=min([int(input()) for i in range(5)])
if b>=n:
	print(5)
else:
	print(5+b//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

cnt = 5
while neck < n:
  cnt += 1
  neck += neck

print(cnt)

Submission status: Wrong Answer

Solution code:
import math
a=[]
b=[]

for i in range(0,6):
  a.append(int(input()))

for j in range(1,6):
  b.append(math.ceil(a[0]//a[j]))
  
print(max(b)+4)

Submission status: Wrong Answer

Solution code:
a=[]
b=[]

for i in range(0,6):
  a.append(int(input()))

for j in range(1,6):
  b.append(a[0]//a[j])
  
print(int(max(b)+5))

Submission status: Wrong Answer

Solution code:
a=[]
b=[]

for i in range(0,6):
  a.append(int(input()))

for j in range(1,6):
  b.append(a[0]//a[j])
  
print(max(b)+5)

Submission status: Wrong Answer

Solution code:
a=[]
b=[]

for i in range(0,6):
  a.append(int(input()))

for j in range(1,6):
  b.append(a[0]//a[j])
  
ans=b[0]  
for k in range(1,5):
  if b[k]<=b[k-1]:
    ans+=0
  else:
    ans+=b[k]-b[k-1]
    
print(int(ans+5))

Submission status: Wrong Answer

Solution code:
a=[]
b=[]

for i in range(0,6):
  a.append(int(input()))

for j in range(1,6):
  b.append(a[0]//a[j])
  
ans=b[0]  
for k in range(1,5):
  if b[k]<=b[k-1]:
    ans+=0
  else:
    ans+=b[k]-b[k-1]
    
print(ans+5)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=[int(input()) for i in range(5)]
time=0
x=n
for i in range(4):
  if x%d[i]:
    time+=x//d[i]+1
  else:
    time+=x//d[i]
  if x==0:
    time+=1
  x-=(time-1)*d[i+1]
  if x<=0:
    x=0
    
if x%d[-1]:
  time+=x//d[-1]+1
else:
  time+=x//d[-1]
if x==0:
  time+=1
print(time)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=[int(input()) for i in range(5)]
time=0
x=n
for i in range(4):
  if x%d[i]:
    time+=x//d[i]+1
  elif x==0:
    time+=1
  else:
    time+=x//d[i]
  x-=time*d[i+1]
  if x<=0:
    x=0
    
if x%d[-1]:
  time+=x//d[-1]+1
elif x==0:
  time+=1
else:
  time+=x//d[-1]
print(time)

Submission status: Wrong Answer

Solution code:

n = int(input())

trans = [0]*5
for i in range(5):
  trans[i]=int(input())

min_trans = min(trans)

t = n//min_trans + 1 + 4

print(t)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

print(int(np.ceil(N // min(A, B, C, D, E))+5))

Submission status: Wrong Answer

Solution code:
n,a,b,c,d,e=open(0);print(-(-int(n)//int(min(a,b,c,d,e)))+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())
sta = -(-n//a) #spend tame a
nb = max(n%a if n%a!=0 else a,n-(b)*(sta-1)) # now b
stb = -(-nb//b)
nc = max(nb%b if nb%b!=0 else b,nb-(c)*(stb-1))
stc = -(-nc//c)
nd = max(nc%c if nc%c!=0 else c,nc-(d)*(stc-1))
std = -(-nd//d)
ne = max(nd%d if nd%d!=0 else d,nd-(e)*(std-1))
ste = -(-ne//e)
ans = sta + stb + stc + std + ste
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sta = -(-n//a) #spend tame a
na = max(n%a,n-(b)*(sta-1)) # now a
stb = -(-na//b)
nb = max(na%b,na-(c)*(stb-1))
stc = -(-nb//c)
nc = max(nb%c,nb-(d)*(stc-1))
std = -(-nc//d)
nd = max(nc%d,nc-(e)*(std-1))
ste = -(-nd//e)
ans = sta + stb + stc + std + ste
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
def solve():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())

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

if __name__ == '__main__':
    solve()