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 math import floor, ceil
a, b = map(int, input().split())

a1 = ceil(12.5 * a)
if a % 2 == 0:
    a2 = floor(12.5 * (a + 1))
else:
    a2 = 12.5 * (a + 1) - 1

b1 = 10 * b
b2 = 10 * (b + 1) - 1

if b2 < a1 or a2 < b1:
    print(-1)
else:
    print(max(a1, b1))

Solution (Python):
a,b=map(int,input().split())
import math
ans=-1
for x in range(10,1001):
    s=math.floor(x*0.08)
    t=math.floor(x*0.10)
    if s==a and t==b:
        ans=x
        break
print(ans)

Solution (Python):
import math
a,b=map(float,input().split())
for i in range(1,1001):
    if math.floor(i*(1.08))-i==a and math.floor(i*(1.10))-i==b:
        print(i)
        break
    elif i==1000:
        c=-1
        print(c)

Solution (Python):
import math
a, b = map(int, input().split())
diff = b - a
if diff > 20:
    print(-1)
else:
    x1 = (diff - 1) * 50
    x2 = (diff + 2) * 50
    flg = 0
    for i in range(x1, x2, 1):
        if(math.floor(i * 0.08) == a):
            if(math.floor(i * 0.1) == b):
                print(i)
                flg = 1
                break
    if flg == 0:
        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.10) == B) :
        print(i)
        break
    if i == 1250:
        print(-1)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

a, b = input_nums()

a_rate = 0.08
b_rate = 0.1

al = int(a / a_rate)
ar = int((a+1) / a_rate)
bl = int(b / b_rate)
br = int((b+1) / b_rate)

ans = 0
if bl <= al and al < br:
    ans = al
elif al <= bl and bl < ar:
    ans = bl
else:
    ans = -1

if not ans == -1 and int(ans*0.08) < a:
    ans += 1
    if int(ans*0.1) > b:
        ans = -1
print(ans)

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

for x in range(1, 1251):
    A = int(x/100*8)
    B = int(x/10)
    
    if a==A and b==B:
        print(x)
        exit()
print(-1)

Solution (Python):


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

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

Solution (Python):
AB = list(map(int, input().split()))
A = AB[0]
B = AB[1]
ans = 0

B_list = [B*10 + i for i in range(10)]

for i in B_list:
  if int((i) * 0.08) == A:
    ans = i
    break

if ans == 0:
  ans = -1

print(ans)

Solution (Python):

import math
import numpy as np

s = input()
num = s.split(" ")
A = int(num[0])
B = int(num[1])

tax_8 = []
tax_10 = []

for i in range(10001):
  tax_8.append([math.floor(i*0.08)])
  tax_10.append([math.floor(i*0.1)])

tax_8_np = np.array(tax_8)
tax_10_np = np.array(tax_10)

tax_8_candidate = list(np.where(tax_8_np==A)[0])
tax_10_candidate = list(np.where(tax_10_np==B)[0])

candidate = list(set(tax_8_candidate)&set(tax_10_candidate))

if len(candidate)==0:
  print(-1)
else:
  print(int(np.array(candidate).min()))

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

minA = A / 0.08
maxA = (A+1) / 0.08
minB = B / 0.1
maxB = (B+1) / 0.1

if minB <= minA and minA < maxB: print(int(minA) + (1 if minA > int(minA) else 0))
elif minA <= minB and minB < maxA: print(int(minB) + (1 if minB > int(minB) else 0))
else: print("-1")

Solution (Python):

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





min_na = int(12.5 * a)
max_na = int(12.5 * (a + 1))
min_nb = int(10 * b)
max_nb = int(10 * (b + 1))

ret = -1
for i in range(min(min_na, min_nb), max(max_na, max_nb) + 1):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        ret = i
        break

print(ret)

Solution (Python):

import math
import sys
a,b=map(int, input().split())

y = math.floor(b/0.1)

for i in range(y,y+10):
    if math.floor(i * 0.08) == a:
        print(i)
        sys.exit(0)
print(-1)

Solution (Python):
A,B=map(int,input().split())
n=1
a=0
b=0
flag=1

while flag==1:

    if a==A and b==B:        
        flag=0
        print(n)
            
    elif a>A or b>B:
        
        flag=0
        print(-1)
        
    
    else:
        
        n+=1
        a=int(n*0.08)
        b=int(n*0.1)

Solution (Python):
import sys

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

for price in range(1, 1251):
    if int(price * 0.08) == a :
        if int(price * 0.1) == b :
            print(price)
            sys.exit()
print(-1)

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

Amin= A*100/8
AMAX= (A+1)*100/8
Bmin= B*100/10
BMAX= (B+1)*100/10

Alist=[0]*1257
Blist=[0]*1257
ANSlist=[10000]*1257

for i in range(1257):
    if Amin <=i <AMAX:
        Alist[i]=i

for i in range(1257):
    if Bmin <=i <BMAX:
        Blist[i]=i

for i in range(1257):
    if Alist[i]!=0 and Blist[i]!=0:
        ANSlist[i]=i

if min(ANSlist)==10000:
    print(-1)
else:
    print(min(ANSlist))

Solution (Python):


import math

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

a_target1 = a / 0.08
a_target2 = (a + 1) / 0.08

b_target1 = b / 0.1
b_target2 = (b + 1) / 0.1


result_list = []

for i in range(math.ceil(a_target1), math.ceil(a_target2)):
    if i >= b_target1 and i < b_target2:
        result_list.append(i)

if result_list == []:
    print(-1)
else:
    result = min(result_list)
    print(result)

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

if a%2==0:
  lower1=int(a*100/8)
  upper1=(a+1)*100/8
  upper1=max(lower1,int(upper1)-1)  
else:
  lower1=a*(100/8)
  upper1=int((a+1)*100/8)
  if (upper1)-int(lower1)<=1:
    print(-1)
    sys.exit()
  else:
    lower1=int(lower1)+1
    if lower1==upper1:
      print(-1)
      sys.exit()
    else:
      pass
  
lower2=(b)*10
upper2=(b+1)*10

lower=max(lower1,lower2)
upper=min(upper1,upper2)
if upper-lower<1:
  print(-1)
else:
  print(lower)

Solution (Python):
import math

a,b = map(int,input().split())
er=a/0.08
el=(a+1)/0.08
tr=b/0.1
tl=(b+1)/0.1
le = []
lt = []
for i in range(math.ceil(er),math.ceil(el)):
  le.append(i)
for i in range(math.ceil(tr),math.ceil(tl)):
  lt.append(i)
if list(set(le)&set(lt)) == []:
  print(-1)
else:
  print(min(list(set(le)&set(lt))))

Solution (Python):
A,B=map(float,input().split())
A_min=int(A/8*100)
A_max=int((A+1)/8*100)+1
ans=0
flag=False
if (A+1)*100%8==0:
    A_max=int((A+1)*100/8)
for i in range(A_min,A_max):
    if int(i*0.1)==B:
        ans=i
        flag=True
        break
if int(ans*0.08)!=A:
    ans+=1
if flag:
    print(ans)
else:
    print(-1)

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

Solution (Python):
from math import ceil

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

a_btm = ceil(a*100/8)
a_top = int((a+1)*100/8)

b_btm = b*10
b_top = (b+1)*10 -1

minn = min(a_btm,a_top,b_btm,b_top)
maxx = max(a_btm,a_top,b_btm,b_top)

ans = -1
for i in range(minn,maxx+1):
    if int(i*0.08)==a and int(i*0.1)==b:
        ans = i
        break

print(ans)

Solution (Python):

import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    A,B = LMIIS()
    
    from math import ceil,floor
    
    
    
    
    
    
    
    for i in range(1,100000):
        if floor(i *0.08) == A and floor(i *0.1) == B:
            print(i)
            return
    print(-1)

    

if __name__ == '__main__':
    main()

Solution (Python):
import math

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

def check(A,B):
    for i in range(0,A*8+B*10):
        ans1 = i * 0.08
        ans2 = i * 0.1
        if int(ans1) == A and int(ans2) == B:
            return i
    return -1

print(check(A,B))

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

eightper = 0.08
tenper = 0.1
ans = -1
for i in range(1,1000+1):
    if int(i*eightper)==a:
        if int(i*tenper)==b:
            ans=i
            break
print(ans)

Solution (Python):
a, b = (float(x) for x in input().split())
list8 = []
ans = -1
for i in range(12500):
  if int(i * 0.08) == a:
    list8.append(i)
for j in range(10000):
  if int(j * 0.1) == b:
    if j in list8:
      ans = j
      break
print(ans)

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

Solution (Python):
import math

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

count = 1
while True:
  if math.floor(count*0.08) == a and math.floor(count*0.1) == b:
    print(count)
    break
  if math.floor(count*0.08) > a or math.floor(count*0.1) > b:
    print('-1')
    break
  count += 1

Solution (Python):

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

flag=0
x = 1
while flag<=1:
     AA = int(x*0.08)
     BB = int(x*0.1)
     if AA==A:
         flag=1
         if BB==B:
             flag=2
             break
     elif AA>A:
         x='-1'
         break
     x+=1

print(x)

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

A, B = map(int, input().split(' '))
A_list = [i/10+A for i in range(0, 10)]
B_list = [i/10+B for i in range(0, 10)]
x, y = 0, 0
a_set = set()
b_set = set()
for a in A_list:
    a_set.add(math.ceil(a/0.08))
for b in B_list:
    b_set.add(math.ceil(b/0.1))
ans_list = list(a_set & b_set)
if len(ans_list) == 0:
    print(-1)
else:
    print(int(min(ans_list)))

Solution (Python):

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


a = -(-A*100//8)
b = B*10

ans = a
if a < b:
    ans = b

if ans*8//100 == A and ans//10 == B:
    print(ans)
else:
    print(-1)

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

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

result = []
for i in range(1, 100000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        result.append(i)

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

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


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

n=1
while n<=2*10**4:
  if int(n*0.08)==a and int(n*0.1)==b:
    print(n)
    exit()
  else:
    n+=1
print(-1)

Solution (Python):
import math

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



a_1=math.ceil(A*12.5)
a_2=math.ceil((A+1)*12.5)
la=list(range(a_1,a_2))

b_1=int(format(B*10 ,'.0f'))
b_2=int(format((B+1)*10 ,'.0f'))
lb=list(range(b_1,b_2))

la_lb_and_list = list(set(la) & set(lb))

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

Solution (Python):

import math

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

x1 = math.ceil(a / 0.08)
y1 = math.floor((a+1) / 0.08)
if y1 == (a+1) / 0.08:
    y1 -= 1

x2 = math.ceil(b / 0.1)
y2 = math.floor((b+1) / 0.1)
if y2 == (b+1) / 0.1:
    y2 -= 1

if max(x1, x2) > min(y1, y2):
    print(-1)
elif x1 > y1 or x2 > y2:
    print(-1)
else:
    print(max(x1, x2))

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

Solution (Python):
from math import floor
A, B = list(map(int, input().split()))
for x in range(1, 1001):
    a = floor(x*0.08)
    b = floor(x*0.1)
    if a==A and b==B:
        print(x)
        break
    else:
        continue
else:
    print(-1)

Solution (Python):
import math

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


a_min_price = math.ceil(A*100/8)
a_over_price = math.ceil((A+1)*100/8)
b_min_price = math.ceil(B*100/10)
b_over_price = math.ceil((B+1)*100/10)



if((a_over_price <= b_min_price) or (b_over_price <= a_min_price)):
    print(-1)
else:
    if(a_min_price < b_min_price):
        print(b_min_price)
    else:
        print(a_min_price)

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

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

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


for i in range(1251):
    if i<1250:
        if int(i*0.08)==a and int(i*0.1)==b:
            print(i)
            break
    elif i==1250:
        print(-1)

Solution (Python):
import math
A,B = map(int,input().split())
x_A= int(math.ceil(25/2*A))
x_B= int(math.ceil(10*B))
large_num = x_A if x_A > x_B else x_B
result = 0
if int(large_num*0.08) == A and int(large_num*0.1) == B:
  result = large_num
else:
  result = -1
print(result)

Solution (Python):
import math
a, b = list(map(int,input().split()))
ao = a / 0.08
ao1 = (a+1) / 0.08
bo = b * 10
bo1 = (b+1) * 10
if bo <= ao < bo1:
    print(math.ceil(ao))
elif ao <= bo < ao1:
    print(bo)
else:
    print(-1)

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

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

a_plus = a+1
b_plus = b+1

price_a = int(a*(100/8))
price_aplus = int(a_plus*(100/8))
price_b = int(b*(100/10))
price_bplus = int(b_plus*(100/10))


if is_integer_num(a_plus*(100/8)):
  al = list(range(price_a+1, price_aplus))
else:
  al = list(range(price_a, price_aplus+1))
bl = list(range(price_b, price_bplus))

ans = list(set(al) & set(bl))

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

Solution (Python):
A,B=map(int,input().split())
A_list=[]
B_list=[]
for i in range(1201):
    if int(i*0.08)==A:
        A_list.append(i)
    if int(i*0.1)==B:
        B_list.append(i)
flg=0
for i in A_list:
    if i in B_list:
        print(i)
        flg=1
        break
if flg==0:
    print('-1')

Solution (Python):
import math
A,B=list(map(int,input().split()))
ans=-1
start=math.ceil(B*(10))
cntr=start
end=math.ceil((B+1)*(10))
while(cntr<end):
    if(math.floor(cntr*0.08)==A):
        ans=cntr
        break
    else:
        cntr+=1
print(ans)

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

A, B = [int(i) for i in input().strip().split()]











if 12.5*(A+1) <= 10*B:
  print(-1)
elif 10*(B+1) <= 12.5*A:
  print(-1)
else:
  X_min = max(12.5*A, 10*B)
  X_max = min(12.5*(A+1), 10*(B+1))
  if X_min <= X_max:
    if math.ceil(X_min) <= math.floor(X_max):
      print(math.ceil(X_min))
    else:
      print(-1)
  else:
    print(-1)

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

Solution (Python):
import math
[A, B] = list(map(int, input().split()))
flag = False
for i in range(1001):
  if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
    ans = i
    flag = True
    break

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

Solution (Python):
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
a ,b =i2()
n = int(a//0.08)
m = int(b//0.1)
for i in range(n+1,2*n):
    for j in range(m+1,2*m):
        if i == j and math.floor(i*0.08) == a  and b == math.floor(j*0.1):
            print(i)
            exit()
print(-1)

Solution (Python):
import math

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

ans = -1

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

Solution (Python):
import math

a,b = input().split()
c = int(a)
d = int(b)

tax8 = math.floor(c/0.08)
tax10 = int(d / 0.1)
ans = tax10
flag = True

while math.floor(ans * 0.1) == d:
    if math.floor(ans*0.08) == c and math.floor(ans * 0.1) == d:
        print(ans)
        flag = False
        break
    else:
        ans += 1

if flag:
    print(-1)

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


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

print(-1)

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


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

ans = -1

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

Solution (Python):
A, B = map(int, input().split())
x_a = int((A-1) * 100 / 8)
x_b = int((B+1) * 100 / 10)
l = [i for i in range(min(x_a, x_b)-1, max(x_a, x_b)+1)]
for n in l:
    if int(n * 0.08) == A and int(n * 0.10) == B:
        print(n)
        break
else:
    print(-1)

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

import math

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

if ans == 0:
  print(-1)

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

while 1:
  to += 100
  c = int(to * 0.08)
  d = int(to * 0.1)
  if c >= a and d >= b:
    to -= 100
    while 1:
      to += 1
      c = int(to * 0.08)
      d = int(to * 0.1)
      if c == a and d == b:
        print(to)
        exit()
      elif to % 100 == 0:
        print(-1)
        exit()

Solution (Python):
import math

a,b = (int(x) for x in input().split())
if (a*100)%8 == 0:
  amin = int(a/0.08)
else:
  amin = math.ceil(a/0.08)
if ((a+1)*100)%8 == 0:
  amax = int((a+1)/0.08)-1
else:
  amax = math.floor((a+1)/0.08)

if (b*100)%10 == 0:
  bmin = int(b/0.1)
else:
  bmin = math.ceil(b/0.1)
if ((b+1)*100)%10 == 0:
  bmax = int((b+1)/0.1)-1
else:
  bmax = math.floor((b+1)/0.1)
  
if amax < bmin or bmax < amin:
  print(-1)
else:
  la = list(range(amin,amax))
  lb = list(range(bmin,bmax))
  print(min(set(la) & set(lb)))

Solution (Python):
a,b=list(map(int,input().split()))
B=[10*b + i for i in range(10)]
for j in range(10):
    if int(B[j]*0.08)==a:
        print(B[j])
        exit()
print('-1')

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

a, b = MAP()

x1 = a / 0.08
y1 = b /0.1
x2 = (a+1) / 0.08
y2 = (b+1) /0.1



if ceil(y1) <= ceil(x1) < y2:
    ans = ceil(x1)
    print(ans)
elif ceil(x1) <= ceil(y1) < x2:
    ans = ceil(y1)
    print(ans)
else:
    print(-1)

Solution (Python):
import math
def main(a,b):
    p_min = math.ceil((12.5)*a)
    q_min = 10*b
    if p_min > q_min:
        ans = p_min
        if int(ans/10) == b:
            return ans
        return -1
    else:
        ans = q_min
        if int(ans/12.5) == a:
            return ans
        return -1

a,b = input().split()
print(main(int(a),int(b)))

Solution (Python):
def input_int_list():
    return [int(thing) for thing in input().split(" ")]
def No():
    print(-1)
    exit()
def eight(x):
    return int(x*0.08//1)
def ten(x):
    return int(x*0.1//1)

A,B=input_int_list()

for i in range(1,1009):
    if eight(i)==A and ten(i)==B:
        print(i)
        exit()
No()

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

for i in range(2000):
    ans88=int(i*0.08)
    ans1010=int(i*0.1)

    if(ans88==A and ans1010==B):
        print(i)
        exit()

print("-1")

Solution (Python):


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

min = -1

for i in range(1251):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        min = i
        break

print(min)

Solution (Python):
import math
A,B=map(int,input().split())
cost_A=math.ceil(A/0.08)
cost_B=B*10
if cost_B<cost_A:
    ans=cost_B
    while math.floor(ans*0.08) < A:
        ans+=1
        if math.floor(ans*0.1) >B:
            ans=-1
            break
elif cost_A<cost_B:
    ans=cost_A
    while math.floor(ans*0.1)<B:
        ans+=1
        if math.floor(ans*0.08) >A:
            ans=-1
            break
else:ans=cost_B
print(ans)

Solution (Python):
import math
x,y =map(int,input().split())
a=int(math.ceil(x/0.08))
b=(x+1)/0.08
W=int(b)
if b!=W:
    xx=[i for i in range(a,W+1)]
elif b==W:
    xx=[i for i in range(a,W)]    
c=int(y/0.1)
d=int((y+1)/0.1)
yy=[i for i in range(c,d)]
sx=set(xx)
sy=set(yy)
Q=list(sx&sy)
if len(Q)==0:
  print(-1)
else:
  print(min(Q))

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

mn = max(A/0.08,10*B)
mni = math.ceil(mn)
mx = min((A+1)/0.08,10*(B+1))
mxi = int(mx)



if mn <= mx and (mxi>mn and mx>mni):
    print(mni)
else:
    print(-1)

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

Solution (Python):
import math
A,B = map(int,input().split())
min_8=math.ceil(A*(100/8))
max_8=int((A+1)*(100/8))
if max_8==(A+1)*(100/8):
    max_8-=1
min_10=B*10
max_10=int((B+1)*10)-1
if max_8 < min_10:
    print("-1")
elif min_8 > max_10:
    print("-1")
elif max_8 >= min_10:
    if min_8 < min_10:
        print(min_10)
    elif min_8 >= min_10:
        print(min_8)

Solution (Python):
import math

A,B=map(int,input().split())
ans=-1
cnt=math.floor(A/0.08)
for i in range(cnt,1001):
  X8=math.floor(i*0.08)
  X10=math.floor(i*0.1)
  if X8 == A and X10 == B :
    ans=i
    break
print(ans)

Solution (Python):
import sys
import math
import 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(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
x = math.floor(A / 0.08)
y = math.ceil((A + 1) / 0.08)

flag = 0
for i in range(x, y):
    if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
        print(i)
        flag += 1
        break

if flag == 0:
    print(-1)

Solution (Python):
import math
A,B = map(int,input().split())
cnt = 0
while True:
    cnt += 1
    if math.floor(cnt * 0.08) == A and math.floor(cnt * 0.1) == B:
        print(cnt)
        exit()
    elif cnt == 10**5:
        print(-1)
        exit()

Solution (Python):
import math

string = input()
a = int(string.split()[0])
b = int(string.split()[1])

if int(100 * (a + 1) / 8) <= 10 * b:
    print(-1)
elif math.ceil(100 * a / 8) < 10 * b:
    print(10 * b)
elif math.ceil(100 * a / 8) < 10 * (b + 1):
    print(math.ceil(100 * a / 8))
else:
    print(-1)

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

for i in range(10100):
  x = (i * 0.08) // 1
  if x != a:
    continue
  else:
    y = (i * 0.1) // 1
    if y == b:
      print(i)
      break
else:
  print(-1)

Solution (Python):
lst = [int(i) for i in input().split()]
A = lst[0]
B = lst[1]
for x in range(10000):
    if int(x * 0.08) == A:
        if int(x * 0.1) == B:
            ans = x
            break
    else:
        ans = -1
print(ans)

Solution (Python):
inp = input().split(" ")
A, B = (int(inp[0]), int(inp[1]))
kouhoB = []
if A % 2 == 1:
    kouhoA = list(range(int(A * 12.5 + 1), int((A + 1) * 12.5)))
else:
    kouhoA = (list(range(int(A * 12.5), int((A + 1) * 12.5 + 1))))
num = B*10
while num <= B*10+9:
    kouhoB.append(num)
    num += 1
dottimo = list(set(kouhoA) & set(kouhoB))
if len(dottimo) >= 1:
    print(min(list(set(kouhoA) & set(kouhoB))))
else:
    print(-1)

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

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

Solution (Python):
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
a = list(map(int, input().split(" ")))
min8 = a[0]/0.08
max8 = (a[0]+1)/0.08
min10 = a[1]/0.1
max10 =(a[1]+1)/0.1
b = max(min8, min10)
if ((min8>=max10) or (max8<=min10)):
    print(-1)
else:
    print(Decimal(b).quantize(Decimal('0'), rounding = ROUND_HALF_UP))

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

Solution (Python):
import math


tax8, tax10 = map(int, input().split())

price8_ue = math.ceil((tax8 + 1) / 0.08) - 1
price8_shita = math.ceil(tax8 / 0.08)
price10_ue = math.ceil((tax10 + 1) / 0.1) - 1
price10_shita = math.ceil(tax10 / 0.1)

range8 = set(range(price8_shita, price8_ue))
range10 = set(range(price10_shita, price10_ue))
tax = range8 & range10
if not tax:
    print(-1)
else:
    print(min(tax))

Solution (Python):

def main():
  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)
      return
  print(-1)

main()

Solution (Python):



def main():
    a, b = map(int, input().split())
    numbers1 = list()
    numbers2 = list()

    for i in range(1, 1250 + 1):
        if int(i * 0.08) == a:
            numbers1.append(i)

    for i in range(1, 1000 + 1):
        if int(i * 0.1) == b:
            numbers2.append(i)

    c = set(numbers1) & set(numbers2)

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


if __name__ == '__main__':
    main()

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

prc1 = A / 0.08
prc1e = (A+1) / 0.08
prc2 = int(B / 0.1)
prc2e = int((B+1) / 0.1)

for p in range(prc2, prc2e):
    if A == int(p*0.08):
        print(p)
        break
else:
    print(-1)

Solution (Python):
import math

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

flg = 0
v = 0

for i in range(10000):
    c = math.floor(i * 0.08)
    d = math.floor(i * 0.10)

    if c == a and d == b:
        v = i
        flg = 1
        break

if flg == 1:
    print(v)
else:
    print(-1)

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())
result=[]
for N in range(10*B,10*B+10):
	if 100*A<=8*N and 8*N<100*A+100:
		result.append(N)
if len(result)==0:
	print(-1)
else:
	print(result[0])

Solution (Python):

i_str = input()
A,B = map(int,i_str.split())
import sys
import math




if A > B:
    print(-1)

for i in range(B*100):
    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())

i = 1
while i <= (100/0.08):
  if int(i * 0.08) == a and int(i * 0.1) == b:
    print(i)
    exit()
  i += 1
print('-1')

Solution (Python):
import math

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

    
    X_MAX = int(100 / 0.08)
    Y_MAX = int(100 / 0.10)

    x = int(A / 0.08)
    y = int(B / 0.10)


    for i in range(1, Y_MAX + 1):
        if int(i * 0.08) == A and int(i * 0.10) == B:
            print(i)
            return

    '''
    while x < X_MAX:
        y = int(B / 0.10)
        print("x: " + str(x))
        if x == y:
            print(x)
            return
        while y < Y_MAX:
            print(" y: " + str(y))
            y = y * 2
            if x == y:
                print(x)
                return
        x = x * 2
    '''
    print('-1')


if __name__ == "__main__":
    resolve()

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

is_true = False
for x in range(1, 10000):
    if A == math.floor(x * 0.08) and B == math.floor(x * 0.1):
        is_true = True
        break

if is_true:
    print(x)
else:
    print('-1')