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 .

Solution (Python):
A,B = map(int, input().split())
X = int((A/0.08)+0.5)
Y = int((B/0.1)+0.5)
min = 0

if X > Y:
    if int(X*0.1) == B:
        min = X
    else :
        min = -1
elif X < Y:
    if int(Y*0.08) == A:
        min = Y
    else :
        min = -1
else :
    min = X

print(min)

Solution (Python):
A, B = (int(x) for x in input().split())
A_min = A / 0.08
A_max = (A + 1) / 0.08
B_min = int(B / 0.10)
B_max = int((B + 1) / 0.10)
ans = '-1'

for i in range(B_min, B_max):
    if i >= A_min and i < A_max:
        ans = i
        break

print(ans)

Solution (Python):
num_data = input().split(' ')
num = [int(num_data[i]) for i in range(2)]
data = 1
key = 0
while(1):
    if(data * 8 // 100 ==num[0] and num[1] == data // 10):
        break
    data += 1
    if(data >= 1250):
        key = 1
        break

if(key == 1):
	print(-1)
else:
  	print(data)

Solution (Python):
import sys

a,b = [int(c) for c in input().split()]
maxa = (a+1) / 0.08
maxb = (b+1) / 0.1
mina = a / 0.08
minb = b / 0.1
mmax = int(min(maxa,maxb)) - 1 if int(min(maxa,maxb))==min(maxa, maxb) else int(min(maxa,maxb))
mmin = int(max(mina,minb)) if int(max(mina,minb))==max(mina,minb) else int(max(mina,minb)) + 1
if mmin>mmax:
    print("-1")
else:
    print(mmin)

Solution (Python):
import math

A, B = map(int, input().split())
big = math.floor(max(A, B) / 0.08)
sma = math.floor(min(A, B) / 0.1)
num_list = [int(i) for i in range(sma - 1, big + 2)]

for i in num_list:
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)

Solution (Python):
import copy
import math
import string
import heapq
import bisect
import sys
sys.setrecursionlimit(10**7)

A,B = map(int,input().split())
flag = 0
for i in range(100000):
    if(math.floor(i*0.08) == A and math.floor(i*0.1) == B):
        print(i)
        flag = 1
        break
if(flag == 0):
    print(-1)

Solution (Python):
A,B = map(int, input().split())
Anum = int((A/0.08)+0.5)
Bnum = int((B/0.1)+0.5)
check = 0
if Anum>Bnum:
    check=int(Anum*0.1)
    if check!=B:
        print('-1')
    else:
        print(Anum)
elif Anum<Bnum:
    check=int(Bnum*0.08)
    if check!=A:
        print('-1')
    else:
        print(Bnum)
else:
    print(Anum)

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

b_l = list(range(int(b/0.1), int((b+0.99)//0.1+1)))
for b_ in b_l:
  s = int(b_*0.08//1)
  if s==a:
    print(str(b_))
    exit(0)
print('-1')

Solution (Python):
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
        break

if ans:
    print(-1)

Solution (Python):
from math import floor

def dostuff():
    a, b = (int(x) for x in input().split(' '))

    x = b * 10
    for i in range(x, x + 10):
        if floor(i * 0.08) == a:
            print(i)
            return
    print(-1)

dostuff()

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

price=0
for i in range(10):
  price=10*B+i
  if int(price*0.08)==A:
    print(price)
    exit()

print('-1')

Solution (Python):
A, B = map(int, input().split())
Nmax = int(100//0.08)
ans = -1
for N in range(1, Nmax + 1):
    ja = int(N * 0.08)
    jb = int(N * 0.1)
    if ja == A and jb == B:
        ans = N
        break
    else:
        pass
print(ans)

Solution (Python):
import math
a,b=map(int,input().split())
cmin=a/0.08
cmax=(a+1)/0.08
dmin=b/0.1
dmax=(b+1)/0.1



if (cmin>=dmax or cmax<=dmin):
  print(-1)
else:
  if (cmin<dmin):
    print(math.ceil(dmin))
  elif (dmin<=cmin):
    print(math.ceil(cmin))

Solution (Python):
A,B=map(int,input().split())
A0=[100*A/8,100*(A+1)/8]
B0=[100*B/10,100*(B+1)/10]
S0=max(A0[0],B0[0])
S1=min(A0[1],B0[1])
if int(S0)>=S0 and int(S0)<S1:
    print(int(S0))
elif int(S0)+1<S1:
    print(int(S0)+1)
else:
    print(-1)

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

Solution (Python):
A,B = map(int,input().split())
flag = 0
for i in range(1,1001,1):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        flag = 1
        break
if flag == 0:
    print(-1)

Solution (Python):

A,B = map(int,input().split())
ans = []

for i in range(1,1001):
    x = int(i * 0.08)
    y = int(i * 0.10)
    if x == A and y == B:
        ans.append(i)
    else:
        pass
if len(ans) == 0:
    print(-1)
else:
    print(ans[0])

Solution (Python):
from math import floor
A, B = map(int, input().split())
for i in range(1500):
    if floor(i*0.08) == A and floor(i*0.1) == B:
        print(i)
        break
else:
    print(-1)

Solution (Python):
a,b = map(int,input().split())
import math
c = math.ceil(a/0.08)
d = round(b/ (0.1))
e = math.ceil((a+1)/0.08)-1
f = round((b+1)/0.1)-1
i = c
j = -1
for i in range(c,e+1):
    if d <= i <= f:
        j = i
        break
    else:
        i = i+1
print(j)

Solution (Python):
import math

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

ans =  -1

for i in range(2000):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
        ans = i
        break

print(ans)

Solution (Python):
import math

a, b=map(int, input().split())
for x in range(1300):
    if math.floor(x*0.08)==a and math.floor(x*0.1)==b:
        print(x)
        break
else:
    print(-1)

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

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

import math
mina = math.ceil(a*12.5) 
minb = b*10 
maxa = math.ceil((a+1)*12.5) 
maxb = (b+1)*10 
minab = max([mina, minb])
maxab = min([maxa, maxb])

if minab >= maxab:
    ans = -1
else:
    ans = minab

print(ans)

Solution (Python):
import math

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

pricemax_A = math.floor((A+1)/0.08)
pricemin_A = math.ceil(A/0.08)

pricemax_B = math.floor((B+1)/0.1)
pricemin_B = math.ceil(B/0.1)

if pricemin_A >= pricemin_B and pricemin_A < pricemax_B:
    print(pricemin_A)
elif pricemin_A <= pricemin_B and pricemax_A > pricemin_B:
    print(pricemin_B)
else:
    print(-1)

Solution (Python):
import math
A,B=[int(s) for s in input().split(" ")]
list=[]
for i in range(1010):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
            list.append(i)
list.sort()

print(-1 if list==[] else list[0])

Solution (Python):
a, b = map(int, input().split())
flag = False
for i in range(1, 1010):
    eig = int(i * 0.08)
    ten = int(i * 0.1)
    if eig == a and ten == b:
        flag = True
        break

print(i if flag == True else '-1')

Solution (Python):
A,B=map(int,input().split())
for x in range(10*B,10*B+10):
    if A*100/8<=x<A*100/8+100/8:
        print(x)
        exit()
print("-1")

Solution (Python):
import math

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

ans = -1
for i in range(1,1001) :
  if math.floor(i*0.08) == a and math.floor(i*0.1) == b :
    ans = i
    break
    
print(ans)

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

ans = 0

for i in range(1900):
    if int(i * 0.08) == A and int(i* 0.1) == B:
        ans = i
        break
    else:
        ans = -1

print(ans)

Solution (Python):
def calc_range(x, rate):
    return -(-x//rate), -(-(x+1)//rate)

a,b = list(map(int, input().split()))
a_min, a_max = calc_range(a, 0.08)
b_min, b_max = calc_range(b, 0.10)
if b_max <= a_min or a_max <= b_min:
    print(-1)
elif a_min <= b_min:
    print(int(b_min))
elif b_min < a_min:
    print(int(a_min))

Solution (Python):
a, b = (int(x) for x in input().split())

ans = -1
for x in range(10*b, 10*(b+1)):
    if 25/2*a <= x < 25/2*(a+1):
        ans = x
        break
print(ans)

Solution (Python):
import math
count = 0
a, b = map(int, input().split())
k = 10 * b
while 10 * b <= k < 10*b + 10:
  if math.floor(0.08 * k) == a:
    print(k)
    count += 1
    break
  else:
    k += 1

if count == 0:
  print(-1)

Solution (Python):
a, b = map(int, input().split())
for i in range(1100):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        break
else:
    print(-1)

Solution (Python):





A, B = map(int, input().split())
ans = -1
for i in range (1000 + 1):
    if (int(i*0.08) == A) and (int(i*0.10) == B):
        ans = i
        break
print(ans)

Solution (Python):
import math
a,b = map(int, input().split())
start = 0
if a < b:
    start = math.ceil(a * 12.5)
else:
    start = math.ceil(b * 10)

flg = False
for i in range(start, 1009):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        flg = True
        print(i)
        break

if not flg:
    print(-1)

Solution (Python):
A,B = map(int,input().split())
ans = -1
for i in range(1009,-1,-1):
  X = int(i*0.08)
  Y = int(i*0.10)
  if X == A and Y == B:
    ans = i
print(ans)

Solution (Python):
a,b = map(int, input().split())
flag = 0
for i in range(10*b, 10*b+10):
	if int(i * 0.08) == a:
		if flag == 0:
			ans=i
			flag = 1
if flag == 1:
	print(ans)
else:
	print(-1)

Solution (Python):
a,b = map(int,input().split())
res1 = a/0.08
res2 = b*10
res = -1
for i in range(res2,res2+10):
  if a<=0.08*i<a+1:
    res = i
    break
print(res)

Solution (Python):
a, b = map(int, input().split(" "))
ans = -1
for i in range(1009,-1,-1):
  tax1 = int(i*0.08)
  tax2 = int(i*0.1)
  if tax1 == a and tax2 == b:
    ans = i
print(ans)

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

for i in range(10001):
    if i//10==b and int(i*0.08)==a:
        print(i)
        exit()
print(-1)

Solution (Python):
A, B = map(int, input().split())
ans = -1
for i in range (1000 + 1):
    if (int(i*0.08) == A) and (int(i*0.10) == B):
        ans = i
        break
print(ans)

Solution (Python):
A, B = map(int, input().split())
for i in range (1001):
    if (int(i*0.08) == A) and (int(i*0.10) == B):
        print(i)
        break
else:
    print(-1)

Solution (Python):
A, B = map(int, input().split())
ans = 0
while ans <= 1000:
    if (int(ans*0.08) == A) and (int(ans*0.10) == B):
        print(ans)
        break
    else:
        ans += 1
else:
    print(-1)

Solution (Python):
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)
        exit()
print(-1)

Solution (Python):
A, B = [int(x) for x in input().split()]

for price in range(10, 1263):
    if int(price * 0.08) == A and int(price * 0.1) == B:
        print(price)
        exit()

print(-1)

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

if (12.5*a)<=(10*b) and (12.5*(a+1))>(10*b):
  print(int(10*b))
elif a%2==0 and (10*b)<=(12.5*a) and (10*(b+1))>(12.5*a):
  print(int(12.5*a))
elif a%2==1 and (10*b)<=(12.5*a) and (10*(b+1))>((12.5*a)+0.5):
  print(int((12.5*a)+0.5))
else:
  print(-1)

Solution (Python):
A,B = list(map(int,input().split()))
C = []
for i in range(A*14):
  if A * 12.5 <= i < (A+1) * 12.5 and B * 10 <= i < (B+1) * 10:
    C.append(i)
if len(C) == 0:
  print('-1')
else:
  print(min(C))

Solution (Python):
A,B=map(int,input().split())
import math
a=math.ceil(A*100/8)
b=math.ceil((A+1)*100/8)
while math.floor(a*0.1)!=B and a<b:
  a+=1
if a==b:
  print(-1)
else:
  print(a)

Solution (Python):
"""
    Author: _YL_
"""
a, b = map(int, input().split())

l = a / 0.08
u = int((a+0.99) / 0.08)

if l == int(l):
    l = int(l)
else:
    l = int(l) + 1

i = l
while i <= u:
    if int(i * 0.1) == b:
        break
    else:
        i += 1
if i <= u:
    print(i)
else:
    print("-1")

Solution (Python):
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)

Solution (Python):
A, B = list(map(int, input().split()))
Amin, Amax, Bmin, Bmax = A/0.08, (A+1)/0.08, B/0.1, (B+1)/0.1
min_price = int(max(Amin, Bmin))
if min_price != max(Amin, Bmin):
    min_price += 1
max_price = int(min(Amax, Bmax))
if max_price == min(Amax, Bmax):
    max_price -= 1
if min_price > max_price:
    print("-1")
else:
    print(min_price)

Solution (Python):
import math
A,B = list(map(int,input().split()))
A_ans_mini = math.ceil(A/0.08)
A_ans_max = math.floor((A+0.9999)/0.08)
B_ans_mini = math.ceil(B/0.1)
B_ans_max = math.floor((B+0.9999)/0.1)
if A_ans_max <B_ans_mini or B_ans_max < A_ans_mini:
    print("-1")
else:
    if B_ans_mini<A_ans_mini:
        ans = A_ans_mini
    else: ans = B_ans_mini
    print(int(ans))

Solution (Python):
import sys

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

for i in range(1,1001):

  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    sys.exit()

print("-1")

Solution (Python):
import math
eight,ten = map(int,input().split())
dummy = 10*ten
flag = "ng"
for i in range(dummy,dummy+10):
  if math.floor(i*0.08) == eight:
    flag = "ok"
    ans = i
    break
if flag == "ok":
  print(ans)
else:
  print(-1)

Solution (Python):
import sys

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

for yen in range(0,1251):
    if (int(yen*0.08) == A and int(yen*0.1) == B):
        print(yen)
        sys.exit()

print(-1)

Solution (Python):
def main():
    a,b=map(int,input().split())
    z=b*10+9 
    y=None
    while z//10==b:
        if z*8//100==a:
            y=z
        z-=1
    if y is None:
        print(-1)
    else:
        print(y)
main()

Solution (Python):
import math
A, B = map(int, input().split())
Al = math.ceil(A / 0.08)
Au = int((A + 0.99) // 0.08) + 1
Bl = math.ceil(B / 0.1)
Bu = int((B + 0.9) // 0.1) + 1
Ar = [x for x in range(Al, Au)]
Br = [y for y in range(Bl, Bu)]
X = set(Ar) & set(Br)
print(-1 if list(X) == [] else min(X))

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

y = b*10

for i in range(10):
    if math.floor( (y + i) * 0.08 ) == a:
        print(y+i)
        sys.exit()

print(-1)

Solution (Python):
def main(a, b):
    for i in range(10000):
        if int(i * 0.08) == a and int(i * 0.1) == b:
            print(i)
            return

    print(-1)


if __name__ == "__main__":
    a, b = map(int, input().split())

    main(a, b)

Solution (Python):
from math import floor


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



for price in range(1010):
    if (floor(price * 0.08) == A) and (floor(price * 0.1) == B):
        
        
        
        print(price)
        quit()





print(-1)

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

for i in range(1001):
    tax_8 = int(i * 0.08)
    tax_10 = int(i * 0.1)
    if tax_8 == a and tax_10 == b:
        print(i)
        exit()
print(-1)

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

for i in range(1, 1001):
    if i * 8 // 100 == a and i * 10 // 100 == b:
        ans = i
        break
else:
    ans = -1

print(ans)

Solution (Python):
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())

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

for i in range(1, 10**5):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()

print(-1)

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

Amin = A/0.08
if Amin != int(Amin):
  Amin = int(Amin)+1
else:
  Amin = int(Amin)

Bmin = B/0.1
if Bmin != int(Bmin):
  Bmin = int(Bmin)+1
else:
  Bmin = int(Bmin)

rangea = set(range(Amin,int((A+1)/0.08),1))
rangeb = set(range(Bmin,int((B+1)/0.10),1))

intersection = rangea & rangeb

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

Solution (Python):
A, B = map(int, input().split())
def calc(A, B):
  Amin = A/0.08
  if (Amin - int(Amin)) != 0.:
    Amin = int(Amin)+1
  else:
    Amin = int(Amin)
  Amax = int((A+1)/0.08)
  Arange = set(range(Amin, Amax))
  Bmin = B/0.1
  if (Bmin - int(Bmin)) != 0.:
    Bmin = int(Bmin)+1
  else:
    Bmin = int(Bmin)
  Bmax = int((B+1)/0.1)
  Brange = set(range(Bmin, Bmax))
  intersection = Arange & Brange
  print(-1) if len(intersection) == 0 else print(min(intersection))
calc(A, B)

Solution (Python):
x,y = map(int,input().split())

for i in range(10000):
    p = int(i * 0.08)
    q = int(i * 0.1)
    if p == x and q == y:
        print(i)
        break
    elif i == 9999:
        print(-1)

Solution (Python):
import math
tax_eight, tax_ten = map(int, input().split())
min_eight_price = math.ceil(tax_eight / 0.08)
max_eight_price = math.floor((tax_eight + 1) / 0.08 - 1)
min_ten_price = tax_ten / 0.1 
max_ten_price = (tax_ten + 1) / 0.1 - 1
min_price = max(min_eight_price, min_ten_price)
max_price = min(max_eight_price, max_ten_price)
if max_price < min_price:
    print(-1)
else:
    print(int(min_price))

Solution (Python):
import math
a, b = map(int, input().split(" "))
for n in range(100000):
    n += 1
    if math.floor(n*0.08) == a and math.floor(n*0.1) == b:
        print(n)
        break
    else:
        if n == 100000:
            print(-1)

Solution (Python):
from sys import exit

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

Solution (Python):
l = input().split()
a,b = [int(x) for x in l]

def check(n, a, b):
    if int(n*0.08) == a and int(n*0.1) == b:
        return "1"
    else:
        if int(n*0.08) > a or int(n*0.1) > b:
            return "imp"
        return "0"

x1 = int(a/0.08)
x2 = int(b/0.1)
temp = max(x1,x2)
stat = "0"
while stat != "imp":
    stat = check(temp,a,b)
    if stat == "1":
        break
    else:
        temp += 1

if stat == "imp":
    print(-1)
else:
    print(temp)

Solution (Python):
a,b = map(int, input().split())
for n in range(1, 10001):
  if n*8//100 == a and n*10//100 == b:
    print(n)
    exit()
print(-1)

Solution (Python):
n,m=map(int,input().split())
f=0
for i in range(int(m/0.1),int(m/0.1)+10):
    if int(i*0.08)==n:
        print(i)
        f=1
        break
if not f:
    print(-1)

Solution (Python):
a = [list(map(int, s.split())) for s in open(0)] [0]
for i in range(1, 1009):
    if (i * 0.08 >= a[0]) and (i * 0.08 < a[0] + 1) and (i * 0.1 >= a[1]) and (i * 0.1 < a[1] + 1):
        print(i)
        break
else:
    print(-1)

Solution (Python):
A, B = input().rstrip().split(' ')
A = int(A) 
B = int(B) 

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

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

for i in range(1,1010):
  if (int(i*0.08)==A)&(int(i*0.1)==B):
    print(i)
    break
else:
    print(-1)

Solution (Python):
A, B = map(int, input().split())
for i in range(10**4+100):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        break
else:
    print(-1)

Solution (Python):
A, B = map(int, input().split())
for i in range(1, 1010):
  if (i * 8)//100 == A and i//10 == B:
    print(i)
    break
else:
  print(-1)

Solution (Python):
from math import floor, ceil

inp = input()
A, B = [int(x) for x in inp.split(" ")]

min1 = ceil(A / 0.08)
max1 = floor((A+0.999) / 0.08)
min2 = ceil(B / 0.1)
max2 = floor((B+0.999) / 0.1)

if min1 >= min2 and min1 <= max2:
    print(min1)
elif min2 >= min1 and min2 <= max1:
    print(min2)
else:
    print(-1)

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

import math
x = math.ceil(A/0.08)
x_1 = math.ceil((A+1)/0.08 )
y = math.ceil(B/0.1)
y_1 = math.ceil( (B+1)/0.1 )

x_2 = {i for i in range(int(x),int(x_1) ) }
y_2 = {i for i in range(int(y),int(y_1) ) }
moto_nedan = x_2 & y_2
if len(moto_nedan) == 0:
    print("-1")
else:
    print(min(moto_nedan))

Solution (Python):


from math import ceil

def check(a, b, x):
    if int(x * 0.08) != a or int(x * 0.1) != b:
        return -1
    return x

def prob_c(a, b):
    yasu = ceil(a * 100 / 8)
    taka = ceil(b * 100 / 10)
    ans = int(check(a, b, max(yasu, taka)))
    print(ans)

if __name__ == '__main__':
    a, b = map(int, input().split())
    prob_c(a,b)

Solution (Python):
tax8, tax10 = map(int,input().split())
import math

tax10_list = []
list = []
count = 0

for i in range(10):
    tax10_list.append(math.floor(tax10*10+i))

for x in range(10):
    if math.floor(tax10_list[x] * 0.08) == tax8:
        print(tax10_list[x])

        break
    else:
        count += 1

if count == 10:
    print("-1")
else:
    None

Solution (Python):
def C158():
    A, B = [int(_) for _ in input().split()]
    N = 1
    while N <= 10000:
        if int(N * 8/100) == A and int(N * 10/100) == B:
            break
        N += 1
    if N <= 10000:
        print(N)
    else:
        print(-1)
        
if __name__ == "__main__":
    C158()

Solution (Python):
from math import ceil,floor
def tax(a, b):
    mina, maxa = a/0.08, (a+1)/0.08
    minb, maxb = b/0.1, (b+1)/0.1
    if(mina >= maxb or minb >= maxa): return -1

    return max(ceil(mina), ceil(minb))

a, b= map(int, input().strip().split())
print(tax(a, b))

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

Solution (Python):
A, B = map(int, input().split())
notax = [int((B + i / 10) * 10) for i in range(10)]

for val in notax:
  if int(val * 0.08) == A:
    print(val)
    exit()
    
print(-1)

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

if(a%2==0):
  y1=[a*12.5,(a+1)*12.5]
else:
  y1=[a*12.5+0.5,(a+1)*12.5]  

y2=[b*10,(b+1)*10]

if(y1[0]<=y2[0] and y2[0]<y1[1]):
  print(int(y2[0]))
elif(y2[0]<=y1[0] and y1[0]<y2[1]):
  print(int(y1[0]))
else:
  print("-1")

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

ansA = set(range(math.ceil(A/0.08), math.ceil((A+1)/0.08)))
ansB = set(range(math.ceil(B/0.10), math.ceil((B+1)/0.10)))

if ansA & ansB:
    print(min(ansA & ansB))
else:
    print(-1)

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

x1 = math.ceil(a / .08)
b1 = math.floor(x1 * .1)

x2 = math.ceil(b / .1)
a1 = math.floor(x2 * .08)

if(b==b1):
    print(x1)
elif (a == a1):
    print(x2)
else:
    print(-1)

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

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

Solution (Python):
a,b=map(int,input().split())
answer=False
for i in range(1,1009):
    if int(i*0.08)==a and int(i*0.10)==b:
        print(i)
        answer=True
        break
if not answer:
     print("-1")

Solution (Python):
import math
a,b=map(int,input().split())
answer=False
for i in range(1,1009):
    if math.floor(i*0.08)==a and math.floor(i*0.10)==b:
        print(i)
        answer=True
        break
if not answer:
    print(-1)

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

ans = -1
for i in range(1, 1250):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
        ans = i
        break

print(ans)

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

for i in range(1001):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        break

else:print(-1)

Solution (Python):
P8, P10 = map(int, input().split())


import math
price1_min = math.ceil(P8/0.08)

price1_max = math.floor((P8+1)//0.08)

price2_min = math.ceil(P10/0.10)

price2_max = math.floor((P10+1)//0.10)



if (price1_max >= price2_min) and (price2_max >= price1_min):
    print(max(price2_min, price1_min))
else: 
    print(-1)

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

ans = -1
for i in range(1001):
  if int(i*0.08)==a and int(i*0.10)==b:
    ans = i
    break

print(ans)

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

Solution (Python):
import math
A,B = (int(x) for x in input().split())
A1 = math.ceil(A/0.08)
A2 = math.ceil((A+1)/0.08)

"""if float((A+1)/0.08).is_integer() == True:
    A2 = math.floor((A+1)/0.08)
else:
    A2 = math.floor((A+1)/0.08) + 1
"""
B1 = math.ceil(B/0.1)
B2 = math.ceil((B+1)/0.1)

"""if float((B+1)/0.1).is_integer() == True:
    B2 = math.floor((B+1)/0.1)
else:
    B2 = math.floor((B+1)/0.1) + 1
"""
a = range(A1, A2)
b = range(B1, B2)
c = set(a) & set(b)
if len(c) == 0:
          print(-1)
else:
          print(min(c))

Solution (Python):
a, b = map(int, input().split())
n = b * 10 + 10
for i in range(n):
	if int(i * 0.08) == a and int(i * 0.1) == b:
		print(i)
		break
else:
	print(-1)

Solution (Python):
def cal1(x):
    c=int(x/0.08)
    if x*100%8==0:
        return c 
    else:
        return c+1
      
def cal2(x):
    c=int(x/0.1)
    return c
      
A,B=map(int,input().split())
a,b,c,d=cal1(A),cal1(A+1)-1,cal2(B),cal2(B+1)-1

if  b<c or d<a:
    print("-1")
else:
    print(max(a,c))

Solution (Python):
A,B = map(int, input().split())
T = max(25*A, 20*B)

if 25*A >= 20*(B+1) or 25*(A+1)<=20*B:
    print(-1)
else:
    print(T//2 + T%2)

Solution (Python):
import sys

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

for i in range(10000):
    if i*8//100==a and i*10//100==b:
        print(str(i)+'\n')
        sys.exit()

print("-1\n")

Solution (Python):
import math
A,B = (int(x) for x in input().split())
A1 = math.ceil(A/0.08)
Ab = (A+1)/0.08
if float(Ab).is_integer() == True:
    A2 = math.floor(Ab)
else:
    A2 = math.floor(Ab) + 1
B1 = math.ceil(B/0.1)
Bb = (B+1)/0.1
if float(Bb).is_integer() == True:
    B2 = math.floor(Bb)
else:
    B2 = math.floor(Bb) + 1
a = range(A1, A2)
b = range(B1, B2)
c = set(a) & set(b)
if len(c) == 0:
          print(-1)
else:
          print(min(c))

Solution (Python):

"""
Spyderエディタ

これは一時的なスクリプトファイルです。
"""
import math

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

alpha = []
beta = []

for x in range(math.floor(a/0.08), math.floor(a/0.05)):
    if math.floor(x * 0.08) == a:
        alpha.append(x)
for y in range(math.floor(b/0.10), math.floor(b/0.05)):
    if math.floor(y * 0.1) == b:
        beta.append(y)

if min(alpha) in beta:
    print(min(alpha))
elif min(beta) in alpha:
    print(min(beta))
else:
    print("-1")

Solution (Python):
from math import floor, ceil

a, b = map(int, input().split())
for i in range(ceil(a / 0.08), ceil(b/0.1)+10):
    if floor(i*0.08) == a and floor(i*0.10) == b and i >= 1:
        print(i)
        break
else:
    print('-1')

Solution (Python):
from math import floor
from sys import exit, stdin
A, B = [int(_) for _ in stdin.readline().rstrip().split()]
for i in range(1, 10000):
    if floor(i*0.08) == A and floor(i*0.1) == B:
        print(i)
        exit()
print(-1)

Solution (Python):
import math
A,B = (int(x) for x in input().split())
A1 = math.ceil(A/0.08)
if float((A+1)/0.08).is_integer() == True:
    A2 = math.floor((A+1)/0.08)
else:
    A2 = math.floor((A+1)/0.08) + 1
B1 = math.ceil(B/0.1)
if float((B+1)/0.1).is_integer() == True:
    B2 = math.floor((B+1)/0.1)
else:
    B2 = math.floor((B+1)/0.1) + 1
a = range(A1, A2)
b = range(B1, B2)
c = set(a) & set(b)
if len(c) == 0:
          print(-1)
else:
          print(min(c))

Solution (Python):
def tax(A,B):
    for i in range(1, 800001):
        t1=int(i*0.08)
        t2=int(i*0.1)
        if t1 == A:
            if t2 == B:
                return i
        

if __name__ == "__main__":
    A, B = input().split()
    A = int(A)
    B = int(B)
    i=tax(A,B)
    if i == None:
        print("-1")
    else:
        print(i)

Solution (Python):
A, B = list(map(int, input().split()))
ans = -1
for i in range(1, 1010):
    a = int(i * 0.08)
    b = int(i * 0.1)
    if a == A and b == B:
        ans = i
        break
print(ans)

Solution (Python):
import math

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

ans_b_min = b * 10
ans_b_list = []
for i in range(0, 10):
    ans_b_tmp = ans_b_min + i
    ans_b_list.append(ans_b_tmp)
    

for ans_b in ans_b_list:
    if int(math.floor(ans_b * 0.08)) == a:
        print(ans_b)
        exit(0)

print(-1)

Solution (Python):
a,b = map(int,input().split())
tmp=0
for i in range(a+b,1250):
    x=i*0.08
    y=i*0.1

    if int(x)==a and int(y)==b:
        print(int(i))
        tmp=1
        break
if tmp==0:
    print(-1)

Solution (Python):
A, B = map(int,input().split())
ans = -1

for i in range(1,10000):
    a = int(i * 0.08)
    b = int(i * 0.1)
    
    if a == A and b == B:
        ans = i
        break

print(ans)

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

ans = b * 10
status = ''
for i in range(10):
  8*(ans + i)//100
  if(a == 8*(ans + i)//100):
    ans += i
    status = 'ok'
    break;

if status =='ok':
  print(ans)
  
else:
  print(-1)

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

Solution (Python):
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


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

main()

Solution (Python):
import math

def per8_and_per10(n, a, b):
  per8  = n * 0.08 
  per10 = n * 0.1
  if a <= f01_rounding(per8) < a+1 and b <= f01_rounding(per10) < b+1:
    return True
  else:
    return False

def f01_rounding(number):
  number_str = list(str(number))
  number_str_slice = "".join(number_str[:(number_str.index("."))])
  number_int = int(number_str_slice)
  return number_int

a, b = map(int, input().split())
for i in range(1,1010):

  if per8_and_per10(i, a, b):
    print(i)
    exit()
print(-1)

Solution (Python):
from math import ceil,floor

numA,numB = map(int,input().split())
for i in range(10000):
  testA = floor(i * 0.08)
  testB = floor(i * 0.10)
  if testA == numA and testB == numB:
    print(i)
    break
else:
  print("-1")

Solution (Python):
import math
n,m = map(int,input().split())
if (n+1)/0.08 > m/0.1 and (m+1)/0.1 > n/0.08:
    print(max(math.ceil(n/0.08),math.ceil(m/0.1)))
else:
    print(-1)