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



import sys,math

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    A, B = i2nn()
    a_left = math.ceil(A / 0.08)
    a_right = int((A+1) // 0.08)
    b_left = math.ceil(B / 0.1)
    b_right = int((B+1) // 0.1)
    
    left = max(a_left, b_left)
    right = min(a_right, b_right)
    if left < right:
        print(left)
    else:
        print(-1)
    return

main()

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

a=max(int(A//0.08),int(B//0.1))
for i in range(a,a+100):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        exit()
print(-1)

Solution (Python):
def solve():
    a,b=map(int,input().split())
    start=int(min(a*12.5,b*10))
    end=int(max((a+1)*12.5,(b+1)*10))

    for i in range(start, end):
        if (int(i * 0.08) == a and int(i * 0.1) == b):
            print(i)
            return
    print(-1)

solve()

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

if 12.5 * (a + 1) <= b * 10:
  print("-1")
elif b * 10 + 9 < 12.5 * a:
  print("-1")
else:
  print(max(math.ceil(12.5 * a), 10 * b))

Solution (Python):
from math import floor, ceil
A, B = [int(x) for x in input().split(" ")]

min_origin_a = ceil(A*12.5)     
max_origin_a = ceil((A+1)*12.5)       

flag = False
for i in range(min_origin_a, max_origin_a):
    if floor(0.1*i) == B:
        print(i)
        flag = True
        break

if not flag:
    print(-1)

Solution (Python):
a,b=map(int,input().split())
list1 = []
list2 = []
if (a/0.08).is_integer():
    c1 = int(a/0.08)
else:
    c1=int(a/0.08)+1
if ((a+1)/0.08).is_integer():
    c2 = int((a+1)/0.08)
else:
    c2=int((a+1)/0.08)+1

for i in range(c1,c2):
    list1.append(i)

if (b/0.10).is_integer():
    c3 = int(b/0.10)
else:
    c3=int(b/0.10)+1
if ((b+1)/0.10).is_integer():
    c4 = int((b+1)/0.10)
else:
    c4=int((b+1)/0.10)+1
for i in range(c3,c4):
    list2.append(i)

l3 = set(list1) & set(list2)
l3 = list(l3)
if len(l3) > 0:
    print(min(l3))
else:
    print(-1)

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

Solution (Python):
A, B = map(int, input().split())
f = False
for a in range(10, 12500):
    if int(a*0.08)==A and int(a*0.1)==B:
        f = True
        break
if f:
    print(a)
else:
    print(-1)

Solution (Python):
a=input()
a=a.split(' ')
A,B=int(a[0]),int(a[1])
flag=1
for i in range(1,1001):
    if (int(i*0.08)==A and int(i*0.1)==B):
        flag=0
        print(i)
        break;
if flag:
    print(-1)

Solution (Python):
import sys
import numpy as np



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

a_tax = a * 100 // 8

b_tax = b * 100 // 10

for money in range(a_tax, 1250):
    if (b == money // 10) and (a == money * 8 // 100):
        print(money)
        break
else:
    print("-1")

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

Solution (Python):


import sys

DEBUG = False

def solve():
    return


def read_int_list(sep = " "):
    return [int(s) for s in sys.stdin.readline().rstrip().split(sep)]

def read_int():
    return int(sys.stdin.readline())

def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


def main():
    a, b = read_int_list()
    for i in range(0, 1250):
        if int(i * 0.08) != a:
            continue
        if int(i * 0.1) != b:
            continue
        print(i)
        return
    print(-1)



if __name__ == "__main__":
    main()

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

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

import math

for i in range(1,1002):
  if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
    print(i)
    break
  elif i == 1001:
    print(-1)

Solution (Python):
import math

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

x = a*12.5
y = b*10

if x >= y:
	if x < y+10:
		ans = math.ceil(x)
	else:
		ans = -1
else:
	if y < x + 12.5:
		ans = math.ceil(y)
	else:
		ans = -1

print(ans)

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

res = -1

for i in range(1, (B + 1) * 10):
  x = int(i * 0.08)
  y = int(i * 0.1)

  if(A == x and B == y):
    res = i
    break

print(res)

Solution (Python):
import math
import numpy as np
a,b=[int(v) for v in input().split()]

min_8=math.ceil(a/0.08)
max_8=(a+1)//0.08

min_10=math.ceil(b/0.1)
max_10=(b+1)//0.1


range_8 = np.arange(min_8,max_8+1).astype(int)
range_10 = np.arange(min_10,max_10+1).astype(int)

try:
    print(min(np.intersect1d(range_8,range_10)))
except:
    print(-1)

Solution (Python):
import math
a,b = [int(i) for i in input().split()]
mina = math.ceil(a*100/8)
if (a+1)*100/8%1==0:
    maxa = (a+1)*100/8-1
else:
    maxa = math.floor((a+1)*100/8)

minb = math.ceil(b*100/10)
if (b+1)*100/10%1==0:
    maxb = (b+1)*100/10-1
else:
    maxb = math.floor((b+1)*100/10)



if minb<=mina and mina<=maxb:
    print(int(mina))
elif mina<=minb and minb<=maxa:
    print(int(minb))
else:
    print("-1")

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

ans = -1
i = 0
for i in range(10 ** 6):
    if int(i * 0.08) == a:
        if int(i*0.1) == b:
            ans = i
            break
        



print(ans)

Solution (Python):
import math
a,b = map(int,input().split())
for i in range(1,1300):
  eightper = math.floor(i*0.08)
  tenper = math.floor(i*0.1)
  if eightper == a and tenper == b:
    print(i)
    break
  if i == 1299:
    print(-1)
    break

Solution (Python):
a,b = map(int,input().split())
a0 = int(a/0.08)
a1 = int((a+2)/0.08)
def tmp():
    for i in range(a0,a1):
        if int(i *0.08) == a and int(i*0.1)==b:
            return i
    return -1
print(tmp())

Solution (Python):
A,B = [int(i) for i in input().split()]
for i in range(1,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())
flag = 0
for i in range(10*b, 10*(b + 1)):
    if int(i * 0.08) == a:
        flag = 1
        break
if flag:
    print(i)
else:
    print('-1')

Solution (Python):
A, B = map(int, input().split()) 
aaa = []
for i in range(1, 1251):
  if int(i*0.08) == A and int(i*0.1) == B:
    aaa.append(i)
    break
if A < 0 or B < 0:
  print(-1)
elif len(aaa) >= 1:
  print(min(aaa))
else:
  print(-1)

Solution (Python):
import math

a,b=map(int,input().split())
A=a/0.08
B=(a+1)/0.08
C=b/0.1
D=(b+1)/0.1

P=max(A,C)
Q=min(B,D)
if math.ceil(P)<Q:
    print(math.ceil(P))
else:
    print(-1)

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

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

Solution (Python):
a,b= map(int, input().split())
z=-1
x=int(a*12.5)
xx=int((a+1)*12.5)
y=b*10
yy=(b+1)*10
if x!=a*12.5:
    x=x+1
if xx==(a+1)*100/8:
    xx=xx-1
xxx= [i for i in range(x,xx+1)]
yyy= [i for i in range(y,yy)]
for i in range(len(xxx)):
    if xxx[i] in yyy:
        z=xxx[i]
        break
print(z)

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

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

Solution (Python):
mi = lambda : map(int,input().split())

a,b = mi()

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

Solution (Python):
import math

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

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

for i in range(0, 1250):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans.append(i)
if ans:
    print(min(ans))
else:
    print(-1)

Solution (Python):
import math
import sys

A, B = [int(element) for element in input().split(" ")]

temp = B * 10

for element in range(0, 10):
    if math.floor((temp + element) * 0.08) == A:
        print(str(temp + element))
        sys.exit(0)
        
print("-1")

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

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

Solution (Python):
import math
a,b = [int(i)for i in input().split()]
lower1 = math.floor(a/0.08)
upper1 = math.floor((a+1)/0.08)
lower2 = math.floor(b/0.1)
upper2 = math.floor((b+1)/0.1)
if math.floor(lower1*0.08)!=a:
    lower1+=1
if math.floor(upper1*0.08)!=a:
    upper1-=1
if math.floor(lower2*0.1)!=b:
    lower2+=1
if math.floor(upper2*0.1)!=b:
    upper2-=1
ans = max(lower1,lower2)
if ans<=min(upper1,upper2):
    print(ans)
else:
    print(-1)

Solution (Python):
import math

a, b = map(int, input().split(' '))
v_a_min = math.ceil(a * 25 / 2)
v_a_max = math.floor((a + 1) * 25 / 2) if (a + 1) % 2 != 0 else int((a + 1) * 25 / 2) - 1
v_a_set = set(range(v_a_min, v_a_max + 1))
v_b_min = b * 10
v_b_max = (b + 1) * 10 - 1
v_b_set = set(range(v_b_min, v_b_max + 1))

v_set = v_a_set & v_b_set
v = min(v_set) if v_set else -1

print(v)

Solution (Python):
import math

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

x = (A * 100 + 7) // 8
y = (B * 100 + 9) // 10
ans = max(x, y)

if (ans * 8) // 100 != A or (ans * 10) // 100 != B:
    ans = -1

print(ans)

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

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

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 = map(int,input().split())
ans = -1
for i in range(1,20000):
  if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
    ans = i
    break
print(ans)

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

ah=(a+1)//0.08
al=ceil(a/0.08)
bh=(b+1)//0.1
bl=ceil(b/0.1)

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

Solution (Python):
import sys

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

for i in range(1, 10 ** 5):
    if (i * 0.08) // 1 == A and  (i * 0.1) // 1 == B:
        print(i)
        sys.exit()

print(-1)

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

Solution (Python):
import math
a, b = map(int, input().split())
n = 1
while True:
  if math.floor(n * 0.08) == a and math.floor(n * 0.1) == b:
    print(n)
    exit()
  elif n == 1000:
    print(-1)
    exit()
  else:
    n = n + 1

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

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

pa = int(a * 100/8)
pb = int(b * 100/10)

ans1 = None
ans2 = None

for price in range(pb-1, pa+2):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans1 = price
        break

for price in range(pa-1, pb+2):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans2 = price
        break

if ans1 is None and ans2 is None:
    print(-1)
elif ans2 is None:
    print(ans1)
elif ans1 is None:
    print(ans2)
else:
    print(min(ans1,ans2))

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

f= False

for i in range(1011):
  t1 = math.floor(i*0.08)
  t2 = math.floor(i*0.1)
  if t1 == a and t2 == b:
    ans = i
    f = True
    break

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

Solution (Python):
from sys import stdin
import sys
import math

A,B = [int(x) for x in stdin.readline().rstrip().split()]
N1=int(A*100/8)
N2=int(B*10)
for i in range(B*20):
    N1=math.floor(i*0.08)
    if N1==A:
        N2=math.floor(i*0.1)
        if N2==B:
              print(i)
              sys.exit(0)
print(-1)

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

ans = -1

for i in range(1,10001):
    a = int(i*0.08)
    b = int(i*0.1)
    if a == A and b == B:
        ans = i
        break
print(ans)

Solution (Python):


import math
a,b = map(int,input().split())
kou = []
ans = 0
for i in range(10):
    kou.append(b*10 + i)
for i in range(10):
    if (kou[i] * 8)//100 == a:
        print(kou[i])
        ans = 1
        break

if ans == 0:
    print("-1")

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x == A) and (y == B)

answer = -1
for n in range(20000):
    if test(n):
        answer = n
        break
print(answer)

Solution (Python):
import sys, math
A,B=map(int,input().split())
C=math.ceil(A/0.08)
D=math.ceil(B/0.1)

Clis=[]
Dlis=[]

for i in range(C-13,C+14):
  if math.floor(i*0.08)==A:
    Clis.append(i)

for j in range(D-10,D+11):
  if math.floor(j*0.1)==B:
    Dlis.append(j)

for k in Clis:
  if k in Dlis:
    print(k)
    sys.exit()
print(-1)

Solution (Python):
tax_8, tax_10 = map(int, input().split())

k = int(tax_8 / 0.08)
kk = int((tax_8+1) / 0.08)
kkk = int(tax_10 / 0.1)
kkkk = int((tax_10+1) / 0.1)

for i in range(min(k, kkk), max(kk, kkkk)):
    if int(i * 0.08) is tax_8 and int(i * 0.1) is tax_10:
        print(i)
        exit()
print(-1)

Solution (Python):
a, b = map(int, input().split())
 
t = False
for i in range(1, 2000):
    if int(i*0.08) == a:
        if int(i*0.1) == b:
            t = True
            break
            
if t == True:
    print(i)
else:
    print("-1")

Solution (Python):
import math
A, B = map(int, input().split())
x1 = math.ceil(A * 100.0 / 8)
x2 = B * 10
y1 = math.ceil((A+1) * 100.0 / 8)
y2 = (B+1) * 10

r = -1
for p in range(max(x1,x2), min(y1,y2)):
    r = p
    break
print(r)

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

res1 = int(a // 0.08)
res11 = int((a + 1) // 0.08)
res2 = int(b // 0.1)
res21 = int((b + 1) // 0.1)
ans = -1






ran1 = max(res1, res2)
ran2 = min(res11, res21)
for i in range(ran1-1, ran2):
    ans1 = int(i * 0.08)
    ans2 = int(i * 0.1)
    if ans1 == a and ans2 == b:
        ans = i
        break

print(ans)

Solution (Python):
import math


def resolve():
    a, b = map(int, input().split())

    for i in range(10000):
        t8 = math.floor(i * 0.08)
        t10 = math.floor(i * 0.1)

        if t8 == a and t10 == b:
            print(i)
            return

    print(-1)
    
resolve()

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

def isOK(num):
    tax8 = num * 8 // 100
    tax10 = num * 10 // 100
    if tax8 == A and tax10 == B:
        return True
    else:
        return False

for i in range(1, 100001):
    if isOK(i):
        print(i)
        break
else:
    print(-1)

Solution (Python):
import math

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

for i in range(1,10000):
    a=math.floor(i*0.08)
    b=math.floor(i*0.1)
    if a==A and b==B:
        ans=i
        break
        
print(-1 if ans==100000 else ans)

Solution (Python):
import math

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

for i in range(1, 2000):
  if(math.floor(i*0.08) == A and math.floor(i*0.10) == B and flag == True):
    print(i)
    flag=False

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

Solution (Python):
a,b=map(int, input().split())
L=int(min(-(-a//0.08),-(-b//0.1)))
R=int(max(-(-(a+1)//0.08),-(-(b+1)//0.1)))
for x in range(L,R):
	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 num in range(1,10000):
    ai = num//(100/8)
    bi = num//(100/10)
    if (ai>100) or (bi>100):
        pass
    if (a==int(ai)) and (b==int(bi)):
        print(num)
        exit()
print(-1)

Solution (Python):
import sys
import math
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b = IL()

ans = 1
while ans < 10000:
  if int(ans*0.08) == a and int(ans*0.10) == b:
    print(ans)
    exit()
  ans += 1
print(-1)

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

min_a = int(a//0.08+1)
max_a = (a+1)//0.08
min_b = int(b//0.1+1)
max_b =  (b+1)//0.1

if min_a < min_b:
    if max_a >= min_b:
        print(min_b)
    else:
        print(-1)
else:
    if max_b >= min_a:
        print(min_a)
    else:
        print(-1)

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


first = [math.ceil(12.5*a), math.floor(12.5*a+12.5)]
second = [10*b, 10*b+9]
if second[0] < first[1] and first[0] < second[1]:
    print(max(second[0], first[0]))
else:
    print(-1)

Solution (Python):
from math import ceil, floor
A, B = map(int, input().split())
A_min = ceil(A*(100/8))
A_max = floor((A+1)*(100/8)) if A%2!=1 else (A+1)*(100/8)-1
B_min = ceil(B*10)
B_max = floor(((B+1)*10))-1
if A_min>B_max or A_max<B_min:
  print(-1)
elif A_min>=B_min:
  print(A_min)
elif B_min>=A_min:
  print(B_min)

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

Solution (Python):
if __name__ == '__main__':
    a, b = tuple([int(s) for s in input().split()])
    tr, cr = 0.08, 0.1

    tr_a = int(a / tr)
    tr_b = int(b / cr)

    i = min([tr_a, tr_b])
    while i <= max([tr_a, tr_b]):
        if int(i * tr) == a and int(i * cr) == b:
            break
        else:
            i += 1

    if int(i * tr) == a and int(i * cr) == b:
        print(i)
    else:
        print(-1)

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

x = 1
while int(x * 0.08) <= a or int(x * 0.1) <= b:
    if int(x*0.08) == a and int(x * 0.1) == b:
        print(x)
        exit()
    x += 1
print(-1)

Solution (Python):



def m():
	a, b=map(int, input().split())
	x=10*b
	
	for i in range(10):
		y=int((x+i)*0.08)
		if y==a:
			print(x+i)
			return
	
	print('-1')
	return
	
m()

Solution (Python):
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

A, B = read_int()

ra = 0.08
rb = 0.1
def solve():
    ans = -1
    aM = int((A + 1) // ra)
    am = int(A / ra)
    bM = int((B + 1) // rb)
    bm = int(B / rb)

    lb = min(am, bm)
    ub = max(aM, bM)
    for n in range(ub, lb - 1, -1):
        
        if int(math.floor(n * ra)) == A and int(math.floor(n * rb)) == B:
            ans = n
    return ans

if __name__ == "__main__":
    print(solve())

Solution (Python):
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

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

_a = int(a / 0.08)
_b = int(b / 0.1)

m = min(_a, _b)

ans = -1

while m < 1010:
    if int(m * 0.08) == a and int(m * 0.1) == b:
        ans = m
        break
    m += 1

print(ans)

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

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

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

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

    ans = -1
    for i in range(10000, 0, -1):
        if i//12.5 == a and i//10 == b:
            ans = i

    print(ans)

if __name__ == "__main__":
    main()

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

a_cand = list(range(math.ceil(a * 100 / 8), (a+1)* 100 // 8))
b_cand = list(range(math.ceil(b * 100 /10), (b+1)* 100 // 10))

if min(a_cand) > max(b_cand) or min(b_cand) > max(a_cand):
    print(-1)
else:
    print(max(min(a_cand),min(b_cand)))

Solution (Python):
import numpy as np
A, B = map(int, input().split())

x_A_max = (A+1)/0.08
x_A_min = np.ceil(A/0.08)

x_B_max = (B+1)/0.1
x_B_min = np.ceil(B/0.1)

if (x_A_max<=x_B_min)or(x_A_min>=x_B_max):
    print(-1)
elif x_A_min<x_B_min:
    print(int(x_B_min))
else:
    print(int(x_A_min))

Solution (Python):
import math

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


ans = -1

for i in range(1, 1251):
    
    a = int(math.floor(i * 0.08))
    b = int(math.floor(i * 0.1))

    if (a == A and b == B):
        ans = i
        break

print(ans)

Solution (Python):
import math

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

ans = -1
for i in range(1, 1001):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        ans = i
        break

print(ans)

Solution (Python):
import math

def read():
    A, B = list(map(int, input().strip().split()))
    return A, B

def solve(A, B, INF= 100000000):
    min_v = INF
    for i in range(1, 1000000):
        a = math.floor(i * 0.08)
        b = math.floor(i * 0.10)
        if a == A and b == B:
            return i
    return -1


if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

Solution (Python):
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

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

Solution (Python):
AB = input().split()

A = int(AB[0])
B = int(AB[1])




if A % 0.08 > 0:
  AA = A//0.08 + 1
else:
  AA = A//0.08
if B % 0.1 > 0:
  BB = B//0.1 + 1
else:
  BB = B//0.1
  
if AA > BB:
  solution = int(AA)
else:
  solution = int(BB)
  
if int(solution * 0.08) != A or int(solution * 0.1) != B:
  print(-1)
else:
  print(solution)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

def main():
    A,B = map(int, readline().decode('utf-8').split())
    eight_start = int(-(-A//0.08))
    eight_end = int(-(-(A+1)//0.08))
    for i in range(eight_start,eight_end):
        ten = int(i * 0.1)
        if ten == B:
            print(i)
            break
    else:
        print('-1')

    return
if __name__ == '__main__':
    main()

Solution (Python):
import math
def main():
  A,B=map(int, input().split())
  for i in range(math.ceil(A/0.08),math.ceil((A+1)/0.08)):
    if i in list(range(math.ceil(B/0.1),math.ceil((B+1)/0.1))):
      print(i)
      return
  print(-1)
  return
  
  
  
main()

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

Solution (Python):
A,B=map(int,input().split())
if A%2==0:
    set1={i for i in range((25*A)//2,(25*A+25)//2+1)}
    set2={i for i in range(10*B,10*B+10)}
    ans=set1.intersection(set2)
    if len(ans)>0:
        print(min(ans))
    else:
        print(-1)
else:
    set1={i for i in range((25*A)//2+1,(25*A+25)//2)}
    set2={i for i in range(10*B,10*B+10)}
    ans=set1.intersection(set2)
    if len(ans)>0:
        print(min(ans))
    else:
        print(-1)

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

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

Solution (Python):
import math
A,B = map(int,input().split())
x = math.ceil(A*12.5)
ans = -1
while(x < B*10+10):
    if((math.floor(x*0.08) == A) & (math.floor(x*0.1)==B)):
        ans = x
        break
    x+=1
print(ans)

Solution (Python):
import math
a, b= map(int, input().split())
for n in range(1, 20000):
  if math.floor(n*0.08) == a and math.floor(n*0.1) == b:
    break
    
if n != 19999:
  print(n)
else:
  print(-1)

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

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

for i in range(100000):
    if a == math.floor(i*0.08):
        if b == math.floor(i*0.1):
            num = i
            break
print(int(num))

Solution (Python):
from math import floor, ceil

def main():
  a, b = list(map(int, input().split()))
  a_min = ceil(a*12.5)
  a_max = (a+1)*12.5
  b_min = ceil(b*10)
  b_max = (b+1)*10
  
  if(b_min <= a_min and a_min<b_max):
    print(a_min)
    return
  if(a_min <= b_min and b_min<a_max):
    print(b_min)
    return
  print(-1)
  return

main()

Solution (Python):
S = [int(x) for x in input().split()]
A = S[0]
B = S[1]
ans = -1

for i in range(1000):
    num = (i+1)
    MotoA = int(num * 0.08)
    MotoB = int(num * 0.1)
    if MotoA == A and MotoB ==B:
        ans = num
        break

print(ans)

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

Solution (Python):

import math

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


c=0
d=0
c=max([math.floor(A/0.08),math.floor(B/0.1)])
d=min([math.ceil((A+1)/0.08),math.ceil((B+1)/0.1)])
z=-1
for i in range(c,d+1):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        z=i
        break
print(z)

Solution (Python):
def main():
  import sys
  import math
  input = sys.stdin.readline
  a,b=map(int,input().split())
  if b>=10:
    for i in range(b*10,b*10+10):
      if a==math.floor(i*0.08):
        print(i)
        exit()
    print(-1)
  else:
    for i in range(b*10,b*10+10):
      if a==math.floor(i*0.08):
        print(i)
        exit()
    print(-1)
if __name__=='__main__':
  main()

Solution (Python):
from sys import stdin
import math
A,B = [int(x) for x in stdin.readline().rstrip().split()]
f = False
for i in range(1,100000):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        print(i)
        f = True
        break
if not f:
    print(-1)

Solution (Python):
import math
a, b = list(map(int, input().split()))
ans = -1
for i in range(1100):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
        ans = i
        break

print(ans)

Solution (Python):
A,B = map(int,input().split())
if int(A/0.08) == (A/0.08):
  A_min = int(A/0.08)
else:
  A_min = int(A/0.08)+1

A_max = int((A+1)/0.08)-1

  
  
if int(B/0.1) == (B/0.1):
  B_min = int(B/0.1)
else:
  B_min = int(B/0.1)+1

B_max = int((B+1)/0.1)-1

if (A_max < B_min) or (B_max < A_min):
  print(-1)
elif A_min >= B_min:
  print(A_min)
else:
  print(B_min)

Solution (Python):
a, b  = [int(x) for x in input().split()]
ra = int(b / 10 * 100)
for n in range(ra, ra + 100):
    if int(n * 0.08) == a and int(n * 0.1) ==  b:
        print(n)
        exit()
print(-1)

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

mina = math.ceil(A/0.08)
if math.floor((A+1)/0.08) == (A+1)/0.08:
  maxa = (A+1)/0.08 -1
else:
  maxa = math.floor((A+1)/0.08)
minb = math.ceil(B/0.1)
if math.floor((B+1)/0.1) == (B+1)/0.1:
  maxb = (B+1)/0.1 -1
else:
  maxb = math.floor((B+1)/0.1)

if maxa < minb or maxb < mina:
  print(-1)
else:
  print(max(mina,minb))

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

ans=-1
for i in range(b_min,b_min+10):
    if int(i*0.08)==a:
        ans=i
        break
print(ans)

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

Solution (Python):
import math
import sys

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

a_min = math.ceil(a*12.5)
a_max = math.ceil((a+1)*12.5)
b_min = math.ceil(b*10)
b_max = math.ceil((b+1)*10)

ab_and = set(range(a_min, a_max)) & set(range(b_min, b_max))

if not ab_and:
    print(-1)
    sys.exit()

ab_and_sort = sorted(list(ab_and))

print(ab_and_sort[0])

Solution (Python):
import math
a, b = map(float, input().split())
for i in range(0, 1000000):
    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 x in range(1,1001):
  if math.floor(x*0.08)==a and math.floor(x*0.1)==b:
    print(x)
    exit()
print(-1)