peterverebics/CodeNet_Python_118 huggingface dataset:
A,B = (int(x) for x in input().split())
for i in range(1,101):
    Ahan = int(i * 0.08)
    Bhan = int(i * 0.10)
    if (Ahan == A and Bhan == B):
        print(i)
        break
print(-1)
a, b = map(int, input().split())
ll = []
for i in range(1,116):
    if int(i*0.08) == a and int(i*0.1) == b:
        ll.append(i)
    else:
        pass
if len(ll) != 0:
    print(ll[0])
else:
    print(-1)
import math

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

for n in range(0, 10):
  for m in range(0, 10):
    if math.floor((A + n/10) / 0.08) == math.floor((B + m/10) / 0.1):
      #print(math.floor((B+m/10)/0.1))
      results.append(math.floor((B+m/10)/0.1))
if len(results) != 0:
  print(min(results))
  exit()
print("-1")
a,b = map(int,input().split())
# 8% -> [a,a+1)
# 10% -> [b,b+1)
# max(a*100/8, b*10) <= 元の価格 < min((a+1)*100/8, (b+1)*10)
min8 = a*(100/8)
max8 = (a+1)*(100/8)
min10 = b*10
max10 = (b+1)*10
mi = int(max(min8, min10) - 0.001)
ma = int(min(max8, max10))
if mi >= ma:
    ans = -1
else:
    ans = mi + 1
print(ans)
A, B = (int(i) for i in input().split())  
A_p_min = A/0.08
A_p_max = (A+1)/0.08
B_p_min = B/0.1
B_p_max = (B+1)/0.1
cnt = -1
for i in range(int(A_p_max)-1,int(A_p_min)-1,-1):
    #print(i)
    for j in range(int(B_p_max)-1,int(B_p_min)-1,-1):
        if i == j:
            cnt = i
print(cnt)
import math
def ccc(a, b):

    for i in range(1, 101):
        an = math.floor(i * 0.08)
        bn = math.floor(i * 0.1)
        if an == a and bn == b:
            return i
    return "-1"

def main():
    a , b = map(int , input().split())
    print(ccc(a , b))

if __name__ == '__main__':
    main()
#Atcoder 158 class
A,B = list(map(int,input().split()))
z=1
for x in range(int(25*A/2),int(25*(A+1)/2)):
    for y in range(int(10*B),int(10*(B+1))):
        if x==y:
            print(x)
            break
        else:
            z += 1
    if x==y:
        break
if z==(int(25*(A+1)/2)-int(25*A/2))*(int(10*(B+1))-int(10*B)):
    
    print(-1)
A,B=map(int,input().split())
S=set(range(25*A//2,25*(A+1)//2))&set(range(10*B,10*(B+1)-1))
print(S.pop() if len(S)>0 else -1)
a,b=map(int,input().split())
for i in range(1,101):
  if int(0.08*i)==a and int(0.10*i)==b:
    print(i)
    exit()
print(-1)
A, B = map(int, input().split())

a_min = int(A / 0.08)
a_max = int((A+1) / 0.08)
#print(a_min, a_max)

b_min = int(B / 0.1)
b_max = int((B+1)/0.1)
#print(b_min, b_max)

for i in range(a_min, a_max+1):
    if b_min <= i <= b_max:
        print(i)
        exit()

print(-1)
import math
A,B=(int(x) for x in input().split())

a=math.floor(A/0.08)
b=math.floor(B/0.1)
out =0
if a>=b:
    if math.floor(a*0.1) != B:
        out = -1
    else:
        out = a
elif a<b:
    if math.floor(b*0.08) != A:
        out = -1
    else:
        out = b
print(out)
import math
A, B = map(int, input().split())
flag = math.floor(A/0.08)
flag2 = math.floor(B/0.1)
if math.floor(flag*0.1)==B:
  print(flag)
elif math.floor(flag2*0.08)==A:
  print(flag2)
else:
  print(-1)
import math

a,b = map(int,input().split())
min_x_a = math.floor(a / 0.08)
max_x_a = math.floor((a+1) / 0.08)

min_x_b = math.floor(b / 0.1)
max_x_b = math.floor((b+1) / 0.1)

length_a = max_x_a - min_x_a + 1
list_a = [ min_x_a + i for i in range(length_a)]

length_b = max_x_b - min_x_b + 1
list_b = [ min_x_b + i for i in range(length_b)]

results = set(list_a) & set(list_b)

if len(results) == 0:
  print(-1)
else:
  print(min(results))
a,b = map(int, input().split())

a_min = a/0.08
a_max = (a+1)/0.08
b_min = b/0.1
b_max = (b+1)/0.1

if a_min <= b_min:
    if b_min < a_max:
        print(int(b_min))
    else:
        print('-1')
else:
    if a_min < b_max:
        print(int(a_min))
    else:
        print('-1')
A, B = map(int, input().split())

for n in range(2000):
    if int(n * 0.08) == A and int(n * 0.1) == B:
        print(n)
        break
a,b = map(int,input().split())
a_min = int(a/0.08)
a_max = int((a+1)/0.08)
b_min = int(b/0.1)
b_max = int((b+1)/0.1)
if a_min >= b_min and a_min <= b_max:
    print(int(a_min))
elif b_min >= a_min and b_min <= a_max:
    print(int(b_min))
else:
    print(-1)
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)
a,b = map(int,input().split())
b *= 10
ans = 0

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

print(ans)
#!/usr/bin/env python3

def main():
    A, B = map(int, open(0).read().split())

    ans_A = []
    for i in range(int(12.5 * A), int(12.5 * A + 12.5 + 1)):
        ans_A.append(i)
    ans_B = []
    for i in range(int(10*B), int(10*B + 10 + 1)):
        ans_B.append(i)
    ans = set(ans_A) & set(ans_B)
    if len(ans) == 0:
        print(-1)
    else:
        print(min(list(ans)))


main()
import math
a,b = map(int,input().split())
res = -1
for x in range(1, 1251):
    if math.ceil(x/0.08)==a and math.ceil(x/0.1)==b:
        res = x
        break
print(res)
def main():
  a,b=map(int,input().split())
  for i in (int(a/0.08),int((a+1)/0.08)):
    if int(i*0.1)==b:
      return i
  return -1
print(main())
A, B = map(int, input().split())

e = (A*100)//8
t = B*10

ee = e
tt = t
# while True:
#   ee -= 1
#   if (ee*8)//100 == A:
#     continue
#   else:
#     ee += 1
#     break

if ee < t:
  startval = t
  stopval = ee
else:
  startval = ee
  stopval = t

ans = 0
if ee != t:
  for ii in range(startval,stopval,-1):
    if (ii * 10)//100 == B and (ii * 8)//100 == A:
      ans = ii
else:
  ans = ee
if ans == 0:
  ans = -1
print(ans)
a,b = map(int,input().split())
# 8% -> [a,a+1)
# 10% -> [b,b+1)
# max(a*100/8, b*10) <= 元の価格 < min((a+1)*100/8, (b+1)*10)
min8 = a*(100/8)
max8 = (a+1)*(100/8)
min10 = b*10
max10 = (b+1)*10
mi = int(max(min8, min10) - 0.01)
ma = int(min(max8, max10))
if mi >= ma:
    ans = -1
else:
    ans = mi + 1
print(ans)
a=input()
(n,m)=a.split(" ")
n=int(n)
m=int(m)
k=n/0.08
k=int(k)
l=int(k*0.08)
j=m/0.1
j=int(j)
o=int(j*0.1)
if l==n and o==m:
    print(k)
else:
    print("-1")
a, b = map(int, input().split())

A = int(-(-(a + 1) / 0.08))
B = int(-(-(b + 1) / 0.1))
s = int(a / 0.08)
t = int(b / 0.1)
n = int(-(-(a + 1) // 0.08) - s)
re = 0

for i in range(n):
    if t <= s + i < B:
        re = s + i
        break


if re != 0:
    print(int(re))
else:
    print(-1)
A, B = map(int, input().split())

ans = []

for i in range(0, 10):
    for j in range(0, 10):
        a = A + (0.1 * i)
        b = B + (0.1 * j)
        a = a * 12.5
        b = b * 10
        #print(a, b)
        if int(a) == int(b):
            ans.append(int(a))
#print(ans)
print(min(ans)) if ans else print(-1)
A, B = map(int, input().split())

at = int(A/0.08)
bt = int(B/0.1)
if at == bt:
    print(at)
    exit()

for i in range(min(at, bt), max(at, bt)):
    i += 1
    aa = int(i*0.08)
    bb = int(i*0.1)
    if aa == bb:
        print(i)
        exit()
print("-1")
tax_eight, tax_ten = map(int, input().split())
min_eight_price = tax_eight / 0.08
max_eight_price = (tax_eight + 1) / 0.08
min_ten_price = tax_ten * 10
max_ten_price = (tax_ten + 1) * 10
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))
import math
a,b=map(int,input().split())
b*=10
ans=0

for i in range(8):
    j=b
    j+=i 
    if int(j*0.08)==a:
        ans=j
        break
if ans!=0:
    print(ans)
else :
    print(-1)
import math

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

x = B * 10
ans = -1
for i in range(x, int(B / 0.08) + 11):
    y = math.floor(i * 0.08)
    if y == A:
        ans = i
        break
print(ans)
a, b = map(int,input().split())
a_list = []
b_list = []
flag = 0

for i in range(1,101):
    if int(i*1.08)-i == a:
        a_list.append(i)

for j in a_list:
    if int(j*1.1)-j == b:
        print(j)
        flag = 1
        break

if flag != 1:
    print('-1')
import sys
A,B = map(int,input().split())
if A<13:
  print(-1)
  sys.exit()
last = 2000

for i in range(last):
  mA = int(i*0.08)
  mB = int(i*0.10)
  print(mA,mB,i)

  
  if mA==A and mB==B:
    print("match")
    print(i)
    break
  if i==last-1:
    print("-1")
import math
a=input().split()
A,B=int(a[0]),int(a[1])
p=math.floor(A/0.08)
if(math.floor(p*0.1)==B):
  print(p)
else:
  print(-1)
import math
a, b = list(map(int, input().split(' ')))

al = math.ceil(a / 0.08)
ar = math.floor((a + 1)/ 0.08) + 1

bl = math.ceil(b / 0.10)
br = math.floor((b + 1)/ 0.10) + 1

ae = list(range(al, ar))
be = list(range(bl, br))

ee = set(ae) & set(be)
if len(ee) == 0:
    print(-1)
else:
    print(min(ee))
import math as m
a,b=map(int,input().split())
flag=True
for i in range(1,101):
    if m.floor(i*(0.08))==a and m.floor(i*(0.08))==b:
        flag=False
        print(i)
        break
if flag:
    print(-1)
import math

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

blueA = math.floor(((blue) / 8) * 100)
blueB = math.floor(((blue+1) / 8) * 100)

redA = math.floor((red / 10) * 100)
redB = math.floor(((red+1) / 10) * 100)

if blueA <= redA:
    if blueB >= redA:
        print(redA)
    else:
        print("-1")
else:
    if redB >= blueA:
        print(blueA)
    else:
        print("-1")
A,B = map(int,input().split())

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

c1 = ( A / 0.08 ) ;
c2 = ( (A+1) / 0.08 ) ;
c3 = int ( c2 ) ;

if c2 == c3 :
	c3 = c3 -1 ; 

d1 = ( B / 0.10 ) ;
d2 = ( (B+1) / 0.10 ) ;
d3 = int ( d2 ) ;

if d2 == d3 :
	d3 = d3 -1 ; 

if d3 < c1 or c3 < d1  :
	print ( -1 );
else :
	print ( int ( max ( c1  ,d1 ) ) ) ;
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    A, B = map(int, input().split())
    result = int(max(A / 0.08, B / 0.1))
    if int(result * 0.08) == A and int(result * 0.1) == B:
        print(result)
    else:
        print(-1)


if __name__ == "__main__":
    main()
import math
A, B = map(int, input().strip().split())

Amin=math.floor(A/0.08)
Amax=math.floor((A+1)/0.08)
if (A+1)%1.08==0:
    Amax-=1

Bmin=B*10
Bmax=(B+1)*10
if (B+1)%0.1==0:
    Bmax-=1

ans=-1
flag=False
for a in range(Amin,Amax+1):
    for b in range(Bmin,Bmax+1):
        if a==b:
            ans=a
            flag=True
            break
    if flag:
        break
print(ans)
from math import floor, ceil

# 25a<=p<25(a+1)
# 10b<=p<10(b+1)
# also p must be integer, so the valid range
# must lie around at least one integer value

a, b = map(int, input().split())
inclusive_min = max(12.5*a, 10*b)
exclusive_max = min(12.5*(a+1), 10*(b+1))
if floor(exclusive_max) >= ceil(inclusive_min):
  print(ceil(inclusive_min))
else:
  print(-1)
import math
a, b = map(int, input().split())

for i in range(1010):
    tax8 = math.floor(a * 0.08)
    tax10 = math.floor(a * 0.1)

    if a == tax8 and b == tax10:
        print(i)
        exit()

print(-1)
import math

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

a_low = math.ceil(a/0.08)
a_high = math.floor((a+1)/0.08)

b_low = math.ceil(b/0.1)
b_high = math.floor((b+1)/0.1)

if a_high<b_low or b_high<a_low:
  print(-1)
else:
  print(max(a_low, b_low))
A,B=map(int,input().split())
miA=-(-A//0.08)
maA=-(-(A+1)//0.08)-1
miB=-(-B//0.1)
maB=-(-(B+1)//0.1)-1
if max(miA,miB)<=maA and max(miA,miB)<=maB:
  print(max(miA,miB))
else:
  print(-1)
A, B = map(int, input().split())

la = A/0.08
ra = (A+1)/0.08
lb = B/0.1
rb = (B+1)/0.1

ans = max(la, lb)
if ra <= lb or rb <= la:
  print(-1)
else:
  print(int(ans))
import math

a, b = list(map(int, input().split()))
result = -1
end_flag = False
for i in range(1, 101):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 101):
                y = math.floor(j * 0.1)
                if int(y) == b:
                    result = i
                    end_flag = True
                    break


print(result)
a, b = (float(x) for x in input().split())

a_list = []
b_list = []


def f(n, tix, list):
    limit = n + 1
    while(n < limit):
        list.append(round(n / tix, 1))
        n += 0.1


f(a, 0.08, a_list)
f(b, 0.1, b_list)

a_set = set(a_list)
b_set = set(b_list)

c_set = a_set & b_set

if(len(c_set) == 0):
    print(-1)
else:
    print(int(min(c_set)))
A, B = list(map(int, input().split()))

VA = int(A / 0.08)
VB = int(B / 0.1)

if VB < VA:
    x = (VA * 0.1)//1
    #print('VA', x)
    if x == B:
        print(VA)
    else:
        print('-1')
            
elif VA < VB:
    x = (VB * 0.8)//1
    #print('VB', x)
    if x == A: print(VB)
    else:
        print('-1')
else:
    print(VA)
A, B = map(int, input().split())

x_min = A * 12.5
if x_min.is_integer:
  x_min = int(x_min)
else:
  x_min = int(x_min) + 1

x_max = int((A + 0.99) * 12.5)

ans = -1
for n in range(x_min, x_max + 1):
  if n // 10 == B:
    ans = n
    break

print(ans)
import math
A, B = list(map(int, input().split(' ')))
a = 0.08
b = 0.10

x_min = math.floor((A-1) / a) +1
x_max = math.ceil((A+1) / a)
y_min = math.floor((B-1) / b) +1
y_max = math.ceil((B+1) / b)

X = set(range(x_min, x_max))
Y = set(range(y_min, y_max))

r = X & Y
R = min(r) if len(r) > 0 else -1
if len(r) == 1 and R == 0:
  R = -1
  
print(R)
n=list(map(int,input().split()))
import math
A=math.ceil(n[0]/0.08)
B=math.ceil(n[1]/0.1)
C=math.ceil(n[1]+1/0.1)
D=math.ceil(n[0]+1/0.08)
print(A)
print(B)
if A==B or B<<A<<C:
    print(A)
elif A<<B<<D:
    print(B)
else:
    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, cnt):
  ans = (i * 0.1)//1
  #print(i ,ans)
  if ans == b:
    print(i)
    exit()
print(-1)
a,b = map(int, input().split())

if int(a*1.25)==b:
  print(int(a/0.08))
else:
  print(-1)
A, B = map(int, input().split())

min_8 = A * 100 // 8
max_8 = max(((A + 1) * 100 // 8) - 1, min_8)
min_10 = B * 100 // 10
max_10 = max((B  + 1) * 100 // 10 - 1, min_10)

if (A > B):
    print(-1)
    exit()

if (max_10 < min_8 or max_8 < min_10):
    print(-1)
    exit()

print(max(min_8,min_10))
from math import ceil,floor
out = []

numA,numB = map(int,input().split())
for i in range(101):
  testA = floor(i * 0.08)
  testB = floor(i * 0.10)
  if testA >= numA and testB >= numB:
    out.append(i)

if len(out) == 0:
  print("-1")
else:
  print(min(out))
'''input
19 99
'''
import math

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

a_low = int((a + 0.0) / 0.08)
a_hig = int((a + 0.9) / 0.08)

b_low = int((b + 0.0) / 0.1)
b_hig = int((b + 0.9) / 0.1)

if b_low <= a_low and a_low <= b_hig:
    print(a_low)
    exit()

if a_low <= b_low and b_low <= a_hig:
    print(b_low)
    exit()

print(-1)
a,b = map(int, input().split())
A = round(a/8*100)
B = b*10
ans = float("INF")
for i in range(min(A,B), max(A,B)+1):
  if int(i*0.08) == a and int(i*0.1) == b:
    if ans > i: ans = i
print(ans if ans != float("INF") else -1)
import math

def main():

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

    p = a / 0.08

    if math.floor(p * 0.1) == b:
        print(math.ceil(p))
    else:
        print(-1)

if __name__ == '__main__':
    main()
A, B = map(int, input().split())
for i in range(1001):
    if (i*8//100) == A and (i * 10//100) == B:
        print(i)
        break
    else:
        print("-1")
a, b = map(int, input().split())

if b-a >= 2 :
    if b/a > 1.25 :
        cst = -1
    else :
        cst = int((b-a)/0.02)

else :
    cst_a = a / 0.08
    cst_b = b / 0.1
    cst = int(cst_a)

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

for i in range (1251):
  if int(i*0.08)==a and int(i/10)==b:
    print(i)
  
print(-1)
import sys
import math
# input処理を高速化する
input = sys.stdin.readline

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

Moneys = range(1,1000)

#消費税が入力と一致したインデックス
a_index=set()
b_index=set()

for i in Moneys:
    if math.floor(i*0.08) == A:
        a_index.add(i)

for j in Moneys:
    if math.floor(j*0.1) == B:
        b_index.add(j)

Tax = a_index&b_index

if len(Tax)!=0:
    print(min(list(Tax)))
else:
    print(-1)
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)
import math
a,b = [float(i) for i in input().split()]

for i in range(1,100000):
    ans8 = int(math.floor(i*0.08))
    ans10 = int(math.floor(i*0.1))
#     print(ans8,ans10)
    if ans8 == a and ans10 == b:
        print(i)
        break
    elif i == 100:
        print(-1)
import math
A,B=map(int,input().split())
x=int(A/0.08)
y=int(B/0.1)
eight=[x]
ten=[y]
while int(x*0.08)==A:
    x+=1
    eight.append(x)
while int(y*0.1)==B:
    y+=1
    ten.append(y)
eight_set=set(eight)
ten_set=set(ten)
ans_set=eight_set&ten_set
ans=list(ans_set)
if len(ans)>0:
    print(min(ans))
else:
    print(-1)
a,b=map(int,input().split())

mn=max(b*10,a*12.5)
if mn==a*12.5 and a%2==1:
    mn=int(mn)+1
mx=min((b+1)/0.1,(a+1)/0.08)
if mn<=mx:
    print(int(mn))
else:
    print(-1)
# C Tax Increase

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

a = [i for i in range(int(A*100/8), int((A+1)*100/8))]
b = [i for i in range(B*10, (B+1)*10)]

ans = list(set(a) & set(b))
if ans:
  print(min(ans))
else:
  print(-1)
a , b = map(int, input().split())
ans = -1
for i in range(1 , 10100) :
  a1 = int(i*0.08)
  b1 = int(i*0.10)
  if a1 == a and b1 == b :
    ans = i
    break
print(i)
import math
A, B = map(int, input().split())
a1 = math.ceil(A*100/8)
a2 = math.ceil((A+1)*100/8)
b1 = B*10
b2 = b1 + 10

if a2 < b1 or b2 < a1:
    print(-1)

elif a1 < b1:
    print(b1)

else:
    print(a1)
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)
else:
  print('-1')
A, B = map(int, input().split())

min_price_A = A * 12.5
max_price_A = min_price_A + 12

min_price_B = B * 10
max_price_B = min_price_B + 9

if min_price_A <= min_price_B:
    if max_price_A >= min_price_B:
        print(int(min_price_B))
    else:
        print(-1)
if min_price_A > min_price_B:
    if max_price_B >= min_price_A:
        print(int(min_price_A))
    else:
        print(-1)
from math import floor

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

x1b = round(100 * A / 8)
x2b = round(10 * B)

x1t = floor(100 * (A + 1) / 8 - 0.0001)
x2t = floor(10 * (B + 1) - 0.0001)

if (x2b <= x1t and x1b <= x2t) or (x1b <= x2t and x2b <= x1t):
    print(max(x1b, x2b))
else:
    print('-1')
import math

inp = input().split(" ")
A, B = int(inp[0]), int(inp[1])

# print(int(A * 1/0.08))

possible = int(A * 1/0.08) // 10
# print(possible)

answer = []
for i in range(possible * 10, possible * 10 + 10):
  tax_a = int(i * 0.08)
  tax_b = int(i * 0.1)
  # print(tax_a, tax_b)
  if tax_a == A and tax_b == B:
    answer.append(i)

if len(answer) == 0:
  print(-1)
else:
  print(answer[0])
a,b=map(int,input().split())

a_min=a/0.08
b_min=b/0.1
a_max=(a+1)/0.08
b_max=(b+1)/0.1

if a_min>b_max or a_max<b_min:
    print(-1)
else:
    print(int(max(a_min,b_min)))
a,b=map(int, input().split())

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

for i in range(A,B+1):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        break
    if int(i*0.08) != a or int(i*0.1) != b:
        print('-1')
        break
A, B = map(int, input().split())
for i in range(20000):
    if int(i*0.08) == A and (i * 0.1) == B:
        print(i)
        exit()
print(-1)
import math
a,b = map(int,input().split())
p1 = a // 0.08
p2 = b // 0.1
ans = math.inf

if math.floor(p1 * 0.1) == b:
    ans = p1
if math.floor(p2 * 0.08) == a:
    ans = min(ans,p2)
if ans == math.inf:
    ans = -1
print(int(ans))
A, B = map(int, input().strip().split())

Amin=A*8//100
Amax=(A+1)*8//100
if (A+1)%0.08==0:
    Amax-=1

Bmin=B*10
Bmax=(B+1)*10
if (B+1)%0.1==0:
    Bmax-=1

ans=-1
flag=False
for a in range(Amin,Amax+1):
    for b in range(Bmin,Bmax+1):
        if a==b:
            ans=a
            flag=True
            break
    if flag:
        break
print(ans)
import sys
import math

str = input() # input()で入力を受け取り、それを変数strに代入
#print(str)
#print(str.split(' '))

ary = str.split(' ')
A = int(ary[0])
B = int(ary[1])

#print(A)
#print(B)

X1 = math.ceil(A / 0.08)
X2 = math.ceil(B / 0.1)

#print(X1)
#print(X2)

#print(X1 if X1 < X2 else X2)

if X1 != X2:
  print('-1')
else:
  print(X1 if X1 < X2 else X2)
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)
a, b = map(int, input().split())
for i in range(1,1001):
	if i * 8 == a * 100 and int(i * 0.1) == b:
		print(i)
		break
else:
	print(-1)
import math
A,B=map(int,input().split())
sup=min((A+1)/1.08,(B+1)/1.1)
inf=max(A/1.08,B/1.1)
inf2=math.ceil(inf)
if inf2<sup:
  print(inf2)
else:
  print(-1)
cmin = lambda a,b : a if a<b else b
cmax = lambda a,b : a if a>b else b
iin = lambda : int(input())
lin = lambda : list(map(int,input().split()))
rin = lambda n : [int(input()) for _ in range(n)]

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

at = []
for i in range(1,1500):
    if int(i*0.08)==a: at += [i]

bt = []
for i in range(1,1000):
    if int(i*0.1)==b: bt += [i]

ans = set(at) & set(bt)
print(min(ans) if ans else -1)
a, b = map(int, input().split())

x = int(a / 0.08)

ans = -1
for i in range(14):
    if (int((x+ i) * 0.1)) == b:
        if int((x + i) * 0.08) == a:
            ans = int(x + i)
        break

print(ans)
a,b = map(int, input().split())
ls = [b*10+i for i in [0,1,2,3,4,5,6,7,8,9]]
t = 0
for x in ls:
    if a*100/8 == x:
        print(x)
        break
    else:
        t += 1
        
if t == 10:
    print(-1)
# 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)
from math import floor
a, b = map(int, input().split())

for i in range(200):
    x = floor(i * 0.08)
    y = floor(i * 0.1)
    if x == a and y == b:
        print(i)
        exit(0)

print(-1)
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

a, b = input_nums()

a_rate = 0.08
b_rate = 0.1

al = a / a_rate
ar = (a+1) / a_rate
bl = b / b_rate
br = (b+1) / b_rate

ans = 0
if bl <= al and al < br:
    ans = int(al)
elif bl <= ar and ar < br:
    ans = int(bl)
elif al <= bl and br <= ar:
    ans = int(bl)
else:
    ans = -1

if int(ans*0.08) < a:
    ans += 1
print(ans)
from math import floor
A, B = map(int, input().split())
N = -1
for i in range(1, 101):
  if (floor(i * 0.08) == A and floor(i * 0.10) == B):
    print(i)
    exit(0)
print(N)
# -*- coding: utf-8 -*-
a, b, = map(int, input().split())
p = (a*100)/8
py = int(a)+1
pa = int(p)
q = (b*100)/10
pz = int(b)-1
pb = int(q)
if (py*100)/8<(pz*100)/10:
  print("-1")
else:
  if pa>=pb:
    print(pa)
  else:
    print(pb)
a, b = map(int, input().split())

judge = True
for i in range(1,1000):
    if 0.08*i//1 == a and 0.1*i//1 ==b:
        print(i)
        judge = False
        break

if judge:
    print(-1)
def main():
    A, B = [int(x) for x in input().split()]
    max_b = (B+1) * 10 - 1
    min_b = (B-1) * 10 + 1
    for num in range(min_b, max_b + 1):
        val = int(num * 0.08)
        if val == A:
            print(num)
            return
        elif val > A:
            print(-1)
            return
    print(-1)

if __name__ == "__main__":
    main()
def main():
    a, b = map(int, input().split())
    x = int(a / 0.08)
    y = int(b / 0.10)
    if int(x * 0.10) == b:
        print(x)
    else:
        print('-1')


if __name__ == "__main__":
    main()
from math import ceil

def main():
    a, b = map(int, input().split())
    p8_l = ceil(a / 0.08)
    p8_h = ceil((a+1) / 0.08)
    p10_l = int(b / 0.10)
    p10_h = int((b+1) / 0.10) - 1
    if p8_h >= p10_h >= p8_l:
        print(p8_l)
    elif p8_l <= p10_l <= p8_h:
        print(p10_l)
    else:
        print(-1)
    
if __name__ == '__main__':
    main()