Problem:


Score : 300 points

Problem Statement

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.

Constraints

1 \leq A \leq B \leq 100

A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

If there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.

Sample Input 1

2 2

Sample Output 1

25

If the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:

When the consumption tax rate is 8 percent: \lfloor 25 \times 0.08 \rfloor = \lfloor 2 \rfloor = 2 yen.

When the consumption tax rate is 10 percent: \lfloor 25 \times 0.1 \rfloor = \lfloor 2.5 \rfloor = 2 yen.

Thus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.

Sample Input 2

8 10

Sample Output 2

100

If the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:

When the consumption tax rate is 8 percent: \lfloor 100 \times 0.08 \rfloor = 8 yen.

When the consumption tax rate is 10 percent: \lfloor 100 \times 0.1 \rfloor = 10 yen.

Sample Input 3

19 99

Sample Output 3

-1

There is no price before tax satisfying this condition, so print -1.



Sample input:
2 2


Sample output:
25

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
import math

x = set(range(math.ceil(a/0.08), math.floor((a+1)/0.08)+1))
y = set(range(math.ceil(b/0.1), math.floor((b+1)/0.1)+1))
z = x.intersection(y)
print(min(z)) if z else print(-1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

def main():
    A, B = [int(i) for i in input().split()]
    A_o = int(A*100/8)
    B_o = B*10


    if A_o == B_o:
        print(B*10)
    elif A_o > B_o:
        for i in range(B_o,(B+1)*10):
            if (i * 0.08) == A:
                print(i)
                return
        else:
            print(-1)
    elif A_o < B_o:
        for i in range(A_o,int((A+1)*100/8)):
            if (i * 0.1) == B:
                print(i)
                return
        else:
            print(-1)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

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

print(-1)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
min_a = math.ceil(a / 0.08)
max_a = math.ceil((a+1) / 0.08)

max_b = math.ceil((b+1) / 0.1)
min_b = math.ceil(b / 0.1)

a_range = set(list(range(min_a, max_a + 1)))
b_range = set(list(range(min_b, max_b + 1)))
t = a_range & b_range
if len(t) > 0:
    print(min(list(t)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
a_tax = math.ceil(a / 0.08)
b_tax = math.ceil(b / 0.10)
if (a_tax == b_tax):
    print(a_tax)
else:
    ans = -1
    min_t, max_t = min(a_tax, b_tax), max(a_tax, b_tax)
    for i in range(min_t - 1, max_t + 2):
        if math.floor(i * 0.08) == a & math.floor(i * 0.1) == b:
            ans = i
            break

    print(ans)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
a_tax = math.ceil(a / 0.08)
b_tax = math.ceil(b / 0.10)
if (a_tax == b_tax):
    print(a_tax)
else:
    ans = -1
    min_t, max_t = min(a_tax, b_tax), max(a_tax, b_tax)
    for i in range(min_t, max_t + 1):
        if math.floor(i * 0.08) == a & math.floor(i * 0.1) == b:
            ans = i
            break

    print(ans)

Submission status: Wrong Answer

Solution code:
a, b = (map(int , input().split()))
x = (a * 100) // 8
y = x*10 // 100 
if a != y:   
    print(-1)
else:
    print(x)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
x=A//0.08
x0=x-1
x1=x+1
if int(x0*0.1)==B:
  print(x0)
else:
  if int(x*0.1)==B:
    print(x)
  else:
    if int(x*0.1)==B:
      print(x)
    else:
      print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
for i in range(3000):
    if int(i*0.08)==a and int(i*0.10)==b:
        print(i)
        break
    elif i==3000:
        print("-1")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
for i in range(3000):
    if int(i*0.08)==a and int(i*0.10)==b:
        print(i)
        break
    elif i==100:
        print("-1")

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
C = A * 12.5
D = B * 10
E = C - D
if abs(E) < 12.5:
    print(int(max(C, D)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
C = A * 12.5
D = B * 10
E = C - D
if abs(E) < 10:
    print(int(max(C, D)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

A, B = rl()

import math
for i in range(math.floor(B * 100 / 10), math.ceil(A * 100 / 8)+1):
    if math.floor(i*10/100) == B and math.floor(i*8/100) == A:
        print(i)
print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

a_min = -(-a*100//8)
a_max = int((a+1)*100/8)
b_min = -(-b*100//10)
b_max = int((b+1)*100/10)

if a_max >= b_min and b_max >= a_min:
    print(max([a_min, b_min]))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())


if int((B+0.999)*12.5) >= (A+0.9)*10 and (A+0.9)*10 >= int(B*12.5):
    print(int(B*12.5))
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
B,A = map(int,input().split())


if int((B+0.999)*12.5) >= (A+0.9)*10 and (A+0.9)*10 >= int(B*12.5):
    print(int(B*12.5))
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

for i in range(1, 1001):
    if int(i * 0.08) == A and int(i * 0.10) == B:
        print(i)
        break
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

for i in range(1, 1001):
    if int(i * 0.08) == A and int(i * 0.10) == B:
        print(int(i * 0.08))
        break
print(-1)

Submission status: Wrong Answer

Solution code:
B,A = map(int,input().split())


if int((B+0.999)*12.5) >= A*10 and A*10 >= int(B*12.5):
    print(A*10)
elif int((B+0.999)*12.5) >= (A+0.9)*10 and (A+0.9)*10 >= int(B*12.5):
    print(int(B*12.5))
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
B,A = map(int,input().split())


if (B+0.9)*12.5 >= A*10 and A*10 >= B*12.5:
    print(A*10)
elif (B+0.9)*12.5 >= (A+0.9)*10 and (A+0.9)*10 >= B*12.5:
    print(B*12.5)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

def mklist(x):
    return [x, x+0.1 , x+0.2 , x+0.3, x+0.4, x+0.5, x+0.6, x+0.7, x+0.8, x+0.9]

list_08 = mklist(A)
list_10 = mklist(B)

ans = []
for a in list_08:
    for b in list_10:
        if a/0.08 == b/0.10:
            ans.append(int(a/0.08))

if len(ans) == 0:
    print(-1)
else:
    print(min(ans))

Submission status: Wrong Answer

Solution code:
import sys
A, B = map(int, input().split())

if A > B:
    print(-1)
    sys.exit(0)

def mklist(x):
    return [x, x+0.1 , x+0.2 , x+0.3, x+0.4, x+0.5, x+0.6, x+0.7, x+0.8, x+0.9]

list_08 = mklist(A)
list_10 = mklist(B)

ans = -1
for a in list_08:
    for b in list_10:
        if a/0.08 == b/0.10:
            ans = int(a/0.08)
            print(ans)
            sys.exit(0)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
A, B = map(int, input().split())

def mklist(x):
    return [x, x+0.1 , x+0.2 , x+0.3, x+0.4, x+0.5, x+0.6, x+0.7, x+0.8, x+0.9]

list_08 = mklist(A)
list_10 = mklist(B)

ans = -1
for a in list_08:
    for b in list_10:
        if a/0.08 == b/0.10:
            ans = int(a/0.08)
            print(ans)
            sys.exit(0)
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

for i in range(1000):
    temp_a = i * 0.08
    temp_b = i * 0.1
    if int(temp_a) == a and int(temp_b) == b:
        print(i)
        exit(0)
print("-1")

Submission status: Wrong Answer

Solution code:
import math

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

min_a = math.ceil(a/0.08)
max_a = math.floor((a+1)/0.08)
min_b = math.ceil(b/0.1)
max_b = math.floor((b+1)/0.1)

if max_a < min_b or max_b < min_a:
  print(-1)
else:
  print(max([min_a, min_b]))

Submission status: Wrong Answer

Solution code:
import math
flag = 0
a,b = map(int,input().split())

for i in range(1000):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        break
    elif i*0.08 > a and i*0.1 > b:
        print(-1)
        break

Submission status: Wrong Answer

Solution code:
import math
flag = 0
a,b = map(int,input().split())
for i in range(b*10,b*10+10):
    if math.floor(i*0.08) == a:
        print(i)
        flag = 1
        break
if flag == 1:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

calc_A = A / 0.08
calc_B = B / 0.1

if calc_A // 10 == calc_B // 10:
    print(max(int(calc_A), int(calc_B)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

x_a_min = a/0.08
x_a_max = (a+0.999999)/0.08
x_b_min = b/0.1
x_b_max = (b+0.999999)/0.1

if math.ceil(x_a_max)>=math.ceil(x_b_min):
    print(math.ceil(max(x_a_min,x_b_min)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

x_a_min = a/0.08
x_a_max = (a+0.999999)/0.08
x_b_min = b/0.1
x_b_max = (b+0.999999)/0.1

if math.floor(x_a_max)>=math.floor(x_b_min):
    print(math.floor(max(x_a_min,x_b_min)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

x_a_min = a/0.08
x_a_max = (a+0.999999)/0.08
x_b_min = b/0.1
x_b_max = (b+0.999999)/0.08

if math.floor(x_a_max)>=math.floor(x_b_min):
    print(math.floor(max(x_a_min,x_b_min)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

x_a_min = a/0.08
x_a_max = (a+0.999999)/0.08
x_b_min = b/0.1
x_b_max = (b+0.999999)/0.08

if x_a_max>=x_b_min:
    print(math.floor(max(x_a_min,x_b_min)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
#ABC158
a,b = map(int,input().split())

tax_a = a/0.08
tax_b = b/0.1
c = max(tax_a,tax_b)
if int(c*0.08) == a and int(c*0.1) == b:
    d = int(c)-1
    if int(d*0.08) == a and int(d*0.1) == b:
        print(d)
    else:
        print(int(c))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

x_a_min = a/0.08
x_a_max = (a+0.999999)/0.08
x_b_min = b/0.1
x_b_max = (b+0.999999)/0.08

if x_a_max>=x_b_min:
    print(math.ceil(max(x_a_min,x_b_min)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

x_a_min = a/0.08
x_a_max = (a+0.9)/0.08
x_b_min = b/0.1
x_b_max = (b+0.9)/0.08

if x_a_max>=x_b_min:
    print(math.ceil(max(x_a_min,x_b_min)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
#ABC158
a,b = map(int,input().split())

tax_a = a/0.08
tax_b = b/0.1
c = max(tax_a,tax_b)
if int(c*0.08) == a and int(c*0.1) == b:
    print(int(c))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
#ABC158
a,b = map(int,input().split())

tax_a = a/0.08

if int(tax_a*0.1) == b:
    ans = int(tax_a)-1
    if int(ans*0.1) == b and int(ans*0.8) == a:
        print(int(ans))
    else:
        print(int(tax_a))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
#ABC158
a,b = map(int,input().split())

tax_a = a/0.08

if int(tax_a*0.1) == b:
    ans = tax_a-1
    if int(ans*0.1) == b and int(ans*0.8) == a:
        print(int(ans))
    else:
        print(int(tax_a))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

tax_a = a/0.08

if int(tax_a*0.1) == b:
    print(int(tax_a))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
cnt=0
ans=0
for x in range(1,101):
    if 8*x//100==a and x//10==b:
        cnt += 1
        ans=x
        break
if cnt>0: print(ans)
else: print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
X = -1
start = 1
end = 100
for i in range(start, end):
    if int(i * 0.1) == B and int(i * 0.08) == A:
        X = i
        break
 
print(X)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
X = -1
start = min(int(B/0.1),int(A/0.08))
end = max(int(B/0.1),int(A/0.08))+1
for i in range(start, end):
    if int(i * 0.1) == B and int(i * 0.08) == A:
        X = i
        break

print(X)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
X = -1
start = min(int(B/0.1),int(A/0.08))
end = max(int(B/0.1),int(A/0.08))+1
for i in range(start, end):
    if int(i * 0.1) == B and int(i * 0.08) == A:
        X = i

print(X)

Submission status: Wrong Answer

Solution code:
S = input()
for x in range(200000):
    try:
        q = input().split()
        if len(q) == 1:
            S = S[::-1]

        elif len(q) == 3:
            f = int(q[1])
            c = q[2]
            if f == 1:
                S = c + S
            elif f == 2:
                S += c
    except EOFError:
        break
print(S)

Submission status: Wrong Answer

Solution code:
l = [int(x) for x in input().split()]
A, B = l[0], l[1]

eight = list(range(int(25 * A // 2), int(25 * (A + 1) // 2) + 1))
# print(eight)
ten = list(range(int(10 * B), int(10 * (B + 1)) + 1))
# print(ten)

o = []
for x in eight:
    if x in ten:
        print(x)
        o.append(x)
        break

if len(o) == 0:
    print(-1)

Submission status: Wrong Answer

Solution code:
l = [int(x) for x in input().split()]
A,B = l[0], l[1]

eight = list(range(int(25*A//2), int(25*(A+1)//2)+1))
#print(eight)
ten = list(range(int(10*B), int(10*(B+1))+1))
#print(ten)

o = []
for x in eight:
    if x in ten:
        print(x)
        break

if o == []:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B=[int(s) for s in input().split()]
for i in range(1,101):
  a=int(i*0.08)
  b=int(i*0.1)
  if a==A and b==B:
    print(i)
    break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A,B=[int(s) for s in input().split()]
for i in range(101):
  a=int(i*0.08)
  b=int(i*0.1)
  if a==A and b==B:
    print(i)
    break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
# A: 0.08 tax, B: 0.10 tax
A, B = list(map(int, input().split()))

# find candidate prices
candidate_prices = [(B*10) + i for i in range(0 , 6)]

# find minimum possible price
min_price = -1
for p in candidate_prices:  
    if int(p*(0.08)) == A:
        min_price = p
        break

print(min_price)

Submission status: Wrong Answer

Solution code:
# A: 0.08 tax, B: 0.10 tax
A, B = list(map(int, input().split()))

# find candidate prices
candidate_prices = [(B*10) + i for i in range(0 , 6)]

# find minimum possible price
for p in candidate_prices:  
    if int(p*(0.08)) == A:
        print(p)

print(-1)

Submission status: Wrong Answer

Solution code:
a, b, = map(int, input().split())

for i in range(1, 1000):
    price_a = 0.08 * i
    price_b = 0.1 * i

    if int(price_a) == a and int(price_b) == b:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b, = map(int,input().split())

for i in range(1,1000):
    price_a = 0.08 * i
    price_b = 0.1  * i

    if math.floor(price_a) == a and math.floor(price_b) == b:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

ans = -1

a = math.floor(A * 12.5)
b = math.floor(B * 10)
if a <= b < a + 12:
    ans = b
elif b <= a < b + 10:
    ans = a
print(ans)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int, input().split())
flag=False
for i in range(1000):
  A_X=math.floor(i*0.08)
  if(A_X==A):
    B_X=math.floor(i*0.10)
    if(B_X==B):
      print(i)
      flag=True
      break
if(flag==False):
  print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

x1 = a / 0.08
x2 = b / 0.10

for x in range(int(min(x1, x2))-1, int(max(x1, x2))+1):
    if int(x*0.08) == a and int(x*0.10) == b:
        print(x)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

if A/0.08 == B/0.1:
    print(int(A/0.08))
    exit()
else:
    for i in range(int(min(A/0.08, B/0.1)), 1001):
        if int(i*0.08) == int(i*0.1):
            print(i)
            exit()

print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

x1 = round(a / 0.08)
x2 = round(b / 0.10)

for x in range(min(x1, x2), max(x1, x2)+1):
    if int(x*0.08) == a and int(x*0.10) == b:
        print(x)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a ,b = map(int, input().split())

for i in range(int(b/0.1), int((b+1)/0.1) + 1):
    if int(i*0.08) == a:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a ,b = map(int, input().split())

for i in range(int(b/0.1)-1, int((b+1)/0.1) + 1):
    if int(i*0.08) == a:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a ,b = map(int, input().split())


for i in range(int(b/0.1)-1, int((b+1)/0.1) + 1):
    if int(i*0.08) == a:
        print(i)
        break
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
data = input().split()

a = int(data[0])
b = int(data[1])

n = min(a, b)

def lookup():    
    for i in range(n, 10000):
        tax_a = int(i * 0.08)
        tax_b = int(i * 0.1)
        if tax_a == tax_b:
            print(tax_a)
            return
    print(-1)

lookup()

Submission status: Wrong Answer

Solution code:
data = input().split()

a = int(data[0])
b = int(data[1])

n = min(int(a / 0.08), int(b / 0.1))

def lookup():    
    for i in range(n, 10000):
        tax_a = int(i * 0.08)
        tax_b = int(i * 0.1)
        if tax_a == tax_b:
            print(tax_a)
            return
    print(-1)

lookup()

Submission status: Wrong Answer

Solution code:
import math

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

a_min = math.ceil(a / 0.08)
b_max = math.ceil(b / 0.10 - 1)

if b_max <= a_min:
    print(a_min)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
import math

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

a_min = math.ceil(a / 0.08)
b_max = math.ceil(b / 0.10 - 1)

if b_max < a_min:
    print(a_min)
else:
    print("-1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1


if Amax<Bmin or Bmax<Amin:
    print(-1)
else:
  a=math.ceil(Amin)
  b=math.ceil(Bmin)
  if a<=Bmax or b<=Amax:
    print(max(a,b))
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1


if Amax<Bmin or Bmax<Amin:
    print(-1)
else:
    p=max(math.ceil(Amin),math.ceil(Bmin))
    print(p)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1


if Amax<Bmin or Bmax<Amin:
    print(-1)
else:
    p=max(Amin,Bmin)
    print(math.ceil(p))

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1


if Amax<Bmin or Bmax<Amin:
    print(-1)
else:
    p=min(Amin,Bmin)
    print(math.ceil(p))

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1

a=[]
b=[]
c=[]
"""
if int(Amin)==Amin:
    p=Amin
else:
    p=int(Amin)+1

if int(Bmin)==Bmin:
    q=Bmin
else:
    q=int(Bmin)+1
"""
p=int(Amin+1)
q=int(Bmin+1)
while p<=Amax:
    a.append(p)
    p+=1
while q<=Bmax:
    b.append(q)
    q+=1
for i in range(len(a)):
    if a[i] in b:
        c.append(a[i])
for i in range(len(b)):
    if b[i] in a:
        c.append(b[i])
if len(c)==0:
  print(-1)
else:
  print(min(c))

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1
print(Amin,Amax,Bmin,Bmax)
a=[]
b=[]
c=[]
"""
if int(Amin)==Amin:
    p=Amin
else:
    p=int(Amin)+1

if int(Bmin)==Bmin:
    q=Bmin
else:
    q=int(Bmin)+1
"""
p=int(Amin+1)
q=int(Bmin+1)
while p<=Amax:
    a.append(p)
    p+=1
while q<=Bmax:
    b.append(q)
    q+=1
for i in range(len(a)):
    if a[i] in b:
        c.append(a[i])
for i in range(len(b)):
    if b[i] in a:
        c.append(b[i])
if len(c)==0:
  print(-1)
else:
  print(min(c))

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1

a=[]
b=[]
c=[]
if int(Amin)==Amin:
    p=Amin
else:
    p=int(Amin)+1

if int(Bmin)==Bmin:
    q=Bmin
else:
    q=int(Bmin)+1
while int(Amin)<=p<=Amax:
    a.append(p)
    p+=1
while int(Bmin)<=q<=Bmax:
    b.append(q)
    q+=1
for i in range(len(a)):
    if a[i] in b:
        c.append(a[i])
for i in range(len(b)):
    if b[i] in a:
        c.append(b[i])
if len(c)==0:
  print(-1)
else:
  print(int(min(c)))

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math

if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    A, B = list(map(int,_in[0].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    if B/0.1<A/0.08:
        cnt = -1 if (B+1)/0.1<A/0.08 else math.ceil(A/0.08)
    else:
        cnt = -1 if (A+1)/0.08<B/0.1 else math.ceil(B/0.1)
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

for bb in range(b*10,(b+1)*10+2,1):
  if bb == (b+1)*10+1:
    print(-1)
    break
  elif a*12.5 <= bb and bb < (a+1)*12.5:
    print(bb)
    break

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

for bb in range(b*10,(b+1)*10+2,1):
  if bb == (b+1)*10+1:
    print(-1)
    break
  elif a*12.5 <= bb and bb <= (a+1)*12.5:
    print(bb)
    break

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())

for bb in range(b*10,(b+1)*10+2,1):
  if bb == (b+1)*10+1:
    print(-1)
  elif a*12.5 <= bb and bb <= (a+1)*12.5:
    print(bb)
    break

Submission status: Wrong Answer

Solution code:
import math

A, B = map(int, input().split())
 
priceA1 = A / 0.08
priceA2 = (A+1) / 0.08
priceB1 = B / 0.10
priceB2 = (B+1) / 0.10

if math.ceil(priceA1) < math.ceil(priceB1) <= math.floor(priceA2):
    print(math.ceil(priceB1))
elif math.ceil(priceB1) < math.ceil(priceA1) <= math.floor(priceB2):
    print(math.ceil(priceA1))
elif math.ceil(priceA1) == math.ceil(priceB1):
    print(math.ceil(priceA1))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

A, B = map(int, input().split())
 
priceA1 = A / 0.08
priceA2 = (A+1) / 0.08
priceB1 = B / 0.10
priceB2 = (B+1) / 0.10

if priceA1 <= math.ceil(priceB1) <= math.floor(priceA2):
    print(math.ceil(priceB1))
elif priceB1 <= math.ceil(priceA1) <= math.floor(priceB2):
    print(math.ceil(priceA1))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
 
priceA1 = A / 0.08
priceA2 = (A+1) / 0.08
priceB1 = B / 0.10
priceB2 = (B+1) / 0.10

if priceA1 <= priceB1 < priceA2:
    print(int(priceB1))
elif priceB1 <= priceA1 < priceB2:
    print(int(priceA1))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
cand_b=[b*10 + i for i in range(b)]
def ans(cand):
  for price in cand:
    if int(price*0.08)==a:
      print(price)
      return
  print(-1)

ans(cand_b)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
cand_b=[b*11 + i for i in range(b)]
def ans(cand):
  for price in cand:
    if int(price*0.08)==a:
      print(price)
      return
  print(-1)

ans(cand_b)

Submission status: Wrong Answer

Solution code:
A, B = list(map(int, input().split(' ')))
Arange = [A/0.08, (A+1)/0.08]
Brange = [B/0.1, (B+1)/0.1]

if Arange[0] >= Brange[0]:
    Arange, Brange = Brange, Arange

if Arange[1] <= Brange[0]:
    print(-1)
elif Brange[0] < Arange[1]:
    print(int(Brange[0]))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

start = b * 10
flg = True
for i in range(10):
  tmp = (start + i) * 0.08
  if int(tmp) == a:
    flg = False
    break
if flg:
  print('-1')
else:
  print(int(tmp))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

start = b * 10
flg = True
for i in range(10):
  tmp = (start + i) * 0.08
  if tmp == a:
    flg = False
    break
if flg:
  print('-1')
else:
  print(int(tmp))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
 
x=(a*100)//8
x=max(x-15,1)

flag=0
for i in range(x,x+20):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    flag=1
    break

if flag==0:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
 
x=(a*100)//8
x=x-15

flag=0
for i in range(x,x+20):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    flag=1
    break

if flag==0:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
 
x=(a*100)//8
x=x-10

flag=0
for i in range(x,x+20):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    flag=1
    break

if flag==0:
  print(-1)

Submission status: Wrong Answer

Solution code:
A, B = list(map(int, input().split(' ')))
Arange = [A/0.08, (A+1)/0.08]
Brange = [B/0.1, (B+1)/0.1]

if Arange[0] > Brange[0]:
    Arange, Brange = Brange, Arange

if Arange[1] <= Brange[0]:
    print(-1)
elif Brange[0] < Arange[1]:
    print(int(Brange[0]))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
 
x=(a*100)//8
we=b-a

 
if int(x*0.02)==we:
  ans=x
  while 1:
    x=x-1
    if int(x*0.02)==we:
      ans=x
    else:
      break
  print(ans)
else:
  print('-1')

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

x = a/0.08
y = b/0.1
if x//10==y//10:
  print(int(max(x, y)))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())

x=(a*100)//8
we=b-a


if int(x*0.02)==we:
  print(x)
else:
  print('-1')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())

x=(a*100)//8

if x//10==b:
  print(x)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = list(map(int, input().split()))
answer = 0
answer = math.floor(A * 100/8)
if math.floor(answer * 0.1) == B:
    print(answer)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A, B = list(map(int, input().split()))

ans = -1

a = int(A/0.08)
b = int(B/0.1)

if a > b:
    a, b = b, a

for i in range(a, b+1):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        print(i)
        exit()

print(-1)

Submission status: Wrong Answer

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    a,b = readInts()
    for i in range(1,101):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)
        if a_ == a and b_ == b:
            print(i)
            exit()
    print(-1)
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
# 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))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
aa=-(-a*25//2)
aaa=(a+1)*25//2
bb=b*10
bbb=(b+1)*10
if aaa<bb or bbb<aa:
  print(-1)
elif aa<bb:
  print(bb)
else:
  print(aa)

Submission status: Wrong Answer

Solution code:
from math import floor
def Main(A, B):
    for i in range(1, 101):
        if floor(i*0.08) == A and floor(i*0.1) == B:
            return i
    return -1
    
def main():
    A, B = map(int, input().split())
    print(Main(A, B))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
A,B = (int(x) for x in input().split())
minA = math.ceil(A/0.08)
minB = math.ceil(B/0.1)
if minA >= minB:
  if minB*0.08 >= A:
    print(minA)
  else:
    print(-1)
else:
  if minA*0.1>= B:
    print(minB)
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = (int(x) for x in input().split())
minA = math.ceil(A/0.08)
minB = math.ceil(B/0.1)
if minA >= minB:
  if minB*0.1 >= A:
    print(minA)
  else:
    print(-1)
else:
  if minA*0.1>= B:
    print(minB)
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
x_min = max(int(100/8 * a), int(100/10 * b))
x_max = min(int(100/8 * (a+1)), int(100/10 * (b+1)))
ass = 1 if ((100/8 * (a+1))-int(100/8 * (a+1))) else 0
bss = 1 if ((100/10 * (b+1))-int(100/10 * (b+1))) else 0
As = set(range(int(100/8 * a), int(100/8 * (a+1))+ ass))
Bs = set(range(int(100/10 * b), int(100/10 * (b+1))+bss))
if As & Bs:
    print(x_min)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B = list(map(int,stdin.readline().strip().split()))
C=A/0.08
if A*1.25!=B:B*=1.25
D=B/0.1
if C==D:print(int(C))
else:print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
x_min = max(int(100/8 * a), int(100/10 * b))
x_max = min(int(100/8 * (a+1)), int(100/10 * (b+1)))
if int(100/8 * a) > int(100/10 * (b+1)) or int(100/10 * b) > int(100/8 * (a+1)):
    print(-1)
else:
    print(x_min)