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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

    ans = 0
    for i in range(5):
        res = (N + A[i] - 1) // A[i] + 4
        if ans < res:
            ans = res

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
time = [int(input()) for _ in range(5)]
count = 0
if all([i >= n for i in time]):
    print(5)
else:
    smallest = min(time)
    smallest_index = time.index(smallest)
    count += n // smallest
    if n % smallest != 0:
        count += 1
    print(count + 4)

Submission status: Accepted

Solution code:
n = int(input())
time = [int(input()) for _ in range(5)]
count = 0
if all([i >= n for i in time]):
    print(5)
else:
    smallest = min(time)
    smallest_index = time.index(smallest)
    count += n // smallest
    if n % smallest != 0:
        count += 1
    print(count + 4)

Submission status: Accepted

Solution code:
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

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

    ans = (math.ceil(n/min(a,b,c,d,e)))+4
    print(ans)


if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
X = [int(input()), int(input()), int(input()), int(input()), int(input())]

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

Submission status: Accepted

Solution code:
import math

N=int(input())
A=[int(input()) for _ in range(5)]
print(math.ceil(N/min(A))+4)

Submission status: Accepted

Solution code:
import math

N=int(input())
A=[int(input()) for _ in range(5)]
n=min(A)
for i in range(5):
  if n==A[i]:
    p=i
    break
k=math.ceil(N/n)
print(k+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for i in range(5)] #A[i]:amount of people able to be carried at once from i to i+1
B = [0] * 6 #B[i]:amount of people at i now 
cnt = 0

#max people able to be transported in m minutes
P = [0] * 9
B[0] = 10**15
for m in range(9):
    for i in range(5,0,-1):
        B[i] += min(A[i-1],B[i-1])
        B[i-1] -= min(A[i-1],B[i-1])
        
    P[m] = B[5]
    cnt += 1
#print(P)
x = N // P[-1]
y = N % P[-1]
if y == 0:
    print(5*x+4)
    exit(0)
for j in range(7,2,-1):
    if P[j]<y:
        time = 5 * x + j + 2
        print(time)
        exit(0)

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
D = []
for i in range(5):
    D.append(int(input()))

print(ceil(N/min(D)) + 4)

Submission status: Accepted

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

Submission status: Accepted

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

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

def main():
	n=II()
	A=[II() for _ in range(5)]
	print(5+(n-1)//min(A))









if __name__ == "__main__":
	main()

Submission status: Accepted

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

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()


def main():
	n=II()
	A=[II() for _ in range(5)]
	print(5+(n-1)//min(A))









if __name__ == "__main__":
	main()

Submission status: Accepted

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

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

import numpy as np

def main():
	n=II()
	A=[II() for _ in range(5)]
	print(5+(n-1)//min(A))









if __name__ == "__main__":
	main()

Submission status: Accepted

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

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

import numpy as np

def main():
	n=II()
	A=[II() for _ in range(5)]
	ans=0

	for i in A:
		ans=max(ans,(n-1)//i)

	ans+=5

	print(ans)









if __name__ == "__main__":
	main()

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

Submission status: Accepted

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

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

min_value = min(move)
group_count = -(-N // min_value)

# 最後のグループが出発するまでの値はgroup_count - 1
print(group_count - 1 + 5)

Submission status: Accepted

Solution code:
import math
N = int(input())
move = []
for i in range(5):
    move.append(int(input()))
movemin=min(move)
if movemin>=N:
    ans=5
else:
    ans=(math.ceil(N/movemin))+4

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, *a = map(int, open(0).read().split())
b = min(a)
print(4 + (n + b - 1) // b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(int(input()) for _ in range(5))
Min = min(a)

if n <= Min:
    print(5)
    exit()

x = n//Min
if n%Min != 0: x += 1
print(4-a.index(Min)+x+a.index(Min))

Submission status: Accepted

Solution code:
N,*A=map(int,open(0))
print(5+(N-1)//min(A))

Submission status: Accepted

Solution code:
import math
from decimal import Decimal

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

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

print(math.ceil((n)/(s)) + 4)

Submission status: Accepted

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
    m = min(l)
    minute = 0
    if N % m != 0:
        minute += 1
    minute += N // m
    minute += 4
    print(minute)
    # 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)
    #     city_capa = city_capa - (t-1) * min(tr_capa, next_tr_capa)
    #     ans += t
    # print(ans)
main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import sys 
import math
input = sys.stdin.readline

n = int(input())
a = [int(input()) for _ in range(5)]
ans = math.ceil(n/min(a)) + 4 
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 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())

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

Submission status: Accepted

Solution code:
n, *l = (int(input()) for _ in range(6))
print((n - 1) // min(l) + 5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from decimal import Decimal

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

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

print(math.ceil(Decimal(n)/Decimal(s) + 4))

Submission status: Accepted

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

m = min(a)

t = (n-1) // m

print(t+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)
import math
print(math.ceil(n/m)+4)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def readinput():
    n=int(input())
    a=int(input())
    b=int(input())
    c=int(input())
    d=int(input())
    e=int(input())
    return n,a,b,c,d,e

def main(n,a,b,c,d,e):
    r=min(a,b,c,d,e)
    m=n//r
    if n%r!=0:
        m+=1
    return m+4

if __name__=='__main__':
    n,a,b,c,d,e=readinput()
    ans=main(n,a,b,c,d,e)
    print(ans)

Submission status: Accepted

Solution code:
n=int(input())
p=float("INF")
for i in range(5):
  p=min(p,int(input()))
if n%p==0:
  print(n//p+4)
else:
  print(n//p+5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = []
for _ in range(5):
    a.append(int(input()))
min_num = a[0]
for i in range(5):
    if min_num > a[i]:
        min_num = a[i]
res = n // min_num + 5
if n % min_num == 0:
    res -= 1
print(res)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
transport = [int(input()) for _ in range(5)]
print(int(np.ceil(N / np.min(transport))) + 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_limit = min(a, b, c, d, e)
if n % min_limit == 0:
    cnt = n // min_limit
else:
    cnt = n // min_limit + 1
print(5 + cnt - 1)

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)
if X >= N:
  print(5)
else:
  if N%X == 0:
    print(4+N//X)
  else:
    print(5+N//X)

Submission status: Accepted

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

transmitList = [A, B, C, D, E]
minTransmit = min(transmitList)

answer = 5 + N // minTransmit

if minTransmit == 1:
    answer -= 1
    
print(answer)

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(x,y):
    return int((x+y-1)/y)

if e<d:
    d=e
if d<c:
    c=d
if c<b:
    b=c
if b<a:
    a=b
print(f(n,a)+4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,*cap=map(int,open(0).read().split())

m=min(cap)

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

Submission status: Accepted

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

min_limit = min(a, b, c, d, e)
if n % min_limit == 0:
    cnt = n // min_limit
else:
    cnt = n // min_limit + 1
print(5 + cnt - 1)

Submission status: Accepted

Solution code:
import bisect, copy, heapq, math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
abcde=[int(input()) for i in range(5)]
# print(n,abcde)

ans=4
for i in range(5):
    if min(abcde)==abcde[i]:
        ans+=math.ceil(n/abcde[i])
        break
print(ans)

Submission status: Accepted

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

cmax = (n + min(cnt) - 1) // min(cnt)
print(cmax - 1 + 5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(n,l):
  return (n - 1)//min(l) + 5



def main():
  N = int(input())
  l = [int(input()) for _ in range(5)]
  print(solve(N,l))
  return

if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
print(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())
import math
x = math.ceil(N / (min(A, B, C, D, E)))
ans = 5 + (x - 1)
print(ans)

Submission status: Accepted

Solution code:
import math

L = []
for _ in range(6):
  L.append(int(input()))

print(4 + math.ceil(L[0]/min(L[1:])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import ceil


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = int(input())
    T = [int(input()) for _ in range(5)]
    min_t = min(T)
    num = ceil(n / min_t)
    print(5 + num - 1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

n = int(input())
t = [0] * 5
for i in range(5):
    t[i] = int(input())
print(math.ceil(n / min(t)) + 4)

Submission status: Accepted

Solution code:
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = []
for i in range(5):
    a.append(INT())

x = min(a)
t = ( n + x - 1 ) // x
ans = 4 + t
print(ans)

Submission status: Accepted

Solution code:
n  = int(input())
a_to_e =[0] * 5
lowest_ride = 10 ** 15 + 1
for i in range(5):
    a_to_e[i] = int(input())
    if a_to_e[i] < lowest_ride:
        lowest_ride = a_to_e[i]

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

Submission status: Accepted

Solution code:
import math
N=int(input())
l=[int(input())for i in range(5)]
if N<=min(l):
    print(5)
else:
    m=[0]*5
    for i in range(5):
        m[i]=math.ceil(N/l[i])
    print(5+max(m)-1)

Submission status: Accepted

Solution code:
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
t = -(- N // min(a, b, c, d, e))
print(t + 4)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m = 10**15+5
min_arg = 0
for i, j in enumerate([a,b,c,d,e], 1):
    if j < m:
        min_arg = i
        m = j

print(N//m + (N%m!=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:
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
limit = [readInt() for i in range(5)]

ans = math.ceil(n/min(limit))+4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
nums = [int(input()) for _ in range(5)]
mn = min(nums)

print(4+math.ceil(n/mn))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, *s = map(int, open(0).read().split())
print(-(-n // min(s)) + 4)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
L = [int(input()) for _ in range(5)]
L.sort()
if N%L[0]:
  ans = N//L[0] + 1 + 4
else:
  ans = N//L[0] + 4
print(ans)

Submission status: Accepted

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

if N==1:
  print(5)
  exit()

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

Submission status: Accepted

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

ans = 0
m = N
for i, t in enumerate(T):
    if m > t:
        m = t
        ans = math.ceil(N/m) + i
    else:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def waru(A,B):
  if A%B==0:
    return A//B
  else:
    return (A//B)+1
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])
print(waru(N,a)+4)

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)

print(int((n - 0.5) // m + 5))

Submission status: Accepted

Solution code:
n = int(input())
costs = [int(input()) for _ in range(5)]
nums = [0] * 6
mc = min(costs)
counts = -(-n//mc)
print(counts+4)

Submission status: Accepted

Solution code:
# abc123_c.py
# https://atcoder.jp/contests/abc123/tasks/abc123_c

# C - Five Transportations /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点: 300点

# 問題文
# AtCoder 社は成長し、2028 年になってついに 6つの都市 (都市 1,2,3,4,5,6) からなる AtCoder 帝国を作りました！
# AtCoder 帝国には 5つの交通機関があります。

#     電車：都市 1から 2 まで 1 分で移動する。1 つの電車には A人まで乗ることができる。
#     バス：都市 2から 3 まで 1 分で移動する。1 つのバスには B人まで乗ることができる。
#     タクシー：都市 3から 4 まで 1 分で移動する。1 つのタクシーには C人まで乗ることができる。
#     飛行機：都市 4から 5 まで 1 分で移動する。1 つの飛行機には D人まで乗ることができる。
#     船：都市 5から 6 までを 1 分で移動する。1 つの船には E人まで乗ることができる。

# それぞれの交通機関は、各整数時刻 (0,1,2,3,...) に、都市から出発します。
# いま、N 人のグループが都市 1 におり、全員都市 6 まで移動したいです。全員が都市 6に到着するまでに最短で何分かかるでしょうか？
# なお、乗り継ぎにかかる時間を考える必要はありません。

# 制約
#     1≤N,A,B,C,D,E≤1015
#     入力中の値はすべて整数である。

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# A
# B
# C
# D
# E

# 出力
# 全員が都市 6に移動するのに必要な最小の時間を分単位で出力せよ。

# 入力例 1
# 5
# 3
# 2
# 4
# 3
# 5

# 出力例 1
# 7

# 例えば、次のような移動方法が考えられます。
# はじめ、次の画像のように、N=5人が都市 1にいます。

# 1分後までに、3 人が都市 1 から都市 2 に電車で移動します。ここで、電車は一度に 3人までしか運べないことに注意してください。

# 2分後までに、残り 2 人が都市 1 から都市 2 に電車で移動し、都市 2 にいた 3 人のうち 2 人がバスで都市 3 に移動します。
# ここで、バスは一度に 2人までしか運べないことに注意してください。

# 3分後までに、2 人が都市 2 から都市 3 にバスで移動し、2 人が都市 3 から都市 4にタクシーで移動します。

# それ以降は、まだ都市 6に到着していない人が止まらずに移動し続けると、全員が 7 分で都市 6 に着くことができます。
# また、6 分以内で全員が都市 6に着く方法はありません。

# 入力例 2
# 10
# 123
# 123
# 123
# 123
# 123

# 出力例 2
# 5

# どの交通機関も N=10人を 1 回で運ぶことができます。
# したがって、全員が止まらずに移動し続ければ 5 分で都市 6に着くことができます。

# 入力例 3
# 10000000007
# 2
# 3
# 5
# 7
# 11

# 出力例 3
# 5000000008

# 入力・出力が 32ビット整数型に収まらない可能性があることに注意してください。 


def log(line):
    if False:
        print(line)


def calculation(lines):
    # line = lines[0]
    # N = int(lines[0])
    # N, Q = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[1].split()))
    values = list()
    for i in range(6):
        values.append(int(lines[i]))
    # valueses = list()
    # for i in range(Q):
    #     valueses.append(list(map(int, lines[i+1].split())))

    N, A, B, C, D, E = values

    # ☆N回の状態遷移をループするバージョン。たぶん、8時間かかる。。。
    # state = [N, 0, 0, 0, 0, 0]
    # cnt = 0

    # while True:
    #     a, b, c, d, e, f = state
    #     shift_a = min(a, A)
    #     shift_b = min(b, B)
    #     shift_c = min(c, C)
    #     shift_d = min(d, D)
    #     shift_e = min(e, E)
    #     state = [a-shift_a, b+shift_a-shift_b, c+shift_b-shift_c, d+shift_c-shift_d, e+shift_d-shift_e, f+shift_e] 
    #     cnt += 1
    #     if f+shift_e == N:
    #         return [cnt]

    # 解答を見ました・・・なるほど。
    result = -(-N//min(values)) + 4

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['5', '3', '2', '4', '3', '5']
        lines_export = [7]
    if pattern == 2:
        lines_input = ['10', '123', '123', '123', '123', '123']
        lines_export = [5]
    if pattern == 3:
        lines_input = ['10000000007', '2', '3', '5', '7', '11']
        lines_export = [5000000008]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(6)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

mm = min(a, b, c, d, e)
ans = ((n + mm - 1) // mm) + 4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())

N = I()
print(max((N-1)//I() for _ in range(5)) + 5)

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

Submission status: Accepted

Solution code:
N=int(input())
a=[None]*5
for i in range(5):
    a[i] =int(input())
def minarg(l):
    nl=len(l)
    mi=10**20
    idx=-1
    for i in range(nl):
        if l[i]<mi:
            mi=l[i]
            idx=i
    return (idx,mi)
import math
i_min,a_min = minarg(a)
print(math.ceil(N/a_min) + 4)

Submission status: Accepted

Solution code:
def main2():
    N=int(input())
    #各交通機関の移動人数
    t=[int(input()) for _ in range(5)]
    MIN=min(t)
    if N%MIN==0:
        m=N//MIN+4
    else:
        m=N//MIN+1+4
    print(m)

if __name__=="__main__":
    main2()

Submission status: Accepted

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

Submission status: Accepted

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

# In[24]:


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


# In[26]:


mylist = [A,B,C,D,E]
x = min(mylist)
ans = -(-N//x)+4
print(ans)


# In[ ]:

Submission status: Accepted

Solution code:
import math

lst = []
for i in range(6):
    lst.append(int(input()))
min_ = min(lst[1:])
print(math.ceil(lst[0] / min_) + 4)

Submission status: Accepted

Solution code:
def main():
    import math
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    hakobu = min(a, b, c, d, e)
    kaisuu = math.ceil( n / hakobu)

    print(kaisuu + 4)



if __name__ == "__main__":
    main()

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

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

ans = math.ceil(n/min(a,b,c,d,e))+4
print(ans)

Submission status: Accepted

Solution code:
from math import *

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

print(ceil(n / min(t)) + 4)

Submission status: Accepted

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

bottle_neck=10**15+10

for i in range(5):
    if bottle_neck>x[i]:
        bottle_neck=x[i]

ans=ceil(n/bottle_neck)+4
print(ans)