peterverebics/CodeNet_Python_118 huggingface dataset:
import math

c=list(map(int, input().split()))
A = c[0]
B = c[1]
able = 1

for i in range(1000):
  if math.floor(i * 0.08 == A ) and math.floor(i * 0.1 == B):
    print(i)
    able = 0
    
if able:
  print(-1)
import math
A, B = map(int,input().split())
minA = math.floor(A/0.08)
maxA = math.ceil((A+1)/0.08) -1
minB = math.floor(B/0.08)
maxB = math.ceil((B+1)/0.08) -1
if (minA>maxB) or (minB>maxA):
    print(-1)
else:
    print(max(minA,minB))
import math
A,B =list(map(int,input().split()))
fr = 0
for i in range(300):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        fr += 1
        break
if fr == 0:
    print(-1)
import sys
import math

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

downera = math.floor(100/8 * a)
uppera = math.floor(100/8 * (a+1))

downerb = 10 * b
upperb = 10 * (b+1)

#print(downera, uppera, downerb, upperb)
if uppera < downerb or upperb < downera:
    print("-1")
    sys.exit()
for i in range(downera, uppera):
    if i >= downerb and i < upperb:
        print(i)
        sys.exit()

print("-1")
A, B = map(int, input().split())
x1 = int(A * 100.0 / 8)
x2 = B * 10
y1 = int((A+1) * 100.0 / 8)
y2 = (B+1) * 10

r = -1
for p in range(max(x1,x2), min(y1,y2)):
    r = p
    break
print(r)
import math
a,b = map(int,input().split())
a1 = int(a/0.08)
b1 = int(b/0.1)
c = min(a1,b1)
while True:
	if math.floor(c*0.08) == a and math.floor(c*0.1) == b:
		print(c)
		break
	elif math.floor(c*0.08) != a and math.floor(c*0.1) != b:
		print(-1)
		break
	else:
		c+=1
# -*- coding: utf-8 -*-
import math
def main():
    A,B = map(int,input().split())
    ansA = math.floor(A/0.08)
    if math.floor(0.1*ansA) == B:
        print(ansA)
        return
    ansB = math.floor(B/0.1)
    if math.floor(0.08*ansB) == A:
        print(ansB)
        return
    print('-1') 


if __name__ == '__main__':
    main()
a,b=map(int,input().split())
c=[]
d=[]
if a % 2 == 0:
    s = int(100*a/8)
    t = int(100*(a+1)/8) + 1
else:
    s = int(100*a/8) + 1
    t = int(100*(a+1)/8) 
u = int(100*b/10) 
v = int(100*(b+1)/10) 
for i in range(s,t):
    c.append(i)
for j in range(u,v):
    d.append(j)
print(c)
print(d)
c_d = set(c) & set(d)
if (len(c_d)>0):
    print(min(c_d))
else:
    print(-1)
import math

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

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

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

f = math.floor
min8, max8 = f(a*12.5), f((a+1)*12.5)
min10, max10 = f(b*10), f((b+1)*10)

l8, l10 = list(range(min8, max8)), list(range(min10, max10))
s8, s10 = set(l8), set(l10)

ss = s8 & s10
print(min(ss) if len(ss) >0 else -1)
a,b = map(int, input().split())
ans = -1

for i in range(10**5):
    if (i*0.08) == a and (i*0.1):
        ans = i
        break

print(ans)
A,B=map(int,input().split())
A0= int(A / 0.08)
B0= int(B / 0.1)
if (A == A0*0.08) & (B == B0*0.1):
    print(A0)
else:
    print("-1")
A, B = map(int,input().split())
rangea = set(range(int(A/0.08),int((A+1)/0.08),1))
rangeb = set(range(int(B/0.10),int((B+1)/0.10),1))

intersection = rangea & rangeb

if len(intersection)==0:
  print(-1)
else:
  print(min(intersection))
a,b = map(int,input().split())
ans = -1
for x in range(b*10,(b+1)*10+1):
    if x*0.08 == a:
        ans = x
        break
print(ans)
import sys
a,b=map(int,input().split())
i=0
while i <= 100:

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

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

for i in range(10, 10001):
    x = (a * 100) // 8
    y = (b * 10) // 1
    if x <= y and y <= x+6:
        print(y)
        break
    elif y <= x and x <= y+8:
        print(x)
        break
    elif i == 1000:
        print(-1)
a,b = input().split()
a = int(a)
b = int(b)
c = 1

for i in range(99):
    d = c*0.08
    e = c*0.1
    d = int(d)
    e = int(e)
    if d == a and e == b:
        print(c)
        break
    elif c == 100:
        print('-1')
    else:
        c += 1
# coding: utf-8

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

x = int(A / 0.08)

y = int(B / 0.1)

result = max(x, y)

if x < y:
    print('-1')
else:
    print(result)
A, B = map(int,input().split())

one = A/0.08
two = (A+1)/0.08
three = B/0.1
four = (B+1)/0.1

print(one, two, three, four)


if two < three or one > four:
    kai = -1
if three <= one and one <= four <= two:
    kai = one
if one < three <=two:
    kai = three

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

X = math.floor(A/0.08)
Y = math.floor(B/0.1)

if X == Y:
	print(X)
else:
	if X > Y:
		if B == math.floor(Y * 0.08):
			print(Y)
		elif A == math.floor(X * 0.1):
			print(X)
		else:
			print(-1)
	else:
		if A == math.floor(X * 0.1):
			print(X)
		elif B == math.floor(X * 0.08):
			print(Y)
		else:
			print(-1)
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")
a, b = map(int, input().split())

tax008 = [int(a / 0.08), int((a + 1) / 0.08)]
tax010 = [int(b / 0.1), int((b + 1) / 0.1)]
min_value = max(tax008[0], tax010[0])
max_value = min(tax008[1], tax010[1])
if min_value >= max_value:
    print(-1)
else:
    print(min_value)
import numpy as np

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

a_low = int(a/0.08)
a_up = int((a+0.9)/0.08)
a_list = list(np.arange(a_low, a_up+1))

b_low = int(b/0.1)
b_up = int((b+0.9)/0.1)
b_list = list(np.arange(b_low, b_up+1))

#print(a_low)
#print(a_list)

#print(b_low)
#print(b_list)

if a_low in b_list:
  print(a_low)
elif b_low in a_list:
  print(b_low)
else:
  print('-1')
a,b=map(int,input().split())
c = a*100//8
d = (a+1)*100//8
e = b*100//10
f = (b+1)*100//10
for i in range(d-c):
  if c+i-1>=e and c+i-1<f:
    print(c+i-1)
    break
else:
  print(-1)
import sys
import math

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

c_A = math.floor(A/0.08)
c_B = math.floor(B/0.10)

#print(c_A, c_B)

if c_A == c_B:
    print(c_A)
    sys.exit()


mymin = min(c_A, c_B)
mymax = max(c_A, c_B)

for i in range(mymin, mymax+1):
    #print(i, math.floor(i*0.08),math.floor(i*0.10))
    if math.floor(i*0.08) == math.floor(i*0.10):
        print(i)
        sys.exit()
print(-1)
a=input()
(n,m)=a.split(" ")
n=int(n)
m=int(m)
k=n/0.08
j=m/0.1
if n==m:
 if k==j*1/0.8:
    print(int(k))
 else:
    print("-1")
else:
 if k==j:
     print(int(k))
 else:
     print("-1")
a, b = map(int, input().split())

if a/(b+1) < 0.8 and 0.8 < (a+1)/b:
    if a/b<0.8:
        print(int(10*b))
    else:
        print(int(12.5*a))
else:
    print(-1)
import math
A,B = map(int,input().split())
ans = 0
AT = 0.08
BT = 0.1

a = A/AT
b = B/BT
aPlus = (A+1)/AT
bPlus = (B+1)/BT

if a == b :
    ans = a
elif a < b :
    if aPlus < b :
        ans = -1
    else :
        ans = b
elif b < a :
    if bPlus < a :
        ans = -1
    ans = a

# print(a,b)
# print(aPlus,bPlus)
print(math.ceil(ans))
a,b =map(int,input().split())

for x in range(100):
 if x*1.08==a+x and x*1.10==b+x:
  print(x)
 else:
  print(-1)
import math
def main():
    A,B = map(int, input().split())
    # 税率rate%でtaxがA円となる税抜き価格xは、ceil(a*100/rate)<=x<ceil((a+1)*100/rate)を満たす
    min1 = math.ceil(A*100/8)
    max1 = math.ceil((A+1)*100/8)-1
    min2 = math.ceil(B*100/10)
    max2 = math.ceil((B+1)*100/10)-1
    ans = max(min1,min2) if not max1<min2 or max2<min1 else -1
    print(ans)


main()
a,b =map(int,input().split())
 
for x in range(1010):
 if (x*0.08*100)//1==a*100 and (x*0.10*100)//1==b*100 and x//1==int(x):
  print(int(x))
  exit()
  
print(-1)
a, b = map(int, input().split())

c = a + 1
d = b + 1

a = a // 0.08
c = c // 0.08

b = b // 0.1
d = d // 0.1

a, b, c, d = int(a), int(b), int(c), int(d)

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

else:
    for num1 in range (a+1, c-1):
        for num2 in range (b+1, d-1):
            if num1 == num2 :
                print(num1)
                break
        else:
            continue

        break
# -*- coding: utf-8 -*-
import math

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

temp_a1 = 100 * a // 8
temp_a2 = 100 * (a + 1) // 8
temp_b1 = 10 * b // 10
temp_b2 = (10 * (b + 1)) - 1

result = -1
for i in range(int(temp_a1), int(temp_a2)):
    if temp_b1 <= i <= temp_b2:
        result = i
        break

print(result)
A, B = map(int, input().split())
if 12.5* A < 10.0 * B:
  print(-1)
else:
  print(int(12.5*A))
from math import floor

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

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

x1t = floor(100 * (A + 0.99999) / 8)
x2t = floor(10 * (B + 0.99999))

print('%d %d' % (x1b, x1t))
print('%d %d' % (x2b, x2t))

if (x2b <= x1t and x1b <= x2t) or (x1b <= x2t and x2b <= x1t):
    print(max(x1b, x2b))
else:
    print('-1')
i = list(map(int,input().split()))
a = i[0]*100//8
b = i[1]*100//10
if -10 < a-b and a-b < 10:
  if a>b:
    print(a)
  else:
    print(b)
else:
  print(-1)
A, B = map(int, input().split())
price_a = int(A / 0.08)
price_b = int(B / 0.1)
if price_a == price_b:
  print(price_a)
  exit()
else:
  p1 = min(price_a, price_b)
  if int(p1 * 0.08) == int(p1 * 0.1):
    print(p1)
    exit()
  p2 = max(price_a, price_b)
  if int(p2 * 0.08) == int(p2 * 0.1):
    print(p2)
    exit()
print(-1)
A, B = map(int, input().split(' '))
for i in range(1, 1500):
    if i * 8 // 100 == A and i * 10 // 100 == B:
        print(i)
        break
A,B = [int(i) for i in input().split()]

x=A*12.5
y=B*10

if x>=y:
    print(int(max(x,y)))
else:
    print(-1)
import sys
a,b = map(lambda x: int(x),input().split())

a_tax_min = a* 12.5
b_tax_min = b * 10
a_tax_max = (a+1) * 12.5
b_tax_max = (b+1) * 10

if b_tax_min <= a_tax_min and a_tax_min <= b_tax_max and b_tax_max <= a_tax_max :
    if a_tax_min.is_integer() :
        print(int(a_tax_min))
    else :
        print(int(a_tax_min) + 1)
else :
    print(-1)
a,b=map(int,input().split())
tax8=a/2*25
tax8l=(a-1)/2*25
tax8h=(a+1)/2*25
tax10=float(b*10)
tax10l=float((b-1)*10)
tax10h=float((b+1)*10)
if tax10>tax8l and tax10<tax8h and tax8>tax10l and tax8<tax10h:
    print(max(int(tax8),int(tax10)))
else:
    print(-1)
import math
A, B = map(int,input().split())

UE_8 = (A+1)/0.08
SHITA_8 = A/0.08
UE_10 = (B+1)/0.10
SHITA_10 = B/0.10

if UE_8 < math.ceil(SHITA_10) or UE_10 < math.ceil(SHITA_8):
    print(-1)
else:
    i = math.ceil(SHITA_8)
    j = math.floor(UE_8)
    for n in range(int(i),int(j+1),1):
        if i < UE_10 and i >= SHITA_10:
            print(i)
            break
        i+=1
a,b=map(int,input().split())
x=12.5*a
y=12.5*(a+1)
z=10*b
w=10*(b+1)
import math
if math.ceil(x)<w:
    print(math.ceil(max(z,x)))
else:
    print(-1)
import math

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

min_A = math.ceil(A * 100 / 8)
max_A = math.floor((A + 1) * 100 / 8)
min_B = math.ceil(B * 100 / 10)
max_B = math.floor((B + 1) * 100 / 8)

if (min_A <= min_B and min_B <= max_A):
    ans = min_B
elif (min_B <= min_A and min_A <= max_B):
    ans = min_A
else:
    ans = -1

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

a = int(A*12.5)
b = B*10
ans = -1

if a < b:
    for i in range(a, b+2):
        if (int(i*0.1) == B) and (int(i*0.08) == A):
            ans = i

else:
    for i in range(b, a+2):
        if (int(i*0.1) == B) and (int(i*0.08) == A):
            ans = i

print(ans)
import math

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

A_s = math.floor(a / 0.08)
A_e = math.ceil((a+1) / 0.08)

B_s = math.floor(b / 0.1)
B_e = math.ceil((b+1) / 0.1)

ans = -1
for i in range(A_s, A_e + 1):
  for j in range(B_s, B_e + 1):
    if i == j:
      ans = i
      break
  if ans != -1:
    break
print(ans)
import math
a, b = map(int, input().split())

if a != b:
    x = (b-a) * 50
    if math.floor(x*0.08) == a and math.floor(x*0.10) == b:
        print(x)
    else:
        print(-1)
elif a == 1:
    print(13)
elif a == 2:
    print(25)
elif a == 3:
    print(38)
else:
    print(-1)
import math

a,b=map(int,input().split())
if a%2==0:
    s=a*12.5
    s=math.floor(s)
    if s-b*10==5:
        print(s)
    elif b*10-s==5:
        print(b*10)
    else:
        print("-1")
else:
    t=a*12.5 +0.5
    if t-b*10==3:
        t=math.floor(t)
        print(t)

    elif b*10-t==7:
        print(b*10)
    else:
        print("-1")
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(int(B*100/10), int((B+1)*100/10))]

ans = list(set(a) & set(b))
if ans and min(ans) > 0:
    print(min(ans))
else:
    print(-1)
# -*- coding: utf-8 -*-
import math

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

for numA in range(0,101):
	A1 = math.floor(numA * 0.08)
	for numB in range(0,101):
		B1 = math.floor(numB * 0.1)

		if A == int(A1) and B == int(B1) and int(numA) == int(numB):
			print(numA)
			exit()

print(-1)
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())

if(int(int(a / 0.08) * 0.1) == b):
    print(int(a / 0.08))
    exit()

print(-1)
flag =False
A, B = [int(x) for x in input().split()]
for x in range((A+1)*9,(B+1)*10+1):
  if A == x*8//100 and B == x//10:
    print(x)
    flag=True
    break
if not flag:
  print(-1)
A,B = [int(i) for i in input().split()]

for n in range(1,101):
  print(n)
  if int(n*0.08) == A and int(n*0.1) == B:
    print(n)
    exit()
print("-1")
import math
l1=input().split(" ")
t80=int(l1[0])
t100=int(l1[1])
t80_min=(t80/0.08)
t80_max=((t80+1)/0.08)
t100_min=(t100/0.1)
t100_max=((t100+1)/0.1)
if t80_max<t100_min:
    print("-1")
else:
    if t80_min<=t100_min:
        print(math.ceil(t100_min))
    else:
        print(math.ceil(t80_min))
a,b=map(int,input().split())
ans=-1
for i in range(101):
    if int(i/25)==a and int(i/10)==b:
        ans=i
        break
print(ans)
a,b=(int(x) for x in input().split())
#print(a)
#print(b)

am=int(100/8*a)
al=int(100/8*(a+1))
if (a%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
      
print (-1)
A, B=map(int,input().split())

priceA = int(A / 0.08)
priceB = int(B / 0.1)

if priceA  < priceB :
  if int(priceA * 0.1) == B :
    print(priceA)
  else:
    if int(priceB * 0.08) == A :
      print(priceB)
    else:
      print(-1)
else:
  if int(priceB * 0.08) == A :
    print(priceB)
  else:
    if int(priceA * 0.1) == B :
      print(priceA)
    else:
      print(-1)
a, b = map(int,input().split())

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

o_min = max(a_min, b_min)
o_max = min(a_max, b_max)

import math

if o_min == o_max:
    if o_min - math.floor(o_min) == 0:
        print(str(math.floor(o_min)))
    else:
        print('-1')
elif o_min < o_max:
    if math.ceil(o_min) <= o_max:
        print(str(math.ceil(o_min)))
    else:
        print('-1')
else:
    print('-1')
A, B = map(int, input().split())

a = int((A * 108 / 8) * 100 / 108)
b = int((B * 110 / 10) * 100 / 110)
a, b = min(a, b), max(a, b)

for i in range(a, b+1):
    check_a = int(i * 1.08)
    check_b = int(i * 1.1)
    if check_a-A == check_b-B and 0 < check_a-A:
        print(i)
        exit()
    elif check_a-A == check_b-B and 0 >= check_a-A:
        print(-1)
        exit()

print(-1)
a,b = map(int,input().split())
ans = -1
for x in range(b*10,(b+1)*10):
    if x*0.08 == a:
        ans = x
        break
print(ans)
import math
a,b = [float(i) for i in input().split()]
ans = 1000000000
flag = False

for i in range(1,1000):
    ans8 = int(math.floor(i*0.08))
    ans10 = int(math.floor(i*0.1))
#     print(ans8,ans10)
    if ans8 == a and ans10 == b:
        ans = min(ans, i) # 更新する必要がある．
        flag = True

if flag is True:
    print(ans)
else:
    print(-1)
a, b = map(int, input().split())

for p in range(10*4):
    tax8 = p*0.08
    tax10 = p*0.1

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

print(-1)
import math

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

#Process
Ans = -1
tmp08_min = math.ceil(A / 0.08)
tmp08_max = tmp08_min + 12
tmp10_min = math.ceil(B / 0.10)
tmp10_max = tmp10_min + 9

tmp_min = min(tmp08_min, tmp10_min)
tmp_max = max(tmp08_max, tmp10_max)

cnt = 0
while cnt < tmp_max - tmp_min:
    if(A == int((tmp_min + cnt) * 0.08) and B == int((tmp_min + cnt) * 0.10)):
        Ans = tmp10_min + cnt
        break
    cnt += 1

#Output
print(Ans)
a,b=map(int,input().split())
if b * 10 <= ((a + 1) * 25) // 2 and -(-a * 25 // 2) <= (b + 1) * 10:
    print(max(-(-a*25//2), b * 10))
else:
    print(-1)
A,B = list(map(int, input().split()))
A *= 10
B *= 10
a = [c for c in range(A,A+10)]
b = [c for c in range(B,B+10)]
cnt_a = []
cnt_b = []
for i in range(10):
    cnt_a.append(int(a[i]/0.08))
    cnt_b.append(int(b[i]/0.10))
ans = 10e7
is_true = False
for i in cnt_a:
    for j in cnt_b:
        if i == j:
            ans = min(ans, j)
            is_true = True
if is_true:
    print(ans//10)
else:
    print(-1)
a, b = map(int, input().split())
ax = a / 0.08
bx = b / 0.10
if int(ax) != ax:
    print(-1)
    exit()
if int(bx) != bx:
    print(-1)
    exit()
print(min(int(ax), int(bx)))
A, B = map(int, input().split())

if 100*A%8 == 0:
    ans1 = int(A/0.08)
else:
    ans1 = int(A/0.08) + 1
ans2_max = int(ans1 + ans1*0.1)
ans2 = int(B/0.1)
if ans2 <= ans2_max:
    print(ans1)
else:
    print(-1)
def main():
    a, b = map(int, input().split())
    av = int(a / 0.08 + 0.05)
    bv = int(b / 0.1)
    lb = max(bv, av)
    ub = min(av+11, bv+9)
    if lb <= ub:
        print(lb)
    else:
        print(-1)


if __name__ == '__main__':
    main()
a,b=map(int,input().split())
if b/0.1<=a/0.08 and a/0.08<(b+1)/0.1:
    print(int(a/0.08))
else:
    print(-1)
a,b = map(int,input().split())
f = int(a/0.08)
if f==b//0.1:
    print(f)
    exit()
for i in range(10):
    k = i*0.1
    if int(f*k)==b:
        print(f)
        exit()
print(-1)
a, b = map(int, input().split())

pa = 0 - -a//0.08
pb = b/0.1

ta = pa//12.5
tb = pb//10

if ta == a and tb == b:
    print(int(pa))
else:
    print(-1)
def main(A, B):
    flag = '-1'

    for N in range(1, 10000):
        if int(N * 0.08) == A and int(N * 0.1) == B:
            flag = N
            print(flag)
            break
    print(flag)



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

main(A, B)
a,b=map(int,input().split())

if 10*b<12.5*a<10*(b+1):
    print(int(12.5*a))
elif 12.5*a<=10*b<12.5*(a+1):
    print(int(10*b))
else:
    print(-1)
A, B = list(map(int, input().split()))
for x in range(1000):
	if (x * 8) // 100 == A and x // 10 == B:
		print(x)
		break
else:
	print(-1)
#C
import sys
a,b=map(int,input().split())
for i in range(1,1000):
    if int(i*0.08)==a and int(i*0.1)==b:
        ans=i
        break
    if i==999:
        ans=-1

print(ans)
# problem C
A,B = map(int,input().split())

ans = []
for i in range(1,1000):
    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])
import math
a, b = list(map(int, input().split()))

c = max((a/0.08),(b/0.1))
if math.floor(c*0.1) - math.floor(c*0.08) < abs(a-b):
    print('-1')
else:
    print(c)
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), int((N[0]+1)*(1/0.08)))]
Y = [i for i in range(int(N[1]*(1/0.10)), int((N[1]+1)*(1/0.10)))]
#print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))
import math

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

val1 = math.floor(a / 0.08)
val2 = math.floor(b / 0.1)
ans = []

for i in range(0, 101):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans.append(i)
if ans:
    print(min(ans))
else:
    print(-1)
A,B=map(int,input().split())
sampleA=A*100/8
sampleB=B*10
sampleA=int(sampleA)
sampleB=int(sampleB)
ans=[]
for i in range(max(sampleA,sampleB),max(sampleA,sampleB)+1):
    if int(i*8/100)==A and int(i*0.1)==B:
        ans.append(i)
        break
    else:
        ans.append(-1)
print(min(ans))
import math
A, B = map(int, input().split())

Xa_max = (A + 0.99999999999) / 0.08
Xa_min = (A) / 0.08

Xb_max = (B + 0.99999999999) / 0.1
Xb_min = (B) / 0.1

# 範囲が被らない場合
if Xa_min > Xb_max or Xb_min > Xa_max:
    print(-1)
    exit()

print(math.floor(max(Xa_min, Xb_min)))
a, b = map(int, input().split())
ta = a / 0.08
tb = b / 0.10
if (int(ta * 0.1) == b):
  print(round(ta))
elif (int(tb * 0.08) == a):
  print(round(tb))
else:
  print(-1)
a,b = map(int,input().split())

at = -(-a//0.08)
aat= -((-a-1)//0.08)
bt = -(-b//0.1)
bbt= -(-(b+1)//0.1)
if bbt < at or bt > aat:
    print(-1)
else:
    print(int(min(at,bbt)))
import math
import sys
a, b = map(int, input().split())
if b - a > 0.02 * max(math.ceil(a * 12.5), b * 10):
    print(-1)
    sys.exit()
print(max(math.ceil(a * 12.5), b * 10))
import math

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

a_min = math.floor(A * 100 / 8)
a_max = math.ceil((A + 1) * 100 / 8)
b_min = math.floor(B * 100 / 10)
b_max = math.ceil((B + 1) * 100 / 10)

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


X1 = (B/0.10)
X2 = ((B+1)/0.10)
X3 = (A/0.08)
X4 = ((A+1)/0.08)

# print(X1, X2, X3, X4)
if X3<=X1 and X1 < X4 and X4 <= X2:
    print(int(X1))
elif X3<=X1 and X1 <= X2 and X2 <= X4:
    print(int(X1))
elif X1<=X3 and X3 <= X4 and X4 <= X2:
    print(int(X3))
elif X1<=X3 and X3 <= X2 and X2 <= X4:
    print(int(X3))
else:
    print(-1)
import math
a,b=map(int,input().split())
A=[]
B=[]
for i in range(9):
  A.append(a+i/10)
  B.append(b+i/10)
for i in range(len(A)):
  A[i]=A[i]/0.08
  B[i]=B[i]/0.1
ans=[]
for i in range(len(A)):
  for j in range(len(A)):
    if round(A[i],2)==round(B[j],2):
      ans.append(A[i])
      break
A.sort()
if ans==[]:
  print(-1)
else:
  print(int(ans[0]))
A, B = map(int, input().split())

x = max(A*100//8, B*100//10)
y = min((A+1)*100//8, (B+1)*100//10)

if x <= y:
    ans = x
else:
    ans = -1

print(ans)
N, A = map(int, input().split())
eight = 0
ten = 0
answer = -1
for i in range (1,1000,1):
    eight = i * 0.08
    eight = eight//1
    ten = i* 0.1
    ten = ten//1
    if eight == N and ten == A:
        answer = i
        break
print(answer)
import math
A, B = list(map(int, input().split()))

A_min = math.floor(A * 25 / 2)
A_max = math.floor((A + 1) * 25 / 2)
B_min = math.floor(B * 10)
B_max = math.floor((B + 1) * 10)
# print(B_min, B_max)
A_list = list(range(A_min, A_max + 1))
B_list = list(range(B_min, B_max))
# print(A_list)
# print(B_list)

min_ans = -1
for num in A_list:
    if num in B_list:
        min_ans = num
        break
    else:
        continue

print(min_ans)
A, B = map(int,input().split())
a = 0
x = 1
while a == 0:
    if int(x * 0.08) == A:
        if int(x * 0.1) == B:
            a = 1
            print(x)
            exit()
        else:
            x += 1
    else:
        x += 1
    if x > B / 0.09:
        print(-1)
        a = 1
A, B = map(int, input().rstrip().split())
ret = 1000000
for i in range(1, 101):
    if int(i * 0.08) == A and int(i*0.1) == B and ret > i:
        ret = i
if ret == 1000000:
    ret = -1
print(ret)
A, B = list(map(int,input().split()))

for i in range(1,101):
  a = int(i * 0.08)
  if(a == A):
    b = int(i * 0.1)
    if(b == B):
      print(i)
      exit()
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.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())
a_p = math.ceil(a / 0.08)
a_q = math.floor((a+1) / 0.08)
b_p = math.ceil(b / 0.1)
b_q = math.floor((b+1) / 0.1)
if a_p <= b_p <= a_q:
    ans = b_p
elif a_q < b_p:
    ans = -1
elif b_q < a_p:
    ans = -1
else:
    ans = a_p
print(ans)
a, b = map(int, input().split())

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



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


if re != 0:
    print(re)
else:
    print(-1)