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: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    A = [int(input()) for _ in range(5)]

    ans = 0
    neck = min(A)

    ans += N // neck + 4
    if N % neck != 0:
        ans += 1

    return ans


if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
import math

def solve():
  N = int(input())
  ABCDE = [int(input()) for i in range(5)]
  return 4 + math.ceil(N / min(ABCDE))

print(solve())

Submission status: Accepted

Solution code:
N = int(input())
x = [int(input()) for _ in range(5)]
i, m = min(enumerate(x), key = lambda y: y[1])
if m > N:
    ans = 5
elif N % m:
    ans = N // m + 5
else:
    ans = N // m + 4
print(ans)

Submission status: Accepted

Solution code:
import math
import copy
from collections import Counter
from _ast import Or
 
 
 
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:
 
            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
 
n=int(input())
a=nCast(inputArr(5))


                   
   

def func():
    mm=min(a)
    k=0
    if n%mm!=0:
        k=1
    k+=int(n/mm)+4
    return k
print(func())

Submission status: Accepted

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

Submission status: Accepted

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

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

smallest = 10 ** 15
bottle = 0
for i in range(5):
    if ts[i] < smallest:
        bottle = i
        smallest = ts[i]

total = bottle + N // smallest
if N % smallest != 0:
    total += 1
total += 4 - bottle
print(total)

Submission status: Accepted

Solution code:
N = int(input())
ABCDE = [int(input()) for i in range(5)]
key = min(ABCDE)
key = N / key + 4
if key != int(key):
    key = int(key + 1)
print(int(key))

Submission status: Accepted

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

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

if n % bn == 0:
    tp = n // bn
else:
    tp = (n // bn) + 1

print(5 + tp - 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
m=[int(input()) for i in range(5)]
minimum=10**15
import math
for i in m:
    minimum=min(minimum,i)
print(math.ceil(n/minimum)+4)

Submission status: Accepted

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

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

if N % capacity == 0:
    answer = N // capacity + 4
else:
    answer = N // capacity + 5

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def solve():
  n = int(input())
  a = [int(input()) for _ in range(5)]
  #step1to2
  time = 0
  time += math.ceil(n/a[0])
  people = a[0]
  #print(time)
  #step2to3
  for i in range(1,5):
    if people <= a[i]:
      time += 1
    else:
      
      time += 1+math.ceil(n/a[i])-math.ceil(n/people)
      people = min(people,a[i])
    #print(time)
  print(time)
      
    
solve()

Submission status: Accepted

Solution code:
import math

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

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

print(N // minABCDE + math.ceil((N % minABCDE) / minABCDE) + 4)

Submission status: Accepted

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

a_min = min(a)

ans = (N+(a_min-1))//a_min-1+5
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list()
for i in range(0,5):
    a.append(int(input()))

k  = min(a)
r = 0
if n % k != 0:
    r = 1

print(5+(n//k)-1+r)

Submission status: Accepted

Solution code:
import math
N = int(input())
l = [int(input()) for _ in range(5)]
l.sort()

print(math.ceil(N/l[0])+4)

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
import math
print(math.ceil(n/min(a,b,c,d,e))+4)

Submission status: Accepted

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

k=min(a,b,c,d,e)
print(5+n//k-(n%k==0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
import math
# import numpy as np

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()

N = d_in()
max_people = []
for i in range(5):
    max_people.append(d_in())

min_p = min(max_people)
min_idx = 5
for i in range(5):
    if max_people[i] == min_p:
        min_idx = i
        break

cost = 0
cost += 4
cost += math.ceil(N / min_p)

print(cost)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from itertools import chain
from functools import reduce
from collections import OrderedDict, Counter, deque
import operator

IS = lambda: int(input())

N = IS()
A = [IS() for _ in range(5)]

mn = min(A)
mi = A.index(mn)
d,m = divmod(N, mn)
print(4 + d + (m != 0))

Submission status: Accepted

Solution code:
from math import ceil


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

for _ in range(5):
  l.append(int(input()))
neck = min(l)

group_num = n // neck if n % neck == 0 else n // neck + 1

print(4+group_num)

Submission status: Accepted

Solution code:
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

N=ri()
A=rr(5)
ma=min(A)
ans = 5+N//ma
ans -= 1 if N%ma==0 else 0
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input())

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

minidx = 0
for i in range(5):
    if nums[i] < nums[minidx]:
        minidx = i

minnum = nums[minidx]

if n % minnum == 0:
    print(4 + n // minnum)
else:
    print(4 + n // minnum + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
min_p = N
for i in range(5):
    p = int(input())
    min_p = min(min_p, p)
print(N // min_p + int(bool(N % min_p)) + 4)

Submission status: Accepted

Solution code:
# import numpy as np
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

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

min_norimono = min(norimono_lis)

if n % min_norimono == 0:
    ans = (n//min_norimono) + 4
else:
    ans = (n//min_norimono) + 5
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import itertools
import collections
import functools
import math
from queue import Queue
# import numpy as np
INF = float("inf")


def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    t = [A, B, C, D, E]
    mt = min(t)
    print((N-1)//mt + 5)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    solve(N, A, B, C, D, E)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
mn = int(input())
for i in range(4):
  mn = min(mn, int(input()))
if n <= mn:
  print(5)
else:
  print(5 + (n - 1) // mn)

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


# globals
inf = float('inf')
N = 0


def set_inputs():
    global N
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    # ----------MAIN----------
    n = get_int()
    a = get_int()
    b = get_int()
    c = get_int()
    d = get_int()
    e = get_int()
    m = min(a, b, c, d, e)
    print(5 + (n + m - 1) // m - 1)
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if N%min(li) != 0:
    a = N//min(li)+1
else:
    a = N//min(li)
print(4+a)

Submission status: Accepted

Solution code:


import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return int(stdin.readline())

N = li()
a = li()
b = li()
c = li()
d = li()
e = li()

bottle_neck = min([a, b, c, d, e])
red = (N - 1) // bottle_neck
print(5 + red)

Submission status: Accepted

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

x = - (- N // min(A, B, C, D, E))
print(5 + (x - 1))

Submission status: Accepted

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

min_number=min(people)
first_need=-(-n//min_number)-1
print(first_need+5)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 20:39:55 2019

@author: Yamazaki Kenichi
"""
import math

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)
t = math.ceil(N/neck)

print(t + 4)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(5)]
b = min(A)
ans = 4 + N // b
if N % b > 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
trans = []
for i in range(5):
    trans.append(int(input()))
narrow = min(trans)
if N % narrow != 0:
    pair = N // narrow + 1
else:
    pair = N // narrow
print(str(pair+4))
#1組目が着くのは5分後
#2->6
#3->7

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g


# 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()
# b.sort()
# c.sort()
# a = a[::-1]
# b = b[::-1]
# c = c[::-1]
#
# d=0
# e=0
# f=0
# for i in range(k):


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

mov.sort()

min = mov[0]

if min >= n:
    print(5)
else:
    if n % min != 0:
        ex = n // min
    else:
        ex = n//min -1

    print(5+ex)

Submission status: Accepted

Solution code:
#coding:utf-8
import math
N = int(input())
A = [0] * 5
for i in range(len(A)):
    A[i] = int(input())
min_a = min(A)
print(math.ceil(N/min_a)+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

x = []

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

m = min(x)

print(4+n//m+(n%m!=0))

Submission status: Accepted

Solution code:
board = []
for _ in range(6):
    board.append(int(input()))

n = board[0]
neck = min(board[1:])

if neck == 1:
    print(n + 4)
else:
    print(n // neck + 5)

Submission status: Accepted

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

for _ in range(5):
    time.append(int(input()))

bn = min(time)
if n % bn == 0:
    print((n//bn)+4)
else:
    print((n//bn) + 5)

Submission status: Accepted

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

x=min(A,B,C,D,E)
loss=-(-(N-x)//x)

print(max(5+loss,5))

Submission status: Accepted

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

Submission status: Accepted

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

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

min_a = min(a)
min_i = a.index(min_a)

print(4 - (-n//min_a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = ni()
b = ni()
c = ni()
d = ni()
e = ni()

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

ans = 5 + (n-1) // k
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = [int(input()) for i in range(5)]
t = min(s)
a,b = divmod(n,t)
if b == 0:
    print(5 + a - 1)
else:
    print(5 + a)

Submission status: Accepted

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

a = min(atoe)

if n%a==0:
    print(n//a+4)
else:
    print(n//a+5)

Submission status: Accepted

Solution code:
import collections as c
ip = lambda : map(int, input().split())

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

ans = 0
ans += (N+A-1)//A
bt = ans
# print('------------')
# print(ans)

b = A
for i in [B,C,D,E]:
    if b <= i:
        ans += 1
    else:
        b = i
        ans += (N+i-1)//i - bt +1
        bt = (N+i-1)//i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

mi = d[0]
Ans = math.ceil(N / mi)
for i in d[1:]:
  Ans += 1
  if i < mi:
    x = math.ceil(N / i) - math.ceil(N / mi)
    Ans += x
    mi = i   

print(Ans)

Submission status: Accepted

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

ans = 0

ans += N // min(L)
if N % min(L) != 0 :
    ans += 1
ans += 4
print(ans)

Submission status: Accepted

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: Accepted

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

def f(a):
    if n%a==0:
        return n//a
    else:
        return n//a+1
l=[]
for i in [a,b,c,d,e]:
    l.append(f(i))

print(max(l)+4)

Submission status: Accepted

Solution code:
N=int(input())
L=[]
for i in range(5):
    a=int(input())
    L.append(a)
#print(min(L))

if N%min(L)==0:
    print(4+N//min(L))
else:
    print(5+N//min(L))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8-*-
if __name__ == '__main__':
    N = int(input())
    a = []
    for i in range(5):
        a.append(int(input()))
    m = min(a)
    s = N // m + 4
    if N % m != 0:
        s += 1
    print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
m = 1<<50
for _ in range(5):
    tmp = int(input())
    m = min(m, tmp)

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

Submission status: Accepted

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

Submission status: Accepted

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)
m = min(L)
print((N + m - 1) // m + 4)

Submission status: Accepted

Solution code:

n = int(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:
    print(n // min(a, b, c, d, e)+4)
else:
    print(n // min(a, b, c, d, e)+1+4)

Submission status: Accepted

Solution code:
import math
import sys

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

m=min(a)

tmp=-1
for i in range(5):
    if a[i]==m: p=i


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

Submission status: Accepted

Solution code:
import itertools

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

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

if r >= n:
    print(5)
else:
    loss = n // r

    if n % r != 0:
        loss += 1
        
    print(loss + 4)

Submission status: Accepted

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

Submission status: Accepted

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

import math

ans = max(5, math.ceil(n/min(a))+4)
print(ans)

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
m = float('inf')
for _ in range(5):
    m = min(m, int(input()))
print(4 + ceil(N / m))

Submission status: Accepted

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

x = min([a, b, c, d, e])
print(-(-n // x) + 4)

Submission status: Accepted

Solution code:
from math import ceil


def five_transportations(N: int, A: int, B: int, C: int, D: int, E: int)->int:
    return 5 + ceil(N / min(A, B, C, D, E)) - 1


if __name__ == "__main__":
    inputs = [int(input()) for _ in range(6)]
    N, A, B, C, D, E = inputs
    ans = five_transportations(N, A, B, C, D, E)
    print(ans)

Submission status: Accepted

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

minA = min(ABCDEs)

ans = -(- N // minA) + 4
print(ans)

Submission status: Accepted

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

neck_idx = -1
neck = -1
for i in range(5):
    if min(A) == A[i]:
        neck_idx = i
        neck = A[i]
        break

x = N // neck
if N % neck > 0:
    x += 1

print(x + 4)

Submission status: Accepted

Solution code:
A=[]
for i in range(6):
  A.append(int(input()))
x=min(A[1:])
ans=A[0]//x
ans+=1 if A[0]%x!=0 else 0
print(ans+4)

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-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 pf(s): return print(s, flush=True)

N = I()

l = []
for i in range(5):
    l.append(I())

min_value = min(l)
hoge = math.ceil(N / min_value)
#  print(hoge)
print(hoge+4)
#  counts = [N,0,0,0,0,0]
#  result = 0
#  while counts[-1] != N:
#      tmp = [_ for _ in counts]
#      for c in reversed(range(1, 6)):
#          if counts[c-1] > 0:
#              change = min(l[c-1], counts[c-1])
#              counts[c-1] -= change
#              counts[c] += change
#      print(counts)
#      result += 1
#  print(result)

Submission status: Accepted

Solution code:
a = int(input())
l = []
for i in range(5):
  l.append(int(input()))
m = min(l)
s = -(-a//m)
print(s+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def start_process(length, num):

    print(ans)

def main():
    N = int(input())
    a = [int(input()) for i in range(5)]
    min_data = min(a)
    ans = 4 + math.ceil(N / min_data)
    print(ans)

def kari():
    a = list(map(int, input().split()))
    a, b = map(int, input().split())

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int,ss_raw()))

N = int_raw()
poss = []
for i in range(5):
    p = int_raw()
    poss.append(p)

def main():
    minp = min(poss)
    return ((N+minp-1)//minp)+4

print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(5):
    a.append(int(input()))
m = min(a)
if n % m == 0:
    delay = n//m - 1
else:
    delay = n//m 
time = 5 + delay
print(time)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())

# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

input = sys.stdin.readline

# N個整数
# a, b, c = list(map(int, input().split()))

# 1整数
# n = int(input())

# 空白区切りリスト整数
# b = list(map(int, input().split()))

# 空白区切り文字列
# t, d = input().split()

n = int(input())

mm = 9999999999999999

ll = []
for i in range(5):
    mm = min(mm, int(input()))
    # ll.append(int(input()))

print((n-1) // mm + 5)

Submission status: Accepted

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

min_a = min(a)
ans = n // min_a
if n % min_a != 0:
    ans += 1
ans += 4


print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
times = [int(input()) for _ in range(5)]
m = min(times)
i = times.index(m)
print(int(math.ceil(n / m)) + 4)

Submission status: Accepted

Solution code:
import math

N = int(input())

vals = []
for _ in range(5):
	vals.append( int(input()) )

bottle_neck = min(vals)


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

Submission status: Accepted

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)

count = 5 + ((n-1)//min_)

print(count)

Submission status: Accepted

Solution code:
N=int(input())
X=[int(input()) for i in range(5)]
Y=[-((-N)//X[i])+4 for i in range(5)]
print(max(Y))

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if min(a,b,c,d,e)>=n:
  print(5)
else:
  print((n+min(a,b,c,d,e)-1)//min(a,b,c,d,e)+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

a = min(A)

ans = math.ceil(N / a) + 4
print(ans)

Submission status: Accepted

Solution code:
import atexit
import io
import sys
from math import *

buff = io.BytesIO()
sys.stdout = buff


@atexit.register
def write():
    sys.__stdout__.write(buff.getvalue())


n = input()
l = []
for i in xrange(5):
	l.append(input())
l.sort()
trips = int(ceil(n/float(l[0])))
print 5 + trips-1

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
N = int(input())

min_a = 10 ** 18
for i in range(5):
    a = int(input())
    min_a = min(a, min_a)

n = -(-N // min_a)
n -= 1

print(n+5)

Submission status: Accepted

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)
cnt = (n-1)//m + 1
print(cnt+4)

Submission status: Accepted

Solution code:
n=int(input());a=[int(input())for _ in range(5)];a.sort();print(((n-1)//a[0])+5)

Submission status: Accepted

Solution code:
def solve():
    N=int(input())
    A=[0]*5
    for i in range(5):
        A[i]=int(input())
    a = min(A)
    return (N+(a-1))//a - 1 + 5

print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def solve(n, a, b, c, d, e):
    return math.ceil(n / min(a, b, c, d, e)) + 4



if __name__ == "__main__":
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    print(solve(n, a, b, c, d, e))

Submission status: Accepted

Solution code:
import math

def main(n, m):
    rissoku = min(m)

    retval = 4 + math.ceil(n/rissoku)
    
    return '{}'.format(int(retval))

if __name__ == '__main__':
    try:
        m = []
        n = int(input().strip())
        for i in range(5):
            m.append(int(input().strip()))
        print('{}'.format(main(n, m)))
    except EOFError:
        pass

Submission status: Accepted

Solution code:
N, *T = map(int, open(0).read().split())
t = min(T)
print((N+t-1)//t+4)

Submission status: Accepted

Solution code:
n = int(input())

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

index = 0
mi = num[0]
for i in range(5):
    if num[i] < mi:
        index = i
        mi = num[i]

if n % mi == 0:
    print(n // mi + 4)
else:
    print(n // mi + 5)

Submission status: Accepted

Solution code:
N=int(input())
X=[int(input()) for i in range(5)]
bef=float('inf')
for x in X:
    if bef>x:
        now=(N+x-1)//x
        bef=x
print(now+4)

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
num = min(A, B, C, D, E)
if N <= num:
    print(5)
else:
    print((N+num-1)//num+4)

Submission status: Accepted

Solution code:
#C問題
import math
N=int(input())
A=[int(input()) for i in range(5)]
n=math.ceil(N/min(A))
print(5+n-1)

Submission status: Accepted

Solution code:
import math
N, A, B, C, D, E = (int(input()) for i in range(6))
print(math.ceil(N / min((A, B, C, D, E))) + 4)

Submission status: Accepted

Solution code:
n = int(input())
q = [int(input()) for i in range(5)]
ans =5 + n//min(q)
if n%min(q) == 0:
    ans-=1
print(ans)

Submission status: Accepted

Solution code:

N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
import numpy as np

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

print(int(np.ceil(N/F))+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lis = [int(input()) for i in range(5)]
key = 0
if n % min(lis) == 0:key = 1
print(5 + n//min(lis)-key)