Problem: 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.

Submission attempts (in order):
n = int(input())
def move(max_num,before):
  return min(max_num,before)

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

time = 0
while True:
#for j in range(10):
  time += 1
  move_p = [0] * 6
  for i in range(5):
    move_p[i] -= min(max_nums[i],people[i])
    move_p[i+1] += min(max_nums[i],people[i])
  people = list(map(sum,zip(people,move_p)))
  print(people)
  if people[-1] == n:
    break

print(time)

n = int(input())

max_nums = []
for i in range(5):
  max_nums.append(int(input()))
max_nums.append(n)
a = n/min(max_nums)
print(int(a)*5 + (0 if a == int(a) else 1))

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

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

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

print(time)

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

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

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



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

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

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



n = int(input())

max_nums = []
for i in range(5):
  max_nums.append(int(input()))
a = n/min(max_nums)
print(int(a)*5 + (0 if a == int(a) else 1))



n = int(input())

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

n = int(input())

max_nums = []
for i in range(5):
  max_nums.append(int(input()))
max_nums.append(n)
a = n/min(max_nums)
print(int(a) +4+ (0 if a == int(a) else 1))

Verdicts: Wrong Answer

Wrong Answer

Time Limit Exceeded

Time Limit Exceeded

Runtime Error

Wrong Answer

Wrong Answer

Accepted