TnT/Multi_CodeNet4Repair huggingface dataset:
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())
List = []
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))

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

n = int(input())
List = []
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))

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

Verdicts: Runtime Error

Accepted
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())
numbers = [int(input()) for _ in range(5)]
flag = True

for number in numbers:
    if number < N:
        flag = False
        
if flag:
    print(5)

N = int(input())
numbers = [int(input()) for _ in range(5)]
flag = True

for number in numbers:
    if number < N:
        flag = False
        
if flag:
    print(5)

else:
    sum_number = 0
    tunnel = 0
    flag = True
    
    for i in range(len(numbers)-1):
        sum_number += numbers[i]

        if numbers[i+1] < numbers[i]:
            tunnel += numbers[i+1] // numbers[i]
        
        if N <= sum_number:
            print(5 + tunnel + (N // numbers[0]))
            flag = False
            break
            
    if flag:
        print(5 + tunnel + N // numbers[0])

import math

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
def solve():
    num_total = int(input())
    num_transport=[0]*5
    for i in range(5):
        num_transport[i]=int(input())
    time = math.ceil(num_total/num_transport[0])
    x = num_transport[0]
    for i in range(1,5):
        if num_transport[i] < x:
            time = i+ math.ceil(num_total/num_transport[i])
            x = num_transport[i]
        else:
            time += 1
    print(time)

solve()

import math

def solve():
    num_total = int(input())
    num_transport=[0]*5
    for i in range(5):
        num_transport[i]=int(input())
    time = math.ceil(num_total/num_transport[0])
    x = num_transport[0]
    for i in range(1,5):
        if num_transport[i] < x:
            time = i+ math.ceil(num_total/num_transport[i])
            x = num_transport[i]
        else:
            time += 1
    print(time)


solve()

Verdicts: Runtime Error

Accepted
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())
lists = [int(input()) for i in range(5)]
city = [0,0,0,0,0]
time = 0
phase = 1

while sum(city) < n*5:
    for i in range(phase):
        city[i] = min(n,city[i] + lists[i])
        for j in range(5):
            if city[j] > 0:
                phase = max(phase,j+2)
    time += 1

print(time)


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

print(n/min(lists) + 4)


n = int(input())
lists = [int(input()) for i in range(5)]
city = [0,0,0,0,0]
time = 0
phase = 1

while sum(city) < 25:
    for i in range(phase):
        city[i] = min(5,city[i] + lists[i])
        for j in range(5):
            if city[j] > 0:
                phase = max(phase,j+2)
    time += 1

print(time)

n = int(input())
lists = [int(input()) for i in range(5)]
city = [0,0,0,0,0]
time = 0
phase = 1

while sum(city) < 25:
    for i in range(phase):
        city[i] = min(5,city[i] + lists[i])
        for j in range(5):
            if city[j] > 0:
                phase = max(phase,j+2)
    time += 1

print(time)

import math
n = int(input())
lists = [int(input()) for i in range(5)]

print(math.ceil(n/min(lists)) + 4)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
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):
import math
n = int(input())
cap = [int(input()) for i in range(5)]
cap.sort()
print(math.ceil(n/cap[0]) + 5)

import math
n = int(input())
cap = [int(input()) for i in range(5)]
cap.sort()
print(math.ceil(n/cap[0]) + 4)

Verdicts: Wrong Answer

Accepted
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):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 17:52:43 2019

@author: nakamuratakayuki
"""

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)
mn = l.index(m)
c = 0
cities = [N,0,0,0,0,0]
while l[mn] == 0:
    p00 = min(A,cities[0])
    p01 = min(B,cities[1])
    p02 = min(C,cities[2])
    p03 = min(D,cities[3])
    p04 = min(E,cities[4])
    cities[0]-=p00
    cities[1]-=p01
    cities[2]-=p02
    cities[3]-=p03
    cities[4]-=p04
    cities[1]+=p00
    cities[2]+=p01
    cities[3]+=p02
    cities[4]+=p03
    cities[5]+=p04
    c += 1
c += 5-mn+N//m
print(c)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 17:52:43 2019

@author: nakamuratakayuki
"""
import math
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)
mn = l.index(m)
c = 0
cities = [N,0,0,0,0,0]
while cities[mn] == 0:
    p00 = min(A,cities[0])
    p01 = min(B,cities[1])
    p02 = min(C,cities[2])
    p03 = min(D,cities[3])
    p04 = min(E,cities[4])
    cities[0]-=p00
    cities[1]-=p01
    cities[2]-=p02
    cities[3]-=p03
    cities[4]-=p04
    cities[1]+=p00
    cities[2]+=p01
    cities[3]+=p02
    cities[4]+=p03
    cities[5]+=p04
    c += 1
c += 5-mn+math.ceil(N/m)-1
print(c)

Verdicts: Wrong Answer

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


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)


Verdicts: Wrong Answer

Accepted
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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

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

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=[I() for _ in range(5)]

  for i in range(len(l)):
    if l[i]==min(l):
      return -(-n//l[i])+len(l)-i-1

print(main())


import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

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

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=[I() for _ in range(5)]

  for i in range(len(l)):
    if l[i]==min(l):
      return -(-n//l[i])+len(l)-1

print(main())


Verdicts: Wrong Answer

Accepted
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())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

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

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

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)
 
print(int((n-1)/min)+5)

Verdicts: Wrong Answer

Accepted
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):
import stdin from sys
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(5)]
m = min(li)
if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 5)


import stdin from sys
n = int(stdin.readline())
li = int(stdin.readlines())
m = min(li)
if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 5)

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(ceil(n/m) + 4)

import stdin from sys
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip() for _ in range(5))]
m = min(li)
if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 5)

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
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())
Cap = [int(input()) for X in range(0,5)]
print(int(math.ceil(N/min(Cap))+4))

N = int(input())
Cap = [int(input()) for X in range(0,5)]
Str = math.ceil(N/Cap[0])
for T in range(0,len(Cap)-1):
    Str += math.ceil(Cap[T]/Cap[T+1])
print(Str)

import math
N = int(input())
Cap = [int(input()) for X in range(0,5)]
print(int(math.ceil(N/min(Cap))+4))

Verdicts: Runtime Error

Runtime Error

Accepted
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):
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())))
D = []
E = []
for i in range(x):
  for j in range(y):
    D.append(A[i]+B[j])
D.sort()
for i in range(z):
  for j in range(min(len(D),k)):
    E.append(C[i]+D[::-1][j])
print("\n".join(map(str,sorted(E)[::-1][:k])))


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

Verdicts: Runtime Error

Accepted
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 = 6
t = [int(input()) for i in range(n)]

time = 5
time = time + (t[0] // min(t) -1)

print(time)


import math

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

time = 4 + math.ceil((k / min(t)))

print(time)


Verdicts: Wrong Answer

Accepted
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())
a=int(10**15+1)
for _ in range(5):
    b=int(input())
    a=min(a,b)
if a>=n:
    ans=5
else:
    ans=5+(n-a)//a
print(ans)


n=int(input())
a=int(10**15+1)
for _ in range(5):
    b=int(input())
    a=min(a,b)
if a>=n:
    ans=5
else:
    ans=5+(n-1)//a
print(ans)


Verdicts: Wrong Answer

Accepted
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())
A = [int(input()) for i in range(5)]
A.sort()
if N<=A[0]:
    print(5)
else:
    block = N//A[0]+1
    if block<6:
        print(block*3+(block-2))
    else:
        print(10+(block-6))


import math
N = int(input())
A = [int(input()) for i in range(5)]
A.sort()
cnt = N/A[0]
print(math.ceil(cnt)+4)


Verdicts: Wrong Answer

Accepted
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())
a = [int(input()) for i in range(5)]

print((n - 1) // min(a) + 6)

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

print((n - 1) // min(a) + 5)

Verdicts: Wrong Answer

Accepted
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,a,b,c,d,e=[int(input()) for i in range(6)]
dist=[n,0,0,0,0,0]
move=[a,b,c,d,e]
t=0
while dist[5]<n:
  dist[0]=max(0,dist[0]-move[0])
  dist[5]=dist[5]+min(dist[4],move[4])
  for j in range(1,5):
    dist[j]=max(0,dist[j]-move[j])+min(dist[j-1],move[j-1])
  t=t+1
print(t)
    


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


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


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

n=int(input())
A=[int(input()) for i in range(5)]
print(5+(n-1)//min(A))

Verdicts: Time Limit Exceeded

Time Limit Exceeded

Runtime Error

Wrong Answer

Accepted
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())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

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

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])
if N%m ==0:
  ad = (N//m)-1
else:
  ad = (N//m)
print(ad+5)



Verdicts: Wrong Answer

Accepted
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):
import math
n = int(input())
for i in range(5):
  l = int(input())
print(math.ceil(n/min(l))+4)

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

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


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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
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):
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

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

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

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

Verdicts: Runtime Error

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

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

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


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

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


Verdicts: Runtime Error

Accepted
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())
moves = [int(input()) for _ in range(5)]
a = min(moves)
lst = [N % a ,0,0,0,0]
ret = N // a

if N % a == 0:
    print(ret)
else:
    if a == lst[0]:
        print(ret + 5)
    elif a == lst[1]:
        print(ret + 4)
    elif a == lst[2]:
        print(ret + 3)
    elif a == [3]:
        print(ret + 2)
    else:
        print(ret + 1)

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

Verdicts: Wrong Answer

Accepted
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())
ride = [0] * 6
for i in range(5):
	ride[i] = int(input())

city = [0] * 6
city[0] = N

minuites = 0

while city[5] != N:
	for i in range(5)[::-1]:
		print(city[i + 1],city[i],ride[i])
		city[i + 1] = min(city[i],ride[i]) + city[i + 1]
		city[i] = city[i] - min(city[i],ride[i])
	minuites += 1

	
print(minuites)

import math

N = int(input())
ride = [0] * 5
for i in range(5):
	ride[i] = int(input())
 
narrow = min(ride)

minuites = math.ceil(N / narrow) + 4
  
print(minuites)

Verdicts: Wrong Answer

Accepted
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,*A=map(int,input().split())
print(max((N//min(A)+4),5))

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
a,b,k=map(int,input().split())
ans=[]

if i in range(1,min(a,b)+1):
  if a % i == 0 and b % i == 0:
    ans.append(i)

print(ans[-k])

a,b,k=map(int,input().split())
ans=[]

for i in range(1,min(a,b)+1):
  if a % i == 0 and b % i == 0:
    ans.append(i)

print(ans[-k])

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
A,B,K=map(int,input().split())
for i in range(1,1000000000):
  if A%i ==0 and B%i ==0:
    K-=1
  if K<=1:
    print(i)
    exit()


a,b,k=map(int,input().split())
list=[]
for i in range(1,101):
    if a%i==0 and b%i==0:
        list.append(i)
print(list[-k])

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
a,b,k = map(int,input().split())
1 1 1

number = 0
for i in range(min(a,b),0,-1):
    if a % i == 0 and b % i == 0:
        number += 1
        if number == k:
            print(i)
            break


a,b,k = map(int,input().split())
1 1 1

number = 0
for i in range(min(a,b),0,-1):
    if a % i == 0 and b % i == 0:
        number += 1
        if number == k:
            print(i)
            break


a,b,k = map(int,input().split())

number = 0
for i in range(min(a,b),0,-1):
    if a % i == 0 and b % i == 0:
        number += 1
        if number == k:
            print(i)
            break


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
a,b,k = map(int,input().split())

#a,b,k=8,12,2

c = 0
ans = 0
for i in range(1,max(a,b)+1):
  if(a%i == 0 and b%i == 0):
    c += 1
    print(i)
    if(c == k):
      ans = i
      break

print(ans)

a,b,k = map(int,input().split())

#a,b,k=8,12,2

c = 0
ans = 0
for i in range(min(a,b),1,-1):
  if(a%i == 0 and b%i == 0):
    c += 1
    print(i)
    if(c == k):
      ans = i
      break

print(ans)

a,b,k = map( int,input().split() )

i = min(a,b)
ans = 0
while 1:
  if not(a % i)  and not(b % i):
    ans += 1
  if ans == k:
    break
  i -= 1

print(i)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
a,b,k = map(int,input().split())
d = []
for i in range(100) :
  if a % i == 0 and b % i == 0 :
    d.append(i)
d.sort(reverse = True)
print(d[k-1])

a,b,k = map(int,input().split())
d = []
for i in range(1 ,101) :
  if a % i == 0 and b % i == 0 :
    d.append(i)
d.sort(reverse = True)
print(d[k-1])


Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
# -*- coding: utf-8 -*-

a, b, c = map(int, input().split())

max = 101
#if a < b:
#    max = a

list = []

for ta in range(max):
    if ta == 0:
        continue
    elif a % ta == 0 and b % ta == 0:
        list.append(ta)

print(list)

# -*- coding: utf-8 -*-

a, b, c = map(int, input().split())

max = max(a, b) + 1
if max > 101:
    max = 101

list = []

for ta in range(max):
    if ta == 0:
        continue
    elif a % ta == 0 and b % ta == 0:
        list.append(ta)

print(list[-c])

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
a, b, c = map(int, input().split())
divisores = [1]
    
for i in range(2, min(a,b) + 1):
    if a % i == 0 and b % i == 0:
        divisores.append(i)
print(divisores[-4])

xyz=input().split()
a=int(xyz[0])
b=int(xyz[1])
c=int(xyz[2])

for i in range(min(a,b),1):
  if a%i==0 and b%i==0:
    c-=1
  if c==0:
    print(i)
    break
  

a, b, k = map(int, input().split())
flag, divisor, common_divisors = 0, 1, list()
while flag != -1:
    if a % divisor == 0 and b % divisor == 0:
        common_divisors.append(divisor)
    if divisor >= min(a, b):
        flag = -1
    divisor += 1
print(sorted(common_divisors, reverse=True)[k-1])

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    divisors.sort()
    return divisors


a, b, c = map(int, input().split())

c_set = list(set(make_divisors(a))&set(make_divisors(b)))

c_set.sort()


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    divisors.sort()
    return divisors
 
 
a, b, c = map(int, input().split())
 
c_set = list(set(make_divisors(a))&set(make_divisors(b)))
 
c_set.sort()
print(c_set[-c])

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
A, B, K = (int(i) for i in input().split())
list = []

for i in range(1, 100):
  if i % A == 0 and i % B == 0:
    list.append(i)
print(list[K-1])


A, B, K = (int(i) for i in input().split())
list = []
for i in range(1, 101):
  if A % == 0 and B % i == 0:
    list.append(i)
print(list[len(list)-K])


A, B, K = (int(i) for i in input().split())
list = []


for i in range(101):
  if i != 0:
    if i % A == 0 and i % B == 0:
      list.append(i)
print(list[len(list)-K])


A, B, K = (int(i) for i in input().split())
list = []


for i in range(1, 100):
  if i % A == 0 and i % B == 0:
    list.append(i)
a = len(list)-K
print(list[a])


A, B, K = (int(i) for i in input().split())
list = []
for i in range(101):
  if i != 0:
    if i % A == 0 and i % B == 0:
      list.append(i)
print(list[len(list)-K])


A, B, K = (int(i) for i in input().split())
list = []


for i in range(1, 100):
  if i % A == 0 and i % B == 0:
    list.append(i)
print(list[len(list)-K])


try:
  A, B, K = (int(i) for i in input().split())
  list = []
  for i in range(1, 100):
    if A % == 0 and B % i == 0:
      list.append(i)
  print(list[len(list)-K])
  
except ZeroDivisionError:
    print("ZeroDivisionError!!")
    

A, B, K = (int(i) for i in input().split())
list = []
 
for i in range(101):
  if i != 0:
    if A % i == 0 and B % i == 0:
      list.append(i)
print(list[len(list)-K])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,k = iim()
ans = []
for i in range(min(a,b)):
    if a%i == 0 and b%i == 0:
        ans.append(i)

print(ans[k-1])

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,k = iim()
ans = []
for i in range(1,min(a,b)+1):
    if a%i == 0 and b%i == 0:
        ans.append(i)

print(ans[-k])

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
import math

A, B, K = map(int, input().split())

minAB = min(A, B)
kcount = 1

if minAB == 1:
	print(1)
else:
	for i in range (0, minAB):
		if A%(minAB-i) == 0 and A%(minAB-i) == 0 and kcount <K:
			kcount+=1
		elif A%(minAB-i) == 0 and A%(minAB-i) == 0:
			print(minAB-i)
			exit()
		else:
			continue

import math

A, B, K = map(int, input().split())

minAB = min(A, B)
kcount = 1

if minAB == 1:
	print(1)
else:
	for i in range (0, minAB):
		if A%(minAB-i) == 0 and B%(minAB-i) == 0 and kcount <K:
			kcount+=1
		elif A%(minAB-i) == 0 and B%(minAB-i) == 0:
			print(minAB-i)
			exit()
		else:
			continue

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
a,b,k=map(int,input().split())
l=[]
if k==1 or a==1 or b==1:
	print("1")
	break
else:
	for i in range(1,min(a,b)):
		if a%i==0 and b%i==0:
			l.append(i)
	
	print(l[k-1])

a,b,k=map(int,input().split())
l=[]
if k==1:
	print("1")
	break
for i in range(1,min(a,b)):
	if a%i==0 and b%i==0:
		l.append(i)

print(l[k-1])

a,b,k=map(int,input().split())
l=[]

for i in range(1,(min(a,b))+1):
	if a%i==0 and b%i==0:
		l.append(i)
l.sort(reverse=True)
if a==1 or b==1:
    l=[1,1]
print(l[k-1])


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):

A, B, K = map(int, input().split())
n = 0
for i in range(1,100):
    if A % i == 0 and B % i == 0:
        n += 1
        print(i)
    else:
        pass
    
    if n == K:
        ans = i
        break

print(ans)


A, B, K = map(int, input().split())
n = 0
N = min(A, B)
for i in range(100):
    m = N-i
    if A % m == 0 and B % m == 0:
        n += 1
    else:
        pass
    
    if n == K:
        ans = m
        break

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):

def func_divisors(x):
  divisors = []
  for i in range(1,int(x**0.5)+1):
    if x % i == 0:
      divisors.append(i)
      if i != x / i:
        divisors.append(int(x/i))
        
  divisors.sort()
  return divisors
  
A_divisors = func_divisors(A)
B_divisors = func_divisors(B)
C_divisors = list(set(A_divisors) & set(B_divisors))

print(C_divisors[K-1])
  

A,B,K = map(int,input().split(' '))

def func_divisors(x):
  divisors = []
  for i in range(1,int(x**0.5)+1):
    if x % i == 0:
      divisors.append(i)
      if i != x / i:
        divisors.append(int(x/i))
        
  divisors.sort()
  return divisors
  
A_divisors = func_divisors(A)
B_divisors = func_divisors(B)
C_divisors = sorted(list(set(A_divisors) & set(B_divisors)),reverse=True)

print(C_divisors[K-1])
  

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):
A,B,K=map(int,input().split())
list=[]
for i in range(1,min(A,B)):
  if A%i==0 and B%i==0 :
    list.append(i)
print(list[len(list)-K+1])

A,B,K=map(int,input().split())
list=[]
for i in range(1,min(A,B)+1):
  if A%i==0 and B%i==0 :
    list.append(i)
print(list[len(list)-K+1])

A,B,K=map(int,input().split())
list=[]
for i in range(1,min(A,B)+1):
  if A%i==0 and B%i==0 :
    list.append(i)
print(list[len(list)-K])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  Find the K-th largest positive integer that divides both A and B.  The input guarantees that there exists such a number.

Submission attempts (in order):

A,B,K  = map(int, input().split(" "))
count = 0
i = 1
while(1) :
    if A%i == 0 and B%i == 0:
        print(i)
        count += 1
        if count == K :
            print(i)
            break
    i+=1
    
    


A,B,K  = map(int, input().split(" "))
count = 0
i = 1
tempList = []
for i in range(1,200) :
    if A%i == 0 and B%i == 0:
        tempList.append(i)
print(tempList[-K])
    

Verdicts: Wrong Answer

Accepted