TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,blue,red = map(int,input().split())

mod = n % (blue+red)
if mod <= blue:
    print(mod)
    print(blue*(n//(blue+red))+mod)
else:
    print(mod)
    print(blue*(n//(blue+red))+blue)


n,blue,red = map(int,input().split())

mod = n % (blue+red)
if mod <= blue:
    print(mod)
    print(blue*(n//(blue+red))+mod)
else:
    print(mod)
    print(blue*(n//(blue+red))+blue)


n,blue,red = map(int,input().split())

mod = n % (blue+red)
if mod <= blue:
    print(mod)
    print((blue*n)//(blue+red)+mod)
else:
    print(mod)
    print((blue*n)//(blue+red)+blue)


n,blue,red = map(int,input().split())

mod = n % (blue+red)
if mod <= blue:
    print(blue*(n//(blue+red))+mod)
else:
    print(blue*(n//(blue+red))+blue)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int, input().split())
S = ''
print('N:{}'.format(N), 'A:{}'.format(A), 'B:{}'.format(B))

for i in range((N//(A+B))+1):
    S += 'b'*A
    S += 'r'*B
print(S[:N].count('b'))

N, A, B = list(map(int, input().split()))
print('N:{}'.format(N), 'A:{}'.format(A), 'B:{}'.format(B))

print(A*(N//(A+B)) + min(A, N%(A+B)))

N, A, B = list(map(int, input().split()))


print(A*(N//(A+B)) + min(A, N%(A+B)))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int, input().split())
ans = N//(A+B) * A
rem = N%(A+B)
ans =+ min(rem, A)
print(ans)

N, A, B = map(int, input().split())
ans = N //(A+B) * A
rem = N % (A+B)
ans += min(rem, A)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int,input().split())
ans = N//(A+B)
R = N%(A+B)
ans += min(R, A)
print(ans)

N, A, B = map(int,input().split())
ans = (N//(A+B)) * A
R = N%(A+B)
ans += min(R, A)
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
i = list(map(int, input().split()))

N = int(i[0])
A = int(i[1])
B = int(i[2])

count_blue = 0
count_all = 0

while count_all < N:
    count_blue += A
    count_all += A
    if count_all > N:
        count_blue -= (count_all - N)
    count_all += B

i = list(map(int, input().split()))

N = int(i[0])
A = int(i[1])
B = int(i[2])

count_blue = 0

syou = N // (A + B)
amari = N % (A + B)

if amari > A:
    count_blue = A * syou + A
else:
    count_blue = A * syou + amari

print(count_blue)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, b, r = map(int, input().split())
# inputText1 = "8 3 4"
inputText1List = inputText1.split()
# n = int(inputText1List[0])
# b = int(inputText1List[1])
# r = int(inputText1List[2])
if b == 0:
    print(b)
else:
    
    baseTextCount = b + r # 7
    i = n // baseTextCount
    mod = n % baseTextCount
    
    if mod < b:
        print(i * b + mod)
    else:
        print(i * b + b)


n, b, r = map(int, input().split())
baseTextCount = b + r 
i = n // baseTextCount
mod = n % baseTextCount
if mod < b:
    print(i * b + mod)
else:
    print(i * b + b)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b= [int(x) for x in input().split()]

ans = n // (a+b)
mod = n % (a+b)
if mod >= a:
  ans += a
else:
  ans += mod
 
print(ans)
  

n,a,b= [int(x) for x in input().split()]

ans = n // (a+b) * a
mod_num = n % (a+b)

if mod_num >= a:
  ans += a
else:
  ans += mod_num
  
print(ans)
 
  

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):

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

S = N / (A+B)
ans = S*A

amari = N % (A+B)
if(amari <= B):
  print(int(ans))
else:
  ans = ans + (amari - B)
  print(int(ans))


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

S = N / (A+B)
ans = S*B

amari = N % (A+B)
if(amari <= A):
  print(ans)
else:
  ans = ans + (amari - A)
  print(ans)


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

S = int(N / (A+B))
ans = S*A

amari = N % (A+B)
if(amari <= A):
  ans = ans + amari
  print(int(ans))
else:
  ans = ans + A
  print(int(ans))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B = map(int,input().split())
#n blue red
#8 3 4
#bbbrrrrb
#4
ans = 0
x = N // (A+B)
ans += (x * A)
N -= x * (A+B)
if N <= A:
  ans += N
else:
  ans += A


N,A,B = map(int,input().split())
#n blue red
#8 3 4
#bbbrrrrb
#4
ans = 0
x = N // (A+B)
ans += (x * A)
N -= x * (A+B)
if N <= A:
  ans += N
else:
  ans += A
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = list(map(int, input().split()))

blue=True
s=''
length = N
while length>0:
    if blue:
        for i in range(A):
            if len(s)<N:
                s+='b'
        length = length - A
        blue = False
    else:
        for i in range(B):
            if len(s)<N:
                s+='r'
        length = length - B
        blue = True
print(s)

N, A, B = list(map(int, input().split()))

SUM=0
a = N % (A + B)
if a > A:
    SUM = A
else:
    SUM = a 

SUM = SUM + (N // (A + B)) * A

print(SUM)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b = (int(x) for x in input().split())

t = a+b
q = n%t
p = (n-q)//t

print(min(p+q,p+a))


n,a,b = (int(x) for x in input().split())

t = a+b
q = n%t
p = (n-q)//t
print(min(a*p+q,a*p+a))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
b=map(int,input().split())
print((n//(a+b))*a+min([n%(a+b),a]))

n,a,b=map(int,input().split())
print(((n//(a+b))*a)+min([n%(a+b),a]))

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B=list(map(lambda i:int(i),input().split()))

answer =0

if A==0:
    answer = 0
elif b==0:
    answer = N
else:
    tail=0
    if N%(A+B) > B:
        tail = B
    else:
        tail = N%(A+B)
    answer = A * (N//(A+B)) + tail

print(answer)


N,A,B=list(map(lambda i:int(i),input().split()))

answer =0

if A==0:
    answer = 0
if b==0:
    answer = N
else:
    tail=0
    if N%(A+B) > B:
        tail = B
    else:
        tail = N%(A+B)
    answer = A * (N//(A+B)) + tail

print(answer)


N,A,B=list(map(lambda i:int(i),input().split()))

answer =0

if A==0:
    answer = 0
elif B==0:
    answer = N
else:
    tail=0
    if N%(A+B) > A:
        tail = A
    else:
        tail = N%(A+B)
    answer = A * (N//(A+B)) + tail

print(answer)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
import math


def main():
    N, A, B = map(int, input().split())
    k = N // (A + B)
    g = N % (A + B)

    ans = (k * A) + A

    if A == 0:
        print(0)
    elif B == 0:
        print(N)
    elif N <= A:
        print(N)
    elif (N > A) and (N <= (A + B)):
        print(A)
    else:
        print(int(ans))

    return 0


if __name__ == '__main__':
    main()

N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int, input().split())
ans = 0

AplusB = A+B

try:
    action_num = N // AplusB
except:
    action_num = 0
ans += action_num * A

try:
    action_mod = N % AplusB
except:
    action_mod = 0

# one_action = "B"*A + "R"*B
for i in range(action_mod):
    if one_action[i] == "B":
        ans += 1

print(ans)


N, A, B = map(int, input().split())
ans = 0

AplusB = A+B

try:
    action_num = N // AplusB
except:
    action_num = 0
ans += action_num * A

try:
    action_mod = N % AplusB
except:
    action_mod = 0

    one_action = "B"*A + "R"*B
try:
    for i in range(action_mod):
        if one_action[i] == "B":
            ans += 1
except:
    pass

print(ans)


N, A, B = map(int, input().split())
ans = 0

AplusB = A+B

try:
    action_num = N // AplusB
except:
    action_num = 0
ans += action_num * A

try:
    action_mod = N % AplusB
except:
    action_mod = 0

one_action = "B"*A + "R"*B

#     if one_action[i] == "B":
#         ans += 1

print(ans)


N, A, B = map(int, input().split())
ans = 0

AplusB = A+B

action_num = N // AplusB
ans += action_num * A

action_mod = N % AplusB

if action_mod <= A:
    ans += action_mod
else:
    ans += A

print(ans)


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

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

print(n//(a+b)*a+mi,min(a,n%(a+b))
    


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

print(n//(a+b)*a+min(a,n%(a+b)))
    



Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int, input().split())
X = N // (A + B)
R = X * A
X += min(A, N % (A + B))
print(X)

N, A, B = map(int, input().split())
X = N // (A + B)
R = X * A
R += min(A, N % (A + B))
print(R)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
from sys import stdin
n,a,b = map(int,stdin.readline().rstrip().split())
if a <= n:
    print(a)
else:
    print(n)

from sys import stdin
n,a,b = map(int,stdin.readline().rstrip().split())
c = n//(a+b)
d = n%(a+b)
if d > a:
    print(a*(c+1))
else:
    print(a*c+d)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b = map(int,input().split())
c = a + b
ans = n//c*b + min(n%c,b)

print(ans)


n,a,b = map(int,input())
c = a + b
ans = n/(a+b) + min(n%c,b)

print(ans)

n,a,b = map(int,input().split())
c = a + b
ans = n/(a+b)*b + min(n%c,b)

print(ans)


n,a,b = map(int,input().split())
c = a + b
ans = n/(a+b) + min(n%c,b)

print(ans)


n,a,b = map(int,input().split())
c = a + b
ans = n//c*a + min(n%c,a)

print(ans)


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
#N = str(input())
N,A,B = map(int,input().split())
#X=list(map(int,input().split()))

if A==0:
    print(0)
else:
    b=N//(A+B)
    x=N%(A+B)

if x>A:
    x=A

    print(b*A+x)


#N = str(input())
N,A,B = map(int,input().split())
#X=list(map(int,input().split()))

if A==0:
    print(0)
    exit()
else:
    b=N//(A+B)
    x=N%(A+B)

    if x>A:
        print(b*A+A)
    else:
        print(b*A+x)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):

def main() :
    N,A,B = map(int,input().split())

    span_len = A+B
    
    span_count = N // span_len

    span_remain = N % span_len
    if (span_remain == 0) :
        ans = span_count * A
        print(ans)
    elif (span_remain < A) :
        ans = span_count * A + (A - span_remain)
        print(ans)
    else :
        ans = span_count * A + A
        print(ans)


main()


def main() :
    N,A,B = map(int,input().split())

    span_len = A+B
    
    span_count = N // span_len

    span_remain = N % span_len
    print(span_count, span_remain)
    if (span_remain == 0) :
        ans = span_count * A
        print(ans)
    elif (span_remain < A) :
        ans = span_count * A + span_remain
        print(ans)
    else :
        ans = span_count * A + A
        print(ans)


main()


def main() :
    N,A,B = map(int,input().split())

    span_len = A+B
    
    span_count = N // span_len

    span_remain = N % span_len
    # print(span_count, span_remain)
    if (span_remain == 0) :
        ans = span_count * A
        print(ans)
    elif (span_remain < A) :
        ans = span_count * A + span_remain
        print(ans)
    else :
        ans = span_count * A + A
        print(ans)


main()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B=list(map(int,input().split()))
print(A*(N//(A+B))+max(A,N%(A+B)))

N,A,B=list(map(int,input().split()))
print(A*(N//(A+B))+min(A,N%(A+B)))

Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

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

a, b = map(int, input().split())
# print(a,b)
# x=-1
# y=-1

# xr=[]
# yr=[]

#     if i*0.08//1==a:
#         # print("x:{}".format(i))
#         x=i
#         xr.append(x)


#         # print("y:{}".format(i))
#         y=i
#         yr.append(y)
# flag=False
#
# result=[]

#     for j in yr:

#             result.append(i)
#
# if len(result)>0:
#     print(result[0])
# else:
#     print('-1')
flag =False
for i in range(1,1010):
    if 1009*0.08//1==a and 1009*0.1//1==b:
        print(i)
        flag=True
        break

if not flag:
    print(-1)


# coding: utf-8

a, b = map(int, input().split())
# print(a,b)
# x=-1
# y=-1

# xr=[]
# yr=[]

#     if i*0.08//1==a:
#         # print("x:{}".format(i))
#         x=i
#         xr.append(x)


#         # print("y:{}".format(i))
#         y=i
#         yr.append(y)
# flag=False
#
# result=[]

#     for j in yr:

#             result.append(i)
#
# if len(result)>0:
#     print(result[0])
# else:
#     print('-1')
flag =False
for i in range(1,1010):
    if i*0.08//1==a and i*0.1//1==b:
        print(i)
        flag=True
        break

if not flag:
    print(-1)


Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
import math
A,B=map(int,input().split())
eight=[]
i=0
ten=[]
for a in range(1,1001):
    if math.floor(a*0.08)==A:
        eight.append(a)
    if math.floor(a*0.1)==B:
        ten.append(a)

for a in eight:
    if a in ten:
        print(a)
        i=1
        break
if i=0:
    print("-1")


import math
A,B=map(int,input().split())
eight=[]
i=0
ten=[]
for a in range(1,1001):
    if math.floor(a*0.08)==A:
        eight.append(a)
    if math.floor(a*0.1)==B:
        ten.append(a)

for a in eight:
    if a in ten:
        print(a)
        i=1
        break
if i==0:
    print("-1")


Verdicts: Runtime Error

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
a , b = map(int, input().split())
for i in range(1 , 10100) :
  a1 = int(i*0.08)
  b1 = int(i*0.10)
  if a1 = a and b1 = b :
    print(i)
  else :
    print(-1)

a , b = map(int, input().split())
a1 = a/0.08
b1 = b/0.1
if a1 == b1 :
  print(a1)
else :
  print(-1)

a , b = map(int, input().split())
for i in range(1 , 10100) :
  a1 = int(i*0.08)
  b1 = int(i*0.10)
  if a1 == a and b1 == b :
    print(i)
  else :
    print(-1)

a,b = map(int, input().split())
ans = -1
for i in range(1001) :
  a1 = int(i*0.08)
  b1 = int(i*0.1)
  if a1 == a and b1 == b :
    ans = i
    break
print(ans)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
inputted = list(map(int, input().split()))
tax_price_a = inputted[0]
tax_price_b = inputted[1]

price_8 = int(tax_price_a / 0.08)
price_10 = int(tax_price_b / 0.10)

if price_8 == price_10:
    print(price_8)
elif tax_price_b == int(price_8 * 0.1):
    print(price_8)
elif tax_price_a == int(price_10 * 0.u):
    print(price_10)
else:
    print(-1)


inputted = list(map(int, input().split()))
tax_price_a = inputted[0]
tax_price_b = inputted[1]

price_8 = int(tax_price_a / 0.08)
price_10 = int(tax_price_b / 0.10)
print(price_8, price_10)

if tax_price_b == int(price_8 * 0.1):
    print(price_8)
else:
    print('-1')


import math

inputted = list(map(int, input().split()))
tax_price_a = inputted[0]
tax_price_b = inputted[1]

price_8 = math.ceil(tax_price_a / 0.08)
price_10 = math.ceil(tax_price_b / 0.10)

if tax_price_b == int(price_8 * 0.1):
    print(price_8)
elif tax_price_a == int(price_10 * 0.08):
    print(price_10)
else:
    print('-1')


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
import math
a,b=map(int,input().split())
a1=math.ceil(a/0.08)
a2=math.floor((a+1)/0.08)
A=set([i for i in range(a1,a2)])
b1=math.ceil(b/0.1)
b2=math.floor((b+1)/0.1)
B=set([i for  i in range(b1,b2)])
print(A)
print(B)
if A&B==set(): 
    print(-1)
    exit()

print(min(A & B))

import math
a,b=map(int,input().split())
a1=math.ceil(a/0.08)
a2=math.floor((a+1)/0.08)
A=set([i for i in range(a1,a2)])
b1=math.ceil(b/0.1)
b2=math.floor((b+1)/0.1)
B=set([i for  i in range(b1,b2)])

if A&B==set(): 
    print(-1)
    exit()

print(min(A & B))

Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
A, B = map(int, input().split())
for i in range(20000):
    if i * 0.08 // 1 == A and i * 0.1 // 1 == B:
        print(i)
        break
print(-1)


A, B = map(int, input().split())
for i in range(20000):
    if i * 0.08 // 1 == A and i * 0.1 // 1 == B:
        print(i)
        exit()
print(-1)


Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
a,b=map(int,input().split())
i=1
while True:
  if (int(i*0.08)==a and i(i*0.1)==b):
    print(i)
    exit()
  if i>200:
    print(-1)
    exit()
  i=i+1

a,b=map(int,input().split())
i=1
while True:
  if (i*0.08)//1==a and (i*0.1)==b:
    print(i)
    exit()
  if i>=100:
    print(-1)
    exit()
  i=i+1

a,b=map(int,input().split())
for i in range(2000):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    exit()
print(-1)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
b,a = map(int,input().split())
ans = a*10
for i in range(11):
    if i == 10:
        ans = -1
        break
    if int(ans*0.08) == b:
        break
    ans += 1
    print(ans)
print(ans)

b,a = map(int,input().split())
ans = a*10
for i in range(11):
    if i == 10:
        ans = -1
        break
    if int(ans*0.08) == b:
        break
    ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
A, B = list(map(int, (input().split())))

price_a = int(A*100/8)
price_b = int(B*100/10)

if(int(price_a * 1.10) - B == price_a) :
  print(int(price_a*1.08))
  print(price_a)
  exit()
if(int(price_b * 1.08) - A == price_b) :
  print(price_b)
  exit()
  
print(-1)

import math

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

price_a = math.ceil(A*100/8)
price_b = int(B*100/10)

if(int(price_a * 1.10) - B == price_a) :
  print(price_a)
  exit()
if(int(price_b * 1.08) - A == price_b) :
  print(price_b)
  exit()
  
print(-1)

Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
A,B=map(int,input().split())
min_a=12.5*A;max_a=(100*a+1)/8
min_b=10*b;max_b=min_b+1
if(max_b<min_a or max_a<min_b):
  print(-1)
else:
  print(int(round(max(12.5*A,10*B)+0.4999999,0)))

A,B=map(int,input().split())
min_a=12.5*A;max_a=(100a+1)/8
min_b=10*b;max_b=min_b+1
if(max_b<min_a or max_a<min_b):
  print(-1)
else:
  print(int(round(max(12.5*A,10*B)+0.4999999,0)))

A,B=map(int,input().split())
min_a=12.5*A;max_a=(100a+1)/8
min_b=10*B;max_b=min_b+1
if(max_b<min_a or max_a<min_b):
  print(-1)
else:
  print(int(round(max(12.5*A,10*B)+0.4999999,0)))

A,B=map(int,input().split())
print(round(max(12.5*A,10*B)+0.5,1))

A,B=map(int,input().split())
min_a=12.5*A
max_a=(100*A+1)/8
min_b=10*B
max_b=min_B+1
if(max_b<min_a or max_a<min_b):
  print(-1)
else:
  print(int(round(max(12.5*A,10*B)+0.4999999,0)))

A, B =map(int, input().split())
max_A=(A+1)*25/2
max_B=10*(B+1)
p=int(round(max([A*12.5,B*10])+0.4999999999,0))
print(p if(p<min([(A+1)*25/2, 10*(B+1)]) and not(4<5*A-4*B) and not(5*A-4*B<-5)) else -1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
import numpy as np
import math
A, B = map(int, input().split())

x_a = np.arange(math.ceil(12.5 * A), math.ceil(12.5 * (A + 1)))
x_b = np.arange(10 * B, 10 * (B + 1))

a_set = set(x_a)
b_set = set(x_b)

c_set = a_set & b_set
c = list(c_set)
x = min(c)
print(x)

if not c:
    print("-1")

else:
    continue

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

x_a = 12.5 * A
x_b = 10 * B

integer_xa = int(x_a / 10)
integer_xb = int(x_b / 10)

if integer_xa == integer_xb:
    print(max(x_a, x_b))

else:
    print("-1")

import numpy as np
import math
A, B = map(int, input().split())

x_a = np.arange(math.ceil(12.5 * A), math.ceil(12.5 * (A + 1)))
x_b = np.arange(10 * B, 10 * (B + 1))

a_set = set(x_a)
b_set = set(x_b)

c_set = a_set & b_set
c = list(c_set)

if len(c) != 0:
    print(min(c))

else:
    print("-1")


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

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

for i in range(1,101):
    va = int(i * 1.08)
    vb = int(i * 1.1)
    if(va == a and vb == b):
        print(i)
        exit()
print(-1)

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

for i in range(1,20001):
    va = int(i * 0.08)
    vb = int(i * 0.1)
    if(va == a and vb == b):
        print(i)
        exit()
print(-1)


Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
def main():
    A,B = map(int,input().split())
    for i in range(10001):
        e = i * 0.08
        t = i * 0.1
        if e == A and t == B:
            return i
    return -1
print(main())

def main():
    A,B = map(int,input().split())
    for i in range(10001):
        e = int(i * 0.08)
        t = int(i * 0.1)
        if e == A and t == B:
            return i
    return -1
print(main())

Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
import math

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


ARangemin = math.ceil(A * (100/8))
BRangemin = math.ceil(B * (100/10))

ARangemax = ARangemin
BRangemax = BRangemin
while int(ARangemax * 0.08) == A:
    ARangemax = ARangemax + 1
while int(BRangemax* 0.08) == B:
    BRangemax = BRangemax + 1
ARangemax = ARangemax -1
BRangemax = BRangemax -1

if ARangemax > BRangemin or ARangemin > BRangemax:
    if ARangemin < BRangemin:
        print(ARangemin)
    else:
        print(BRangemin)
else:
    print(-1)



import math

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


ARangemin = math.ceil(A * (100/8))
BRangemin = math.ceil(B * (100/10))

ARangemax = ARangemin
BRangemax = BRangemin
while int(ARangemax * 0.08) == A:
    ARangemax = ARangemax + 1
while int(BRangemax* 0.10) == B:
    BRangemax = BRangemax + 1
ARangemax = ARangemax -1
BRangemax = BRangemax -1

if ARangemax >= BRangemin or ARangemin >= BRangemax:
    if ARangemin >= BRangemax:
        print(-1)
    else:
        if ARangemin > BRangemin:
            print(ARangemin)
        else:
            print(BRangemin)
else:
    print(-1)



Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
A,B = map(int, input().split())

C = -(-A//0.08)
D = -(-B//0.1)


if (D * 1.0 < C * 1.1 < D * 1.1 < C * 1.2):
    print(int(C))
else:
    print(-1)


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

a=-(-A//0.08)
b=-(-B//0.1)
c=-(-(A-1)//0.08)
d=-(-(A+1)//0.08)

if a==b or c < b < d:
    print(a)
else:
    print(-1)


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

C = -(-A//0.08)
D = -(-B//0.1)


if (D * 1.0 < C * 1.1 <= D * 1.1 < C * 1.2):
    print(int(C))
else:
    print(-1)


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

N=[i for i in range(int(-(-A//0.08)),int(-(-(A+1)//0.08)))]
M=[i for i in range(int(-(-B//0.1)),int(-(-(B+1)//0.1)))]

if N[0] in M:
    print(int(-(-A//0.08)))
elif M[0] in N:
    print(int(-(-B//0.1)))
else:
    print(-1)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
import math
A, B = map(int, input().split())

ans = 1
for b in range(10*B, 10*B+10):
    if int(b*0.08) == A:
        print(b)
        ans = 0

if ans:
    print(-1)

import math
A, B = map(int, input().split())

#int(ans*0.08) = A
#int(ans*0.10) = B

ans = 1
for b in range(10*B, 10*B+10):
    if int(b*0.08) == A:
        print(b)
        ans = 0
        break

if ans:
    print(-1)

Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
N, A, B = map(int, input().split())

tmp = N%(A+B)
if 0 <= tmp <= A:
    print(A*(N//(A+B))+tmp)
else:
        print(A*(N//(A+B)))

from math import floor, ceil

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

minx1 = A/0.08
maxx1 = (A+1)//0.08
minx2 = B/0.1
maxx2 = (B+1)//0.1

rangeMin = max(minx1, minx2)
rangeMax = min(maxx1, maxx2)
if rangeMax < rangeMin:
    print(-1)
else:
    print(floor(rangeMin+1))

from math import floor, ceil

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

minx1 = A/0.08
maxx1 = (A+1)/0.08
minx2 = B/0.1
maxx2 = (B+1)/0.1

rangeMin = max(minx1, minx2)
rangeMax = min(maxx1, maxx2)
if rangeMax < rangeMin:
    print(-1)
else:
    print(floor(rangeMin+1))

from math import floor, ceil

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

min1 = A/0.08
max1 = (A+0.9999999)/0.08
min2 = B/0.1
max2 = (B+0.9999999)/0.1

rangeMin = ceil(max(min1, min2))
rangeMax = floor(min(max1, max2))
if rangeMin > rangeMax:
    print(-1)
else:
    print(rangeMin)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
# coding: utf-8
A,B = list(map(int, input().split()))

def lr(A, tax):
    if (100 * A) % tax == 0:
        x1_l = 100 * A // tax
    else:
        x1_l = 100 * A // tax + 1
    if (100 * A + 100) % tax == 0:
        x1_r = (100 * A + 100) // tax - 1
    else:
        x1_r = (100 * A + 100) // tax
    print(x1_l, x1_r)
    return list(range(x1_l, x1_r+1))

list8=lr(A,8)
list10=lr(B,10)
ret = []
for val in list8:
    if val in list10:
        ret.append(val)
if len(ret)==0:
    print(-1)
else:
    print(min(ret))



# coding: utf-8
A,B = list(map(int, input().split()))

def lr(A, tax):
    if (100 * A) % tax == 0:
        x1_l = 100 * A // tax
    else:
        x1_l = 100 * A // tax + 1
    if (100 * A + 100) % tax == 0:
        x1_r = (100 * A + 100) // tax - 1
    else:
        x1_r = (100 * A + 100) // tax
    return list(range(x1_l, x1_r+1))

list8=lr(A,8)
list10=lr(B,10)
ret = []
for val in list8:
    if val in list10:
        ret.append(val)
if len(ret)==0:
    print(-1)
else:
    print(min(ret))



Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
A, B = map(int, input().split())
for x in range(1000):
  if int(x * 1.08) == A and int(x * 1.1) == B:
    print(x)
    break
else:
  print(-1)

A, B = map(int, input().split())
for x in range(1000000):
  if int(x * 0.08) == A and int(x * 0.1) == B:
    print(x)
    break
else:
  print(-1)

Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
import math

A,B=map(int, input().split())
Amin=int(math.ceil(A/0.08))
if A%2==0:
    Amax=int(math.floor((A+1)/0.08))
else:
    Amax=int(math.floor((A+1)/0.08)-1)
Bmin=int(math.ceil(B/0.1))
Bmax=int(math.floor((B+1)/0.1)-1)
if Amax<Bmin or Bmax<Amin:
    ans=-1
else:
    ans=max(Amin,Bmin)

print(Amin)
print(Amax)
print(Bmin)
print(Bmax)
print(ans)

import math

A,B=map(int, input().split())
Amin=int(math.ceil(A/0.08))
if A%2==0:
    Amax=int(math.floor((A+1)/0.08))
else:
    Amax=int(math.floor((A+1)/0.08)-1)
Bmin=int(math.ceil(B/0.1))
Bmax=int(math.floor((B+1)/0.1)-1)
if Amax<Bmin or Bmax<Amin:
    ans=-1
else:
    ans=max(Amin,Bmin)
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
import math
a,b=map(int,input().split())
ax=set(range(math.ceil(25*a/2),math.floor(25*(a+0.99999)/2)+1))
bx=set(range(math.ceil(10*b),math.floor(10*(b+0.99999)))+1)
x=list(ax&bx)
if x:
  print(x[0])
else:
  print(-1)

import math
a,b=map(int,input().split())
for i in range(2000):
  if math.floor((i+1)*0.08)==a and math.floor((i+1)*0.1)==b:
    print(i+1)
    exit()
print(-1)

Verdicts: Runtime Error

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

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

tmp = int((a*12.5) // 1)
cnt = tmp

while (cnt*0.08)//1 == a:
  cnt += 1

print(tmp, cnt)
for i in range(tmp, cnt):
  ans = int((i * 0.1)//1)

  if ans == b:
    print(i)
    exit()
print(-1)

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

tmp = int((a*12.5) // 1)
cnt = tmp
'''
while (cnt*0.08)//1 == a:
  cnt += 1
  
if cnt == tmp:
  if (cnt * 0.1)//1 == b:
    print(cnt)
    exit()
'''
for i in range(tmp, 10001):
  ans = (i * 0.08)//1
  bans = (i*0.1)//1
  #print(i ,ans)
  if (bans==b) and ans==a:
    print(i)
    exit()
  elif ans > a:
    break
print(-1)

Verdicts: Wrong Answer

Accepted
Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

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

x_b = b * 10

x = int(x_b)

if int(x * 0.08) == a:
    print(x)
else:
    print(x + 1)


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

x_b = b * 10

min_a = (25/2) * a
max_a = (25/2) * (a + 1)

min_b = 10 * b
max_b = 10 * (b + 1)

min_ = max(min_a, min_b)
max_ = min(max_a, max_b)

_min = int(min_ + 0.5)
_max = int(max_)

if _min >= _max:
    print(-1)

else:
    print(_min)


Verdicts: Wrong Answer

Accepted