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):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):
import math
A,B =list(map(int,input().split()))
fr = 0
for i in range(10**6):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        fr += 1
        break
if fr == 0:
    print(-1)

Solution (Python):
import math

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

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


Akagen=math.ceil(A*12.5 )
Azyogen=math.ceil((A+1)*12.5-1)

Bkagen=math.ceil(B*10 )
Bzyogen=math.ceil((B+1)*10-1 )


if Azyogen<Bkagen or Bzyogen<Akagen:
    print("-1")
    exit()
print(Akagen if Akagen>Bkagen else Bkagen)

Solution (Python):
import math

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

count = 0



for n in range(1, 10001, 1):
    
    c1 = math.floor(n * 0.08)
    c2 = math.floor(n * 0.10)

    if c1 == a and c2 == b:
        print(n)
        exit()
    else:
        count += 1


if count == 10000:
    print(-1)

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

last = 2000

for i in range(12,last):
  mA = int(i*0.08)
  mB = int(i*0.10)
  
  if mA==A and mB==B:
    print(i)
    break
  if i==last-1:
    print("-1")

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

for x in range(1, 1250):
  if math.floor(x * 0.08) == A and math.floor(x * 0.1) == B:
    print(x)
    exit(0)

print(-1)

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

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

flag=0
for i in range(1,1050):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans = i
        flag=1
        break

if flag==1:
    print(ans)
else:
    print(-1)

Solution (Python):
p,q= input().split()
a,b =(int(p), int(q))
a_list = []
b_list = []
import math 
for i in range(int((a+2)/0.08)):
    if a/0.08 <= i and i <(a+1)/0.08:
        a_list.append(i)
for i in range(int((b+2)/0.1)):
    if b/0.1 <= i and i <(b+1)/0.1:
        b_list.append(i)

        
m=len(a_list)-1
for i in range(m):
    if a_list[i] in b_list and i is not m:
        print(a_list[i])
        break
    elif i ==m-1:
        print(-1)

Solution (Python):
A,B = map(int,input().split())
j=0
for i in range(1,100001):
    if int(i*0.08) == A and int(i*0.1) == B:
        j =1
        ans = i
        break
if j == 1:
    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):


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

p = -1

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

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

n = 2000

for i in range(1,n):
    x = int(i*0.08)
    y = int(i*0.1)
    if x == a and y == b:
        print(i)
        exit()
else:
    print(-1)

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

count = 0

for n in range(10000):
    za = n*0.08
    zb = n*0.1
    count += 1
    if A == math.floor(za) and B == math.floor(zb):
        print(n)
        break


if count == 10000:
    print(-1)

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

for i in range(1,1100):
    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())



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())
c=a//0.08
d=b/0.1
if a%0.08 != 0:
  c += 1

e=(a+1)//0.08
if (a+1)%0.08 == 0:
  e -= 1
  
f=(b+1)/0.1 - 1

if max(c,d) <= min (e,f):
  print(int(max(c,d)))
else:
  print(-1)

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

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

Flag = False

price1 = int(A // 0.08) + 1
price2 = int(B // 0.1) + 1

if price1 < price2:
  start = price1
  end = price2
else:
  start = price2
  end = price1

for i in range(start,end+1):
  if int(i * 0.08) == A and int(i *0.1) == B:
    Flag = True
    price = i
    break

if Flag == True:
  print(price)
else:
  print(-1)

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

if max([100/8*A,10*B])<min([100/8*(A+1),10*(B+1)]):
    print(math.ceil(max([100/8*A,10*B])))
else:
    print(-1)

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

Solution (Python):
a,b = map(int, input().split())
for i in range(1111):
    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())

for i in range(1, 1010):
    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 = 0
for i in range(10*B + 11,1,-1):
    if A <= i * 0.08 < A+1 and B <= i * 0.1 < B+1:
        ans = i
if ans == False:
    print(-1)
else:
    print(ans)

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

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

Solution (Python):
from math import floor

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

if __name__ == "__main__":
    main()

Solution (Python):
from math import floor

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

if __name__ == "__main__":
    main()

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

A = a[0]
B = a[1]
x = int(100/8*A)

if A == B:
    while 1:
        if int(x*0.08)== int(x*0.10):
            print(x)
            break
        x+=1
        if x > 10000:
            print('-1')
            break

elif A != B:
    for i in range(x,10001):
        if int(i*8/100) == A and int(i/10) == B:
            print(i)
            break 
        elif int(i*8/100) != A and int(i/10) != B and i == 10000:
            print('-1')
            break

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

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

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

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

Solution (Python):
import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
 
mod = 10**9+7
sys.setrecursionlimit(mod) 
 
d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))
 
A, B = LI()
ans = mod
for i in range(1251):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        ans = i
        break
    else:
        pass
else:
    ans = -1
 
print(ans)

Solution (Python):
import math
 
A, B = list(map(int, input().split()))
 
a_min = math.ceil(A * 100 / 8)        
a_max = math.ceil((A + 1) * 100 / 8)
b_min = math.ceil(B * 100 / 10) 
b_max = math.ceil((B + 1) * 100 / 10) 
 
 
set_a = {i for i in range(a_min, a_max)} 
set_b = {i for i in range(b_min, b_max)}
i = set_a.intersection(set_b)  
if len(i) > 0:   
    print(min(i))
else:
    print(-1)

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

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

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

for i in range(1,1010):
    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())

Amin = -(-A*100//8)

Amax = -(-(A+1)*100//8) -1

Bmin = -(-B*100//10)

Bmax = -(-(B+1)*100//10) -1

if Amin > Bmax or Bmin > Amax:
  print(-1)
else:
  print(max(Amin, Bmin))

Solution (Python):
import decimal

temp = input().split()

A, B = [int(num) for num in temp]


tax_rate_A = decimal.Decimal("0.08")
tax_rate_B = decimal.Decimal("0.10")


def calc_price_list(tax, tax_rate):
    temp = tax / tax_rate
    price_l = temp.to_integral_value(rounding=decimal.ROUND_UP)
    
    temp = (tax + 1) / tax_rate
    price_u = temp.to_integral_value(rounding=decimal.ROUND_UP)

    return list(range(int(price_l), int(price_u)))


price_A_list = calc_price_list(A, tax_rate_A)

price_B_list = calc_price_list(B, tax_rate_B)


price_set = set(price_A_list) & set(price_B_list)


if len(price_set) == 0:
    print("-1")
else:
    price_list = sorted(list(price_set))
    price = price_list[0]
    print(price)

Solution (Python):
A,B = map(int, input().split())
num = 0
while num < 1011:
  num += 1
  X = num * 0.08
  if int(X) == A:
    Y = num * 0.1
    if int(Y) == B:
      print(num)
      break
    else:
      pass
  elif num == 1010:
    print(-1)
    break
  else:
    pass

Solution (Python):

from math import floor, ceil
a, b = map(int, input().split())
for i in range(2000):
    if b == floor(i * 0.10) and a == floor(i * 0.08):
        print(i)
        break
else:
    print(-1)

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

for x in range(B*20):
    if int(0.08*x)==A and int(0.1*x)==B:
        print(x)
        break
    if x==B*20-1:
        print(-1)

Solution (Python):
import math
import sys


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

for i in range(10000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        sys.exit(0)

print(-1)

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

for x in range(B*20):
    if int(0.08*x)==A and int(0.1*x)==B:
        print(x)
        break
    if x==B*20-1:
        print(-1)

Solution (Python):
A,B = map(int, input().split())
for i in range(1010):
    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())

for i in range(1010):
  if int(i*0.08)==a and int(i*0.10)==b:
    print(i)
    exit()

print(-1)

Solution (Python):
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))

A, B = load_list()












for i in range(B, B+20000):
    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())
answer = -1


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

print(answer)

Solution (Python):
import math

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

Min=math.ceil(100*A/8)
Max=math.ceil(100*(A+1)/8)-1
P={i for i in range(Min,Max+1)}

MIN=math.ceil(100*B/10)
MAX=math.ceil(100*(B+1)/10)-1
Q={j for j in range(MIN,MAX+1)}

R=P&Q
if len(R)>=1:
    print(min(R))
else:
    print('-1')

Solution (Python):
import math
A,B = map(int,input().split())
sol1 = math.ceil(A/0.08)
sol2 = math.ceil(B/0.10)
ans = lambda x1,x2 : x1 if x1 == x2 else -1
flagA = True
flagB = True
while True:
    if(sol1 * 0.08 < A and flagA):
        flagA = False
        if(math.floor((sol1+1)*0.10) == B):
            print(sol1+1)
            break
    sol1 -= 1
    if(sol2 * 0.10 < B and flagB):
        flagB = False
        if(math.floor((sol2+1)*0.08) == A):
            print(sol2+1)
            break
    if(not flagA and not flagB):
        print(-1)
        break
    sol2 -= 1

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

Amin=math.ceil(A*100/8)
Amax=(A+1)*100//8
if Amax*8/100 == Amax*8//100:
    Amax-=1

Bmin=B*10
Bmax=(B+1)*10
if Bmax/10 == Bmax//10:
    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)

Solution (Python):
import math

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

tmp = B * 10
for i in range(tmp, tmp + 10):
    if math.floor(i * 0.08) == A:
        print(i)
        exit()
print(-1)

Solution (Python):
ab_list = input().split(" ")
A = int(ab_list[0])
B = int(ab_list[1])

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

for i in range(1010):
    if A <= i*0.08 < A+1 and B <= i*0.1 < B+1:
        print(i)
        exit()

print(-1)

Solution (Python):


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

ans = x
print(ans)

Solution (Python):
import math
A, B = [int(i) for i in input().split()]
cand = set(list(range(math.ceil(A/0.08), math.ceil((A+1)/0.08))))
cand &= set(list(range(math.ceil(B/0.1), math.ceil((B+1)/0.1))))
if(len(cand)==0):
    print(-1)
else:
    print(min(cand))

Solution (Python):
import math

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

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

set_a = {i for i in range(a_min, a_max)}
set_b = {i for i in range(b_min, b_max)}
i = set_a.intersection(set_b)
if len(i) > 0:
    print(min(i))
else:
    print(-1)

Solution (Python):
import math
import random
import sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from functools import lru_cache, reduce
from heapq import heapify, heappop, heappush
from itertools import (chain, combinations, combinations_with_replacement,
                       permutations)

MAX_INT = 2**62-1
sys.setrecursionlimit(10**7)

input = sys.stdin.readline


def read_n_int():
    return map(int, input().split())


def main():
    a, b = read_n_int()
    a1, a2 = a/0.08, (a+1)/0.08
    b1, b2 = b/0.1, (b+1)/0.1

    for i in range(int(a1), int(a2)+1):
        if b1 <= i < b2 and a1 <= i < a2:
            print(i)
            break
    else:
        print(-1)


if __name__ == "__main__":
    main()

Solution (Python):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

a,b=n1()

a2=a/0.08
a3=(a+1)/0.08
b2=b/0.1
b3=(b+1)/0.1
for x in range(1,1300):
    if a2<=x<a3 and b2<=x<b3:
        print(x)
        break;
else:
    print(-1)

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

x1=math.ceil(A/0.08)
x2=math.ceil(B/0.1)
ans=-1
if math.floor(x1*0.08)==A and math.floor(x1*0.10)==B:
	ans=x1
if math.floor(x2*0.08)==A and math.floor(x2*0.10)==B:
	if ans==-1 or x2<ans:
		ans=x2
print(int(ans))

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

for i in range(1100):
    if i//12.5 == a and i//10 == b:
        print(i)
        exit()

print(-1)

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

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

ref = max(pa, pb)
refmin = min(pa, pb)

ta = int(ref*0.08)
tb = int(ref*0.1)

flag = 0

for i in range(2000):
    if i == 1999:
        print(-1)
    elif ta != a or tb != b and flag == 0:
        ref -= 1
        ta = int(ref*0.08)
        tb = int(ref*0.1)
        if ta == a and tb == b:
            flag += 1

    elif ta == a and tb == b:
        flag += 1
        ref -= 1
        ta = int(ref*0.08)
        tb = int(ref*0.1)
        if ta != a or tb != b:
            print(int(ref + 1))
            break
    else:
        print(-1)
        break

Solution (Python):
import math

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

x = []
for i in range(int(a / 0.08), int((a + 1) / 0.08)):
    if math.floor(i * 0.08)  == a:
        x.append(i)

for i in range(len(x)):
    if x[i] // 10 == b:
        print(x[i])
        break

if i == len(x) - 1:
    print(-1)

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

flag=0
for i in range(1,1010):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        flag+=1
        break
if flag !=1:
    print('-1')

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007



def main():
	a, b = IN()
	for i in range(1, 30000):
		if int(i * 0.08) == a and int(i * 0.10)==b:
			return i
		
	return -1
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
A, B = map(int, input().split())
import sys
for i in range(1011):
    a = int(i * 0.08)
    b = int(i * 0.1)
    if a == A and b == B:
        print(i)
        sys.exit(0)
print(-1)

Solution (Python):
A,B = map(int, input().split())
f=0
for X in range(1,10000):
    if int(X*0.08 )==A and int(X*0.1)==B:
        print(X)
        f+=1
        break
if f!=1:    
    print('-1')

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

for i in range(1010):
    if int(i*0.08) == A and i//10 == B:
        print(i)
        exit()

print(-1)

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

for i in range(1,2000):
    c=i*8/100
    d=i*10/100
    if(int(c)==a and int(d)==b):
        print(i)
        break
else:print(-1)

Solution (Python):
a, b = map(int, input().split())
listb = list(range(b*10, (b+1)*10))

for i in range (0, 10):
	if (listb[i]*0.08)//1 == a:
		print(listb[i])
		exit()

print(-1)

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

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

A, B = LI()
ans = mod
for i in range(1251):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        ans = i
        break
    else:
        pass
else:
    ans = -1

print(ans)

Solution (Python):
import sys

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)
        sys.exit()
print("-1")

Solution (Python):
a,b = map(int,input().split())
count = 0
bli = []
for i in range(10):
    bli.append(10*b + i)
    if bli[i]//12.5 == a:
        print(bli[i])
        count += 1
        break
if count == 0:
    print("-1")

Solution (Python):
a,b = map(int,input().split())
alibli =[]
bli = []
for i in range(10):
    bli.append(10*b + i)
for i in range(10):
    if bli[i]//12.5 == a:
        alibli.append(bli[i])
if alibli != []:
    print(min(alibli))
else:
    print("-1")

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

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

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

print(-1)

Solution (Python):
import math

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

lst = []
for p in range(10, 1010):
  if (math.floor(0.08*p) == A) and (math.floor(0.10*p) == B):
    lst.append(p)

if lst:
  print(min(lst))
else:
  print(-1)

Solution (Python):

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

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

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

Solution (Python):
import sys
from math import floor

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

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

	if a < b:
		c = a
	else:
		c = b

	for money in range(c, 1009+1):
		m_a = floor(money * 0.08)
		m_b = floor(money * 0.10)
		if m_a == A and m_b == B:
			print(money)
			sys.exit()
	print(-1)

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

a = 1
answer = 0
while answer == 0:
    if int(a * 0.08) == A and int(a * 0.1) == B:
        answer = a
    elif a == 1010:
        answer = -1
    a = a + 1
print(answer)

Solution (Python):
a,b=map(int,input().split())
price=10*b
c=[]  
while(price<10*b+10):
  if int(price*0.08)==a:
    c.append(price)
    price=price+1
  else:
    price=price+1
if c==[]:
  print(-1)
else:
  print(min(c))

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

amin = int(a//0.08)
amax = int((a+1)//0.08)
bmin = int(b//0.1)
bmax = int((b+1)//0.1)

if a%0.08 > 0:
	amin += 1
if (a+1)%0.08 > 0:
	amax -= 1
if b%0.1 > 0:
	bmin += 1
if (b+1)%0.1 > 0:
	bmax -= 1

if amin <= bmin:
	if bmin <= amax:
		print(bmin)
	else:
		print('-1')
else:
	if amin <= bmax:
		print(amin)
	else:
		print('-1')

Solution (Python):
A,B=[int(i) for i in input().split()]
for i in range(1009):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        exit()
print(-1)

Solution (Python):
def tax(price, percent):
    return (price * percent) // 100


a, b = map(int, input().split())
for i in range(1251):
    if tax(i, 8) == a and tax(i, 10) == b:
        print(i)
        exit()
print(-1)

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

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

Solution (Python):

import sys
a, b = map(int, sys.stdin.readline().split())


for num in range(0, 1001):
    A = int(num*0.08)
    B = int(num*0.1)
    
    if a==A and b ==B:
        print(num)
        break
else:
    print(-1)

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

hati = 0
ten = 0
for i in range(1, 10001):
    hati = i * 8 // 100
    ten = i * 10 // 100
    if hati == a and ten == b:
        print(i)
        exit()
print(-1)

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

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

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

Solution (Python):
import math
N = list(map(int, input().split()))
X = [i for i in range(math.ceil((N[0])*(1/0.08)), math.ceil((N[0]+1)*(1/0.08)))]
Y = [i for i in range(math.ceil((N[1])*(1/0.10)), math.ceil((N[1]+1)*(1/0.10)))]




cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Solution (Python):
import math
A, B = map(int, input().split())
flag = False
for x in range(1, 1000+100):
    if A == math.floor(x*0.08) and B == math.floor(x*0.1):
        print(x)
        flag = True
        break
if not flag:
    print(-1)

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

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

for x in range(1251):
    
    if (int(x * 0.08) == A) and (int(x * 0.1) == B):
        print(x)
        exit()

print("-1")

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

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

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


if Xa_min >= Xb_max or Xb_min >= Xa_max:
    print(-1)
    exit()

if Xa_min >= Xb_min:
    ans = math.ceil(Xa_min)
    if ans >= Xb_max:
        print(-1)
        exit()
else:
    ans = math.ceil(Xb_min)
    if ans >= Xa_max:
        print(-1)
        exit()

print(ans)

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

for i in range(10**4):
    if int(i*0.08) == a and int(i*0.10) == b:
        print(i)
        break
else:
    print(-1)

Solution (Python):
def tax(a, b):
    for i in range(1,1010):
        if int(i*0.08) == a and int(i*0.1) == b:
            print(i)
            return
    print(-1)
    return

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

Solution (Python):
def main():
    A, B = map(int, input().split())
    x1 = int(B // 0.1)
    x2 = int(A // 0.07)

    for i in range(x1, x2):
        if int(i*0.08) == A and int(i*0.1) == B:
            print(i)
            return
    else:
        print(-1)
        return


if __name__ == "__main__":
    main()

Solution (Python):

import math


A,B = (int(x) for x in input().split())

LA = list(range(math.ceil(12.5*A),math.ceil(12.5*(A+1))))
LB = list(range(math.ceil(10*B),math.ceil(10*(B+1))))

intersect = set(LA) & set(LB)

if intersect == set():
    print(-1)
else:
    print(min(intersect))

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

x_s = int(50*(A+B)/9) 
x_e = int(50*(A+B+1)/9) 
a = -1
for x in range(x_s, x_e+1):
    if int(x*0.08) == A and int(x*0.1) == B:
        a = x
        break
print(a)

Solution (Python):
A, B = map(int, input().split(" "))
ans = -1
for p in range(1, 10000):
  if int(p * 0.08) == A and int(p * 0.1) == B:
    ans = p
    break
print(ans)

Solution (Python):
import math

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

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

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

if a_high<b_low or b_high<a_low:
  print(-1)
else:
  print(max(a_low, b_low))

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect




from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  a, b = map(int, readline().split())
  a_low = ceil(a/0.08)
  a_high = ceil((a+1)/0.08)
  s1 = {i for i in range(a_low, a_high)}
  b_low = ceil(b/0.1)
  b_high = ceil((b+1)/0.1)
  s2 = {i for i in range(b_low, b_high)}
  if s1&s2:
    print(min(s1&s2))
  else:
    print(-1)
  
  
if __name__ == '__main__':
  main()