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):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  
def Is(): return map(int, input().split())  
def LI(): return list(map(int, input().split()))  
def TI(): return tuple(map(int, input().split()))  
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  
def LS(): return list(input())  
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

a, b = Is()
ax = a * 12.5  
bx = b * 10    

for i in range(floor(bx-15), floor(bx-15)+40):
    
    if a == floor(i*0.08) and b == floor(i*0.1):
        print(i)
        exit()

print("-1")

Solution (Python):

import collections
import itertools as it
import math

 


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






for i in range(0, 10**7):
    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(1010):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        ans = i
        break
print(ans)

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

flag = True
for i in range(2000):
    if( math.floor(i * 0.08) == a and math.floor(i * 0.1) == b):
        print(i)
        flag = False
        exit()

if flag:
    print(-1)

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

for price in range(1, 1009):

    if A == price*8//100 and B == price*10//100:
        print(price)
        sys.exit()
print(-1)

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

from math import floor

for x in range(1,1200):
    if floor(0.08*x) == a and floor(0.1*x) == b:
        print(x)
        exit()
print(-1)

Solution (Python):
"""
a = int(x*0.08)
a <= x*0.08 < a+1
a/0.08 <= x < (a+1)/0.08

b = int(x*0.1)
b <= x*0.1 < b+1
b/0.1 <= x < (b+1)/0.1
"""

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
a,b = [int(i) for i in readline().split()]

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

Solution (Python):
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=q
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)

a,b = readInts()
for x in range(10*b,10*b+10):
	if math.floor(x*0.08)==a:
		print(x)
		exit()

print(-1)

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

a_min = math.ceil(a/0.08)
a_max = math.floor((a+1)/0.08)

b_min = math.ceil(b/0.1)
b_max = math.floor((b+1)/0.1)

a_list = set(list(range(a_min, a_max, 1)))
b_list = set(list(range(b_min, b_max, 1)))

ab_list = a_list & b_list
if len(ab_list) > 0:
    print(min(ab_list))
else:
    print(-1)

Solution (Python):
import sys
import math
input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    assert A <= 100
    assert B <= 100
    for i in range(1000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit()
    print("-1")


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    for i in range(1000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit()
    print("-1")


if __name__ == '__main__':
    main()

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

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

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

ret = -1
for i in range(1000 + 1):
  if i * 0.08 // 1 == a and i * 0.1 // 1 == b:
    ret = i
    break
print(ret)

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

    for i in range(0, 1251):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            print(i)
            return

    print(-1)
    
main()

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

Solution (Python):
A, B = map(int, input().split())
rA = set(range(int((A-0.001)//0.08 + 1), int((A+0.999)//0.08 + 1)))
rB = set(range(int((B-0.001)//0.1 + 1), int((B+0.999)//0.1 + 1)))
if len(rA & rB) == 0:
    print(-1)
else:
    print(min(rA & rB))

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

print(ans)

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

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

Solution (Python):
import math

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

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

print(ans)

Solution (Python):

import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()
flag = 0
for i in range(1, 10**6):
    if((i*8)//100==a and (i*10)//100==b):
        print(i)
        flag = 1
        break

if(flag==0):
    print(-1)

Solution (Python):
A,B = map(int,input().split())
i=1
while i<=10000:
  if (int(i * 0.08) == A) & (int(i * 0.10) == B):
    print(i)
    exit()
  i+=1
print(-1)

Solution (Python):
from math import floor

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

Solution (Python):
ratio_8,ratio_10 = map(int,input().split())
min = 10000
for price in range(1,1010):
  if int(price*0.08) == ratio_8 and int(price*0.1) == ratio_10:
    if min > price:
      min = price

print(min) if min < 10000 else print("-1")

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

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

Solution (Python):
A,B=map(int,input().split())
c=[]
for x in range(10*B,10*B+10):
  if A/0.08<=x<(A+1)/0.08:
    c.append(x)
if c==[]:
  print(-1)
else:
  print(c[0])

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

for i in range(10010):
  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,20001):
    va = int(i * 0.08)
    vb = int(i * 0.1)
    if(va == a and vb == b):
        print(i)
        exit()
print(-1)

Solution (Python):
def tax8(n):
    return list(range(int((n-1)*(25/2)),int((n+1)*(25/2))))
    
def tax10(n):
    return list(range(int((n-1)*(10/1)),int((n+1)*(10/1))))

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

ans = -1

x = []

x.extend(tax8(a))
        
y = []

y.extend(tax10(b))

for i in x:
    if i in y:
        if int(i*(27/25))-i == a and int(i*(11/10))-i == b:
            ans = i
            break
    
print(ans)

Solution (Python):
import math
a, b = map(int, input().split())
tmp_a = math.ceil(a / 0.08)
tmp_b = int(b / 0.1)
if a % 2 == 0:
    set_a = set([i for i in range(tmp_a, tmp_a+13)])
else:
    set_a = set([i for i in range(tmp_a, tmp_a+12)])
set_b = set([i for i in range(tmp_b, tmp_b+10)])
if len(set_a & set_b) == 0:
    print(-1)
else:
    print(min(set_a & set_b))

Solution (Python):
A,B=map(int,input().split())
Aset=set([int(i) for i in range(1,1010) if int(i*0.08)==A])
Bset=set([int(i) for i in range(1,1010) if int(i*0.1)==B])
if Aset&Bset :
    print(min(Aset&Bset))
else:
    print(-1)

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:
    ans=i
    break
  else:
    ans=-1
print(ans)

Solution (Python):
import math

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

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

if f==0:
    print(-1)

Solution (Python):
import math


def main():
    A, B = list(map(int, input().split(' ')))
    price = 1
    answer = -1
    while True:
        tax_008 = math.floor(0.08 * price)
        tax_010 = math.floor(0.1 * price)
        if tax_008 > A or tax_010 > B:
            break
        if tax_008 == A and tax_010 == B:
            answer = price
            break
        price += 1
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
import math
A,B=map(int,input().split())
X=10001
c=[]

for i in range(10,X):
  if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
    c.append(i)

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

Solution (Python):
A,B = map(int,input().split())
for k in range(1,1010):
  if (int(k * 0.08) == A) & (int(k * 0.10) == B):
    print(k)
    exit()
print(-1)

Solution (Python):
A,B = map(int,input().split())
ak = []
bk = []
for k in range(-int((-A/0.08)//1),-int(-(A/0.08+12.5)//1)):
  ak.append(k)
for k in range(-int((-B/0.10)//1),-int(-(B/0.10+10.0)//1)):
  bk.append(k)
ans = min(set(ak) & set(bk)) if len(set(ak) & set(bk)) > 0 else -1
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:
        ans = i
        break
    else :
        ans = -1

print(ans)

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

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

print(ans)

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

Solution (Python):
from math import floor

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

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

def solve(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return x == a and y == b

ans = -1
for n in range(20000):
    if solve(n):
        ans = n
        break
print(ans)

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

for v in range(1, 1000 + 1):
    if v*8//100 == a and v*10//100 == b:
        print(v)
        exit()
print(-1)

Solution (Python):
A,B=map(int,input().split())
for i in range(1,10010):
	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 = True
for i in range(1, 1010):
  if (int(i*0.08) == a and int(i*0.1) == b):
    print(i)
    flag = False
    break
if flag:
  print(-1)

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

cnt = 0

for i in range(1, 1010):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        cnt += 1
        break
if cnt == 0:
    print(-1)

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

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

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

print(-1)

Solution (Python):

import sys
import math


def solve(A: int, B: int):
    
    kmina = math.ceil((A)/0.08)
    kmaxa = (A + 1)/0.08
    
    kminb = math.ceil((B)/0.10)
    kmaxb = (B + 1)/0.10
    
    if (kmina <= kminb) and (kminb < kmaxa):
        print(kminb)    
    elif (kminb <= kmina) and (kmina < kmaxb):
        print(kmina)
    else:
        print(-1)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(A, B)

if __name__ == '__main__':
    main()

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

for i in range(1,10**4+1):
    if i*8//100==a and i*10//100==b:
        ans = i
        break
        
print(ans)

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

Solution (Python):

import math

def main():
    A, B = map(int, open(0).read().split())
    L = min(A//(0.08), B//(0.10))
    U = max((A + 1)//(0.08), (B + 1)//(0.10))

    flag = False
    for i in range(int(L), int(U) + 1):
        if (math.floor(i * 0.08) == A) and (math.floor(i * 0.10) == B):
            print(i)
            flag = True
            break
    
    if not flag:
        print(-1)


main()

Solution (Python):
a,b=map(int,input().split())
for i in range(1009):
  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(1251):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    break
else:
  print(-1)

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

max = math.ceil(a*100/8)*math.ceil(b*10)

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

for n in range(1001):
  if int(n*0.08)==A and int(n*0.1)==B:
    print(n)
    exit()
    
print(-1)

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

for i in range(2000):
    if a <= i * 0.08 < a+1 and b <= i * 0.10 < b+1:
        print(i)
        exit()
print(-1)

Solution (Python):
import sys
sys.setrecursionlimit(10**6) 
import math

from copy import copy, deepcopy
from operator import itemgetter

import bisect

from collections import deque 



from collections import Counter

from itertools import accumulate

from heapq import heapify,heappop,heappush


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s): return sorted(range(len(s)), key=lambda k: s[k])




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




















for x in range(1,10000):
    a=int(0.08*x)
    b=int(0.1*x)
    if a==A and b==B:
        print(x)
        exit()

print(-1)

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

tax_8 = 0.08
tax_10 = 0.1

li = [99999999999]
for i in range(1,1010):
    temp = math.floor(i *tax_8)
    temp2 = math.floor(i*tax_10)
    if temp == a and temp2 == b:
        li.append(i)
li.sort()
if li[0] == 99999999999:
    print("-1")
else:
    print(li[0])

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

for i in range(5000):
  if int(i * 0.08) == A and int(i * 0.1) == B:
    print(i)
    exit()
    
print(-1)

Solution (Python):
import math
 
t8,t10=map(int,input().split(" "))
 
mint8=t8/0.08
maxt8=(t8+1)/0.08
mint10=t10/0.1
maxt10=(t10+1)/0.1
 
ans=list(set(range(math.ceil(mint8),int(maxt8))) & set(range(math.ceil(mint10),int(maxt10))))
if len(ans)==0:
    print(-1)
else:
    print(min(ans))

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

ans = -1
for i in range(10 ** 3 + 1):
  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(1009):
    if int(i*0.08) ==A and int(i*0.1)==B:
        print(i)
        break
else:
    print(-1)

Solution (Python):


import math

a,b=map(int,input().split())
na=[i for i in range(math.ceil(a*12.5),math.ceil((a+1)*12.5-1)+1)]
nb=[i for i in range(b*10,(b+1)*10)]

ans=set(na)&set(nb)

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

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

Solution (Python):
A,B = map(int,input().split())
ans = []
for x in range(1001):
    if int(0.08*x) == A and int(0.1*x) == B:
        ans.append(x)
if len(ans)==0:
    print(-1)
else:
    print(min(ans))

Solution (Python):
import math
a,b,=map(int, input().split())
aTax = math.ceil(a / 0.08)
bTax = math.ceil(b / 0.10)
if 0 <= aTax - bTax < 10:
    print(aTax)
elif aTax < bTax and math.floor(bTax * 0.08) == a:
    print(bTax)
else:
    print(-1)

Solution (Python):
a,b=map(int,input().split())
for x in range(10*b,10*(b+1)):
    if ((2*x)//25)==a:
        print(x)
        break
else:
    print(-1)

Solution (Python):
def main():
    A, B = (int(x) for x in input().split())
    ans = -1
    for i in range(1001):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            ans = i
            break

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


if __name__ == "__main__":
    main()

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

list1 = []
list2 = []

border1 = math.ceil(A/0.08)
border2 = math.ceil((A+1)/0.08-1)
border3 = math.ceil(B/0.1)
border4 = math.ceil((B+1)/0.1-1)

for i in range(border1,border2+1,1):
    list1.append(i)
for j in range(border3,border4+1,1):
    list2.append(j)
    
list3 = list(set(list1) & set(list2))

if bool(list3)==True:
    print(min(list3))
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.1) == b:
    ans = i
    break;
print(ans)

Solution (Python):
from math import *
A,B=list(map(int, input().split()))
x=ceil(max(A/0.08,B/0.1))
y=min((A+1)/0.08,(B+1)/0.1)
if x<y:
    print(x)
else:
    print(-1)

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

Solution (Python):
import math
import sys

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

for i in range(1,1251):
	tax_a = math.floor(i * 0.08)
	tax_b = math.floor(i * 0.1)
	if tax_a == a and tax_b == b:
		print(i)
		sys.exit()
print(-1)

Solution (Python):
a,b = map(int,input().split())
for i in range(2000):
  if int(i*2/25) == a and int(i/10) == b:
    print(i)
    exit()
print('-1')

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

for i in range(10):
    num = 10*b + i

    if a <= num*0.08 < a+1:
        ans = num
        break

print(ans)

Solution (Python):
from math import ceil

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







for i in range(max(int(A*(100/8)), int(B*(100/10))), 10000):
    if int(i*8/100) == A and int(i*10/100) == B:
        print(i)
        break
    elif int(i*8/100) > A or int(i*10/100) > B:
        print(-1)
        break

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

Solution (Python):
import math
a,b=(int(i) for i in input().split())
answer='-1'
for i in range(1001):
  if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
    answer=i
    break
print(answer)

Solution (Python):
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(10*b) 
v = int(10*(b+1)) 
for i in range(s,t):
    c.append(i)
for j in range(u,v):
    d.append(j)
c_d = set(c) & set(d)
if (len(c_d)>0):
    print(min(c_d))
else:
    print(-1)

Solution (Python):
import math
a,b=map(int, input().split())
a_min = math.ceil(a/0.08)
a_max = math.ceil((a+1)/0.08)-1
b_min = math.ceil(b/0.1)
b_max = math.ceil((b+1)/0.1)-1

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

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


a1 = a/0.08
a2 = (a+1)/0.08
b1 = b/0.1
b2 = (b+1)/0.1
c = 0

for i in range(1001):
    if a1<= i <a2 and b1<= i <b2:
        print(i)
        c = 1
        break
        
if c==0:
    print('-1')

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

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

print(-1)



"""
while True:
    if (c*0.080)//1 == a:
        print(int(c))
        exit()
    elif (c*0.080)//1 >= a or (c*0.1)//1 != b:
        print(-1)
        exit()
    else:
        c += 1.0
"""

Solution (Python):
A, B = map(int, input().split())
A1 = A/0.08
A2 = (A+1)/0.08
B1 = B/0.1
B2 = (B+1)/0.1
C = 0
for i in range(1001):
  if A1 <= i < A2 and B1 <= i < B2:
    print(i)
    C = 1
    break
if C == 0:
  print(-1)

Solution (Python):
A, B = map(int, input().split())
import math
for x in range(12, 1001):
    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())
import math
for x in range(10, 1251):
    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())
answer = -1
for i in range(1,1251):
    if int(i*0.08) == A and int(i*0.1) == B:
        answer = i
        break
print(answer)

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

Solution (Python):
import math
il = input().split()
A = int(il[0])
B = int(il[1])

flag = -1

for i in range(10, 1000+1):
    if(math.floor(i * 0.08) == A and math.floor(i * 0.1) == B):
        flag = i
        break
print(flag)

Solution (Python):

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


ans = -1
for n in range(1000, -1, -1):
    if int(n * 0.08) == A and int(n * 0.1) == B:
        ans = n

print(ans)

Solution (Python):
import math

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

tax_a = 0.08
tax_b = 0.1

start_price = math.ceil(A / tax_a)
stop_price = math.ceil((A+1) / tax_a)

for i_price in range(start_price, stop_price):
    if math.floor(i_price * tax_b) == B:
        ans = i_price
        break
else:
    ans = -1

print(ans)

Solution (Python):
import sys

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

for i in range(1,10000,1):
    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())
for i in range(1, 1500):
    if int(i / 12.5) == A and i // 10 == B:
        print(i)
        break
else:
    print(-1)

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

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

Solution (Python):
a,b=map(int,input().split())
a1=-(-a//0.08)
a+=1
a2=-(-a//0.08)-1
b1=b*10
b+=1
b2=b*10-1
if b1<=a2<=b2:
    print(int(b1))
elif a1<=b2<=a2:
    print(int(a1))
else:
    print(-1)

Solution (Python):
A, B = map(int, input().split())
for i in range(20000):
    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())
i = 1
while True:
  if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
    print(i)
    break
  if math.floor(i*0.08) > a or math.floor(i*0.1) > b:
    print(-1)
    break
  i += 1

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

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

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

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

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


if __name__ == "__main__":
    main()

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

Solution (Python):
Str = input().split()
A = int(Str[0])
B = int(Str[1])
import math 
amin = math.ceil(A/0.08)
amax = (A+1)/0.08
if amax == math.floor(amax):
  amax= amax-1
else:
  amax = math.floor(amax)

i = amin
ans = -1
while i <= amax:
  if int(i*0.1) == B:
    ans = i
    break
  i+=1

print(ans)

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

ans=-1

for i in range(1,1002):
  if math.floor(i*0.10)==b and math.floor(i*0.08)==a:
    ans=i
    break
  else:
    continue
    
print(ans)

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


for i in range(1,1002):
  if math.floor(i*0.10)==b and math.floor(i*0.08)==a:
    print(i)
    break
    
  elif i==1001:
    print(-1)
  
  else:
    continue

Solution (Python):
a,b = map(int,input().split())
if a/0.08 == a//0.08:
    emin = a//0.08
else:
    emin = a//0.08+1
if (a+1)/0.08 == (a+1)//0.08:
    emax = (a+1)//0.08-1
else:
    emax = (a+1)//0.08
tmin = b/0.1
tmax = (b+1)/0.1-1
if tmax >= emax:
    if tmin <= emax:
        print(int(tmin))
    else:
        print(-1)
else:
    if emin <= tmax:
        print(int(emin))
    else:
        print(-1)

Solution (Python):
a,b = map(int,input().split())
n = 1
while n <= 1000:
  if a <= n*0.08 < a+1 and b <= n*0.1 < b +1:
    print(n)
    break
  n += 1
  if n == 1001:
    print(-1)
    break

Solution (Python):
import sys
a, b = map(int, sys.stdin.readline().split())
i = 0
res = -1
while i <= 1000:
  if int(i*0.08) == a and int(i*0.1) == b:
    res = i
    break
  i += 1
print(res)

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

Solution (Python):
import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=math.floor,math.ceil
from collections import deque
Yes=lambda b:print('Yes')if b else print('No');YES=lambda b:print('YES')if b else print('NO')
is_even=lambda x:True if x%2==0 else False

def main():
  a,b=ints()
  A = {n for n in range(int(ceil(a/0.08)),int(ceil((a+1)/0.08)))}
  B = {n for n in range(int(ceil(b/0.1)),int(ceil((b+1)/0.1)))}
  print(min(A&B)) if len(A&B)!=0 else print(-1)
    
if __name__ == '__main__':
  main()

Solution (Python):
I = 1009
a,b = map(int,input().split());flag=0
for i in range(1,I):
    x = (i*8)//100;y=(i*10)//100
    if(x==a and y==b):
        print(i)
        flag=1
        break
if(flag==0):
    print(-1)

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

Solution (Python):
A,B = map(int,input().split())
X = B * 10
for i in range(X,X+10):
  if int(i * 0.08) == A:
    print(i)
    exit()
print('-1')

Solution (Python):
A,B=map(int, input().split())
L=[]
for i in range(2000):
    if A == int(i*0.08) and B ==int(i*0.1):
        L += [i]
if len(L) == 0:
    print(-1)
else:
    print(min(L))

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    A, B = map(int, input().split())
    ans = 10001
    for x in range(1, 10001):
        if 0 <= 8*x - 100*A < 100 and 0 <= 10*x - 100*B < 100:
            ans = min(ans, x)
    if ans == 10001:ans = -1
    print(ans)
if __name__ == "__main__":
    main()

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