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 deque, Counter as cnt
from collections import defaultdict as dd
from operator import itemgetter as ig
from bisect import bisect_right as bsr
from math import factorial, ceil, floor
import sys
sys.setrecursionlimit(1000000)


args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def nlist(n, v):
    if not n:
        return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def yesno(v):
    print(["Yes", "No"][not v])



def main():
    A, B = input([int, 2])

    for n in range(0, 1100):
        if floor(n * 0.08) == A and floor(n * 0.10) == B:
            print(n)
            break
    else:
        print(-1)


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

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

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

Solution (Python):
a,b=map(int,input().split())
aa=-(-a*25//2)
aaa=-(-(a+1)*25//2)-1
bb=b*10
bbb=(b+1)*10-1
if aaa<bb or bbb<aa:
  print(-1)
elif aa<bb:
  print(bb)
else:
  print(aa)

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

if __name__ == '__main__':
    main()

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

def shouhi(n,a,b):
    if (int(n * 1.08) -n == a) & (int(n * 1.1) -n== b):
        return True
    return False
ou = False
for n in range(int(a / 0.08), int(a / 0.08) + 13):
    if shouhi(n,a,b):
        print(n)
        ou = True
        break
if not ou:
    print(-1)

Solution (Python):
import math
A,B = (int(x) for x in input().split())
minA = math.ceil(A/0.08)
minB = math.ceil(B/0.1)
if minA > minB:
  if math.floor(minA*0.08) == A and math.floor(minA*0.1) == B:
    print(minA)
  else:
    print(-1)
else:
  if math.floor(minB*0.08) == A and math.floor(minB*0.1) == B:
    print(minB)
  else:
    print(-1)

Solution (Python):
a, b = map(int, input().split())
ass = 1 if ((100/8 * (a+1))-int(100/8 * (a+1))) else 0
asss = 1 if ((100/8 * a)-int(100/8 * a)) else 0
bss = 1 if ((100/10 * (b+1))-int(100/10 * (b+1))) else 0
bsss = 1 if ((100/10 * b)-int(100/10 * b)) else 0
As = set(range(int(100/8 * a)+asss, int(100/8 * (a+1))+ ass))
Bs = set(range(int(100/10 * b)+bsss, int(100/10 * (b+1))+bss))
if As & Bs:
    print(min(As&Bs))
else:
    print(-1)

Solution (Python):
from sys import stdin
A,B = list(map(int,stdin.readline().strip().split()))
ans=10**4+1
for x in range(10**4,0,-1):
    if int(x*0.08)==A and int(x*0.1)==B:
        if ans>x:ans=x
if ans==10**4+1:ans=-1
print(ans)

Solution (Python):
A,B = list(map(int, input().split()))
Z1_l = A * 25 / 2
if (A % 2) == 1:
    Z1_l = int(Z1_l) + 1
else:
    Z1_l = int(Z1_l)
Z1_u = (A + 1) * 25 / 2
if ((A+1) % 2) == 1:
    Z1_u = int(Z1_u) + 1
else:
    Z1_u = int(Z1_u)
Z2_l = B * 10
Z2_u = (B + 1) * 10
if Z2_u <= Z1_l or Z1_u <= Z2_l:
    ans = -1
else:
    ans = int(max(Z1_l,Z2_l))

print(ans)

Solution (Python):

import sys
input = sys.stdin.buffer.readline


from collections import defaultdict

con = 10 ** 9 + 7

def getlist():
	return list(map(int, input().split()))


def main():
	A, B = getlist()
	ans = 100000000
	for i in range(10, 1001):
		a = int(i * 0.08 // 1)
		b = int(i * 0.1 // 1)
		if a == A and b == B:
			print(i)
			return

	print(-1)

 

if __name__ == '__main__':
	main()

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

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

for i in range(1, 10000):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        if math.floor(i * 0.08) != 0:
            print(i)
            exit()

print(-1)

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

for x in range(1,1001):
  tax_8 = int(x * 0.08);
  tax_10= int(x * 0.1);
  if tax_8 == a and tax_10 == b:
    ans = x;
    break;
  elif x == 100:
    ans = -1;
  else:
    pass;
  
print(ans);

Solution (Python):
import math

a, b = map(int, input().split(' '))
aa = math.ceil(a / 0.08)
bb = math.ceil(b / 0.1)

if aa == bb:
    ans = aa
elif aa < bb:
    if math.floor(bb * 0.08) != a:
        ans = -1
    else:
        ans = bb
else:
    if math.floor(aa * 0.1) != b:
        ans = -1
    else:
        ans = aa
print(ans)

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

for i in range(B * 10, (B+1)*10 ):
    
    
    if int(i * 0.08) >= A and int(i * 0.08) < (A+1):
        print(i)
        flg = True
        break

if flg == False:
    print(-1)

Solution (Python):
import math
A,B = map(int,input().split())
for i in range(1,1001):
    if math.floor(i/12.5)==A and math.floor(i/10)==B:
        print(i)
        break
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)
        break
else:
    print(-1)

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


    return 

if __name__=="__main__":
    main()

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

e=[]
t=[]
for n in range(2000):
	if n*8//100==A:
		e.append(n)
for m in range(2000):
	if m//10==B and m in e:
		t.append(m)

if t==[]:
	print(-1)
else:
	print(t[0])

Solution (Python):
m,n=map(int,input().split())
l=[]
for i in range(1,12500):
    if i*2//25==m and i//10==n:
        l.append(i)
if len(l)==0:
    print(-1)
else:
    print(min(l))

Solution (Python):
def cul_even(x):
  return x // 2 * 25

def cul_odd(x):
  return x // 2 * 25 + 13

def test(a, b, x, func):
  if(b == func(a)//10):
      print(func(a))
  elif(b == (func(a)//10 + 1)):
      print((func(a)+x)//10*10)
  else:
      print(-1)

def main():
  a,b = map(int,input().split())
  if(a % 2 == 0):
    test(a, b, 12, cul_even)
  else:
    test(a, b, 11, cul_odd)

if __name__ == '__main__':
  main()

Solution (Python):
def cul_even(x):
  return x // 2 * 25
def cul_odd(x):
  return x // 2 * 25 + 13
def main():
  a,b = map(int,input().split())
  if(a % 2 == 0):
    if(b == cul_even(a)//10):
      print(cul_even(a))
    elif(b == (cul_even(a)//10 + 1)):
      print((cul_even(a)+12)//10*10)
    else:
      print(-1)
  else:
    if(b == cul_odd(a)//10):
      print(cul_odd(a))
    elif(b == (cul_odd(a)//10 + 1)):
      print((cul_odd(a)+11)//10*10)
    else:
      print(-1)

if __name__ == '__main__':
  main()

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

l8 = []
l10 = []
for i in range(100):
  p8 = round((A+0.01*i)/0.08, 10)
  p10 = round((B+0.01*i)/0.1, 10)
  if p8.is_integer():
    l8.append(p8)
  if p10.is_integer():
    l10.append(p10)

p = sorted(list(set(l8) & set(l10)))
if p == []:
  print(-1)
else:
  print(int(p[0]))

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

for i in range (1,1010):
  if i != 1009:
    if int(i * 0.08) == A and int(i * 0.10) == B:
      print(i)
      break
      
  if i == 1009:
    if int(i * 0.08) == A and int(i * 0.10) == B:
      print(i)
      break
      
    else:
      print('-1')

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

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

A_price_low = A / 0.08
B_price_low = B / 0.1
A_price_high = (A+1) / 0.08
B_price_high = (B+1) / 0.1

if B_price_low <= A_price_low < B_price_high:
    if A % 2 == 0:
        print(int(A_price_low))
    else:
        print(int(A_price_low) + 1)
elif A_price_low <= B_price_low < A_price_high:
    print(int(B_price_low))
else:
    print(-1)

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

Solution (Python):
import sys
A, B = [int(x) for x in input().split()]
for x in range(A*100//8,(B+1)*10):
  if A == x*8//100 and B == x//10:
    print(x)
    sys.exit()
print(-1)

Solution (Python):
import sys
A, B = [int(x) for x in input().split()]
for x in range(A*8//100,(B+1)*10):
  if A == x*8//100 and B == x//10:
    print(x)
    sys.exit()
print(-1)

Solution (Python):
import sys
A, B = [int(x) for x in input().split()]
for x in range(1010):
  if A == x*8//100 and B == x//10:
    print(x)
    sys.exit()
print(-1)

Solution (Python):

def main():
    args = input().rstrip().split(' ')
    A, B = int(args[0]), int(args[1])
    p_A = [A * 12.5, (A+1.) * 12.5]
    p_B = [B * 10., (B+1.) * 10.]
    if(p_A[0].is_integer() == False):
        p_A[0] = int(p_A[0])+1
    else:
        p_A[0] = int(p_A[0])
    if(p_B[0].is_integer() == False):
        p_B[0] = int(p_B[0])+1
    else:
        p_B[0] = int(p_B[0])
    if(p_A[1].is_integer == False):
        p_A[1] = int(p_A[1])
    else:
        p_A[1] = int(p_A[1]) -1
    if(p_B[1].is_integer() == False):
        p_B[1] = int(p_B[0])
    else:
        p_B[1] = int(p_B[1]) -1
        
        
    if(p_A[1] <= p_B[0] or p_B[1] <= p_A[0]):
        print('-1')
    else:
        print(int(max(p_A[0], p_B[0])))
    
if __name__ == "__main__":
    main()

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

A = list(range(math.ceil((a / 0.08)),int((a+1)/0.08)))
B = list(range(int((b / 0.1)),int((b+1)/0.1)-1))
price = set(A) & set(B)
if len(price) == 0:
    ans = -1
else:
    ans = min(price)
print(ans)

Solution (Python):
A, B = map(int, input().split())
import math
C = []
D = []
for i in range(10, 11000):
    if math.floor(i * 0.08) == A:
        C.append(i)

for i in range(10, 11000):
    if math.floor(i * 0.1) == B:
        D.append(i)

for c in C:
    if c in D:
        print(c)
        exit()

print(-1)

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import floor

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

Solution (Python):
from math import floor,ceil

def myAnswer(A:int,B:int) -> int:
   price = 1
   while True:
      if(floor(price*0.08)==A and floor(price*0.1)==B):
         return price
      elif(floor(price*0.08)>A or floor(price*0.1)>B):
         return -1
      else:
         price+=1
   

def modelAnswer(A:int,B:int) -> int:
   ans = max(ceil(A/0.08),ceil(B/0.1))
   return ans if(floor(ans*0.08)==A and floor(ans*0.1)==B) else -1

def main():
   A,B = map(int,input().split())
   print(modelAnswer(A,B))

if __name__ == '__main__':
   main()

Solution (Python):
from math import floor
def myAnswer(A:int,B:int) -> int:
   price = 1
   while True:
      if(floor(price*0.08)==A and floor(price*0.1)==B):
         return price
      elif(floor(price*0.08)>A or floor(price*0.1)>B):
         return -1
      else:
         price+=1
   

def modelAnswer():
   tmp=1
def main():
   A,B = map(int,input().split())
   print(myAnswer(A,B))

if __name__ == '__main__':
   main()

Solution (Python):

import math

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

ll = max(math.ceil(100 * a / 8), 10 * b)
up = min(math.ceil(100 * (a + 1) / 8), 10 * (b + 1))

if ll < up:
    print(ll)
else:
    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)
    exit()

print(-1)

Solution (Python):
a,b = map(int, input().split())
for i in range(1, 1100):
    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())
flag = 0
for i in range(2000):
    if (int(i*0.08) == A)&(int(i*0.1) == B):
        print(i)
        flag = 1
        break
if flag == 0:
    print("-1")

Solution (Python):
import sys

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

for p in range(1, int(2e3)):
    _A, _B = int(p*8e-2), int(p*1e-1)
    if _A == A and _B == B:
        print(p)
        sys.exit()

print('-1')

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

if a*100%8==0:
  amin=int(a*100/8)
elif a*100%8>0:
  amin=int(a*100/8)+1

if (a+1)*100%8==0:
  amax=int((a+1)*100/8-1)
elif (a+1)*100%8>0:
  amax=int((a+1)*100/8)

if b*100%10==0:
  bmin=int(b*100/10)
elif b*100%10>0:
  bmin=int(b*100/10+1)

if (b+1)*100%10==0:
  bmax=int((b+1)*100/10-1)
elif (b+1)*100%10>0:
  bmax=int((b+1)*100/8)
z=0
ans=[]
for i in range(amin,amax+1):
  for j in range(bmin,bmax+1):
    if i==j:
      ans.append(i)
    else:
      z+=1
if z==(amax+1-amin)*(bmax+1-bmin):
  print(-1)
else:
  print(ans[0])

Solution (Python):
a, b = map(int, input().split())
al = -((-a*100)//8)
ah = -((-(a+1)*100)//8)
bl = b*10
bh = (b+1)*10

if al>=bh or bl>=ah:
  print(-1)
else:
  print(max(al, bl))

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

for i in range(1,10001):
  a = i * 0.08
  b = i * 0.1
  if A <= a and a < A+1 and B <= b and b < B+1:
    print(i)
    exit(0)
    
print(-1)

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

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

Solution (Python):
import math

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

Solution (Python):

def main():
    a, b = map(int, input().split())
    c = a*12.5//10 * 10
    for i in range(20):
        if (c+i)*0.08//1 == a and (c+i)*0.1//1 == b:
            print(int(c+i))
            quit()
    print(-1)
    
if __name__ == '__main__':
    main()

Solution (Python):
import math
A, B = list(map(int,input().split()))
if math.ceil(A*12.5)>B*10:
    print(math.ceil(A*12.5) if math.ceil(A*12.5)<(B+1)*10 else -1)
else:
    print(B*10 if B*10<math.floor((A+1)*12.5) else -1)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

for i in range(1, 1001):
  if i*8//100 == A and i//10 == B:
    print(i)
    break
else:
  print(-1)

Solution (Python):



import sys
input = sys.stdin.readline

def main():
    A, B = map(int, input().split())
    ret = -1
    for x in range(1, 10000//8+1):
        if int(x*0.08) == A and int(x*0.10) == B:
            ret = x
            break

    print(ret)

if __name__ == '__main__':
    main()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

for i in range(1, 1001):
  if i*8//100 == A and i//10 == B:
    print(i)
    exit()
    
print(-1)

Solution (Python):
import math

A, B = map(int, input().split())
ans = -1
a1 = math.ceil(A*12.5)
a2 = (A+1)*12.5

a = [i for i in range(a1, int(a2)) if i < a2]

b1 = B*10
b2 = (B+1)*10

b = list(range(b1, b2))

for i in a:
    if i in b:
        ans = i
        break

print(ans)

Solution (Python):
A, B = map(int, input().split())
for i in range(1, 1003):
    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, 1001):
    if int(i * 1.08) - i == A and int(i * 1.1) - i == B:
        print(i)
        exit()

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)
        break
else:
    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(b * 10, b * 10 + 10):
    if (i * 2) // 25 == a:
        print(i)
        exit()
print("-1")

Solution (Python):
import sys

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

for q in range(0,10):
    p = 10*B + q
    if int(p * 0.08) == A:
        print(p)
        sys.exit(0)

print(-1)

Solution (Python):
a, b = map(int, input().split())
ok = False
for i in range(1,10000):
    if i*1.08//1-i == a and i*1.1//1-i == b:
        print(i)
        ok = True
        break
if not ok:
    print(-1)

Solution (Python):
import math

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

ans = -2
for i in range(10000):
    if math.floor((i+1) * 8/100) == a and math.floor((i+1)/10 ) == b:
        ans += i+3
        break

no_ans = -1
print(max(ans, no_ans))

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

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

Solution (Python):
A,B=map(int,input().split())
min_a=int(A//0.08)
max_a=int((A+1)//0.08)
min_b=B/0.1
max_b=(B+1)/0.1

sum=0
list=[ ]
for i in range(min_a+1,max_a):
    if min_b <= i < max_b:
        sum += 1
        list.append(i)
if sum==0:
    print(-1)
else:
    print(min(list))

Solution (Python):
a, b = map(int, input().split())
x = [0]*10
for i in range(10):
    x[i] = b*10 + i


for i in range(10):
    if a == int(x[i]*0.08):
        print(x[i])
        break
else:
    print(-1)

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

p = math.ceil(a/0.08)

if math.floor(p/10) == b:
    print(p)
else:
    while 1:
        p += 1
        if math.floor(p*0.08) == a:
            if math.floor(p*0.1) == b:
                print(p)
                break
        else:
            print("-1")
            break

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b=map(int,input().split())
    for x in range(1,1100):
        if int(x*0.08)==a and int(x*0.1)==b:
            print(x)
            break
    else:print(-1)

if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b=map(int,input().split())
    for x in range(1,1100):
        if int(x*0.08)==a and int(x*0.1)==b:
            print(x)
            break
    else:print(-1)

if __name__=='__main__':
    main()

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

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

for i in range(1,1024):
  if i//12.5 == a and i//10 == b:
    print(i)
    exit()
print(-1)

Solution (Python):
import math
def ma(): return map(int,input().split())

a,b=ma()
a_over=(a + 1)/0.08-0.0001
a_under=(a)/0.08
b_over=(b + 1)/0.1-0.0001
b_under= b/0.1

c_over = min(a_over,b_over)
c_under = max(a_under, b_under)

if math.floor(c_over)>=math.ceil(c_under):
    print(math.ceil(c_under))
else:
    print(-1)

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

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

Solution (Python):
p=input().split(" ")
a=int(p[0])
b=int(p[1])
c=a*10-1
d=int(a/0.07)-1
num=[]
ans=[]
for i in range(c,d+1):
    if int(i*0.08)==a:
        num.append(i)
l=len(num)

for i in range(l):
    if int(num[i]*0.1)==b:
        ans.append(num[i])
if ans==[]:
    print("-1")
else:
    print(ans[0])

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

for x in range(int(((25*A)+1)/2),int((25*(A+1)-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)-1)/2)-int(((25*A)+1)/2))*(int(10*(B+1))-int(10*B)):    
    print(-1)

Solution (Python):

A,B = list(map(int,input().split()))
z=0
for x in range(int(((25*A)+1)/2),int((25*(A+1)+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)+1)/2)-int(((25*A)+1)/2))*(int(10*(B+1))-int(10*B)):
    
    print(-1)

Solution (Python):
A,B = list(map(int,input().split()))
found = False
for i in range(1010):
    A_tax = int(i * 0.08)
    B_tax = int(i * 0.10)
    if A == A_tax and B == B_tax:
        print(i)
        found = True
        break
if not found:
    print("-1")

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

for i in range(1240):
  if int(i*0.08) == a and int(i*0.1) == b:
    c.append(i)
c.append(-1)

print(c[0])

Solution (Python):

"""
Created on Sun Apr 12 20:20:19 2020

@author: Kanaru Sato
"""

a, b = list(map(int, input().split()))
l = []

i = -(-1*a//0.08)

while 0.08*i < a+1:
    l.append(i)
    i += 1

flag = 0

for candidate in l:
    if 0.1*candidate < b+1 and 0.1*candidate >= b:
        print(int(candidate))
        flag = 1
        break

if flag != 1:
    print(-1)

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

for i in range(1,10001):
    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())
x = math.floor((a-1)/0.08)
y = math.floor((a+1)/0.08)
z = math.floor((b-1)/0.1)
w = math.floor((b+1)/0.1)

if y<z:
    print(-1)
    exit(0)

ans = []
for i in range(min(x,z), min(y,w)):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
        ans.append(i)

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

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

Solution (Python):
from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]

min_eight_ex_tax = float(A / 0.08)
max_eight_ex_tax = float((A + 1) / 0.08)
min_ten_ex_tax = int(B / 0.1)
max_ten_ex_tax = int((B + 1) / 0.1)

res = float(-1)
for x in range(min_ten_ex_tax, max_ten_ex_tax, 1):
    if min_eight_ex_tax <= x < max_eight_ex_tax:
        res = float(x)
        break

print(int(res))

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 sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
a = A*12.5
b = B*10
c = max(a, b)//1

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

print(-1)

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

for i in range (10100):
  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())
c = 0
for i in range(1, 1001):
    tax_8 = (i * 2 / 25) // 1
    tax_10 = (i / 10) // 1
    if tax_8 == a and tax_10 == b:
        print(i)
        c += 1
        break
if c == 0:
    print('-1')

Solution (Python):
a, b = map(int, input().split())
c=[]
for i in range(1250):
    if int(i*0.08) == a and int(i*0.1) == b:
        c.append(i)
c.append(-1)

print(c[0])

Solution (Python):
from math import floor as fl
from math import ceil as ce
a,b=map(int,input().split())
aini=ce(a/0.08)
bini=ce(b/0.1)
out=max(aini,bini)
r=-1
while fl(out*0.08)>=a and fl(out*0.1)>=b:
  if fl(out*0.08)==a and fl(out*0.1)==b:
    r=out
  out-=1
print(r)

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

Solution (Python):
import math

inputted = list(map(int, input().split()))
tax_price_a = inputted[0]
tax_price_b = inputted[1]

price_8 = math.ceil(tax_price_a / 0.08)
price_10 = math.ceil(tax_price_b / 0.10)

if tax_price_b == int(price_8 * 0.1):
    print(price_8)
elif tax_price_a == int(price_10 * 0.08):
    print(price_10)
else:
    print('-1')

Solution (Python):
a,b=map(int,input().split())
x=[]
y=[]
if a%2==0:
    x.append(25*a//2)
    x.append((25*a+24)//2)
    y.append(10*b)
    y.append(10*b+9)
    if x[1]<y[0] or y[1]<x[0]:
        print(-1)
    else:
        print(max(x[0],y[0]))
else:
    x.append(25 * a // 2+1)
    x.append((25 * a + 24) // 2)
    y.append(10 * b)
    y.append(10 * b + 9)
    if x[1] < y[0] or y[1] < x[0]:
        print(-1)
    else:
        print(max(x[0], y[0]))

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

for i in range(1, 1009):
    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())
flag=True
for i in range(10**6):
    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 math
a,b=map(int,input().split())
flag=True
for i in range(10**6):
    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 math
a,b=map(int,input().split())
flag=True
for i in range(10**7):
    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):
a,b=map(int,input().split())
s=0
for i in range(1,1251):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(str(i))
        s+=1
        break
if s==0:
    print("-1")

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

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

for i in range(1, 1251):
    if i * 8 // 100 == a and i // 10 == b:
        print(i)
        exit()
print('-1')

Solution (Python):
a,b = [int(i) for i in input().split()]
flag = False
for i in range(b*10,b*10+9):
  if i * 0.08 // 1 == a:
    print(i)
    flag = True
    break
if not flag:
  print(-1)

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

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


for i in range(3000):
    if i*8//100 ==A and i*10//100 ==B:
        print(i)
        exit()

print(-1)

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


for i in range(3000):
    if math.floor(i*0.08) ==A and math.floor(i*0.1) ==B:
        print(i)
        sys.exit()

print(-1)

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


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

print(-1)

Solution (Python):
import math

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

    ans = -1

    for i in range(1, 1251):
        at = math.floor(i * 0.08)
        bt = math.floor(i * 0.1)
        if at == A and bt == B:
            ans = i
            break
    
    print(ans)

main()

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

if a%2==0:
  SA=(a*25)//2
  LA=SA+12

else:
  SA=((a*25)//2)+1
  LA=SA+11


A=[x for x in range(SA,LA+1)]
B=[x for x in range(b*10,b*10+9)]

X=set(A) & set(B)
if len(X)==0:
  print(-1)
else: 
  print(min(X))