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):
class Fraction_Error(Exception):
    pass

from fractions import gcd

class Fraction():
    
    def __init__(self,Numerator=0,Denominator=1):
        self.a=Numerator
        self.b=Denominator

    
    def __str__(self):
        if self.b==1:
            return str(self.a)
        else:
            return str(self.a)+"/"+str(self.b)

    
    def __add__(self,other):
        c=Fraction()
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        c.a=self.a*other.b+self.b*other.a
        c.b=self.b*other.b
        return Fraction.__reduce(c)

    def __radd__(self,other):
        c=Fraction()
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        c.a=self.a*other.b+self.b*other.a
        c.b=self.b*other.b
        
        return Fraction.__reduce(c)
    
    def __sub__(self,other):
        return self+(-other)

    def __rsub__(self,other):
        return -self+other

    def __mul__(self,other):
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        return Fraction.__reduce(Fraction(self.a*other.a,self.b*other.b))

    def __rmul__(self,other):
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        return Fraction.__reduce(Fraction(self.a*other.a,self.b*other.b))

    def __floordiv__(self,other):
        if other==Fraction():
            raise Fraction_Error("0除算です.")
        
        H=self/other
        return H.a//H.b

    def __rfloordiv__(self,other):
        if self==Fraction():
            raise Fraction_Error("0除算です.")

        H=other/self
        return H.a//H.b
    
    def __truediv__(self,other):
        if other==Fraction():
            raise Fraction_Error("0除算です.")
        
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        return self*Fraction.__inverse(other)

    def __rtruediv__(self,other):
        if self==Fraction():
            raise Fraction_Error("0除算です.")
        
        if not(isinstance(self,Fraction)):
            self=Fraction.Int_to_Fraction(other)
            
        return Fraction.__inverse(self)*other

    def __pow__(self,other):
        if other==0:
            return 1
        n=abs(other)

        g=1
        k=self
        for i in range(int(math.log(n,2))+1):
            if n%2==1:
                g*=k

            k*=k
            n=n>>1

        if other>0:
            return g
        else:
            return 1/g
        
    
    def __eq__(self,other):
        t=self-other
        if isinstance(t,Fraction):
            return t.a==0
        else:
            return t==0
    
    def __nq(self,other):
        return not(self==other)

    def __lt__(self,other):
        t=self-other
        if isinstance(t,Fraction):
            return t.a<0
        else:
            return t<0

    def __le__(self,other):
        return (self<other) or (self==other)

    def __gt__(self,other):
        return -self<-other

    def __ge__(self,other):
        return (other<self) or (self==other)
    
    
    def ToNumber(self):
        return self.a/self.b

    def sign(self):
        s=self.a*self.b
        if s>0:return 1
        elif s==0:return 0
        else:return -1

    def __reduce(self):
        g=gcd(self.a,self.b)
        self.a//=g
        self.b//=g

        if self.b<0:
            self.a*=-1
            self.b*=-1
        return Fraction(self.a,self.b)

    def Int_to_Fraction(self):
        if not(isinstance(self,Fraction)):
            return Fraction(self,1)
        else:return self
        
    def __inverse(self):
        if self==Fraction():
            raise Fraction_Error("0の逆数は存在しまんせん.")
        
        return Fraction.__reduce(Fraction(self.b,self.a))
    
    def __pos__(self):
        return self

    def __neg__(self):
        return Fraction(-self.a,self.b)

    def __abs__(self):
        return max(self,-self)

import math
A,B=map(int,input().split())
alpha=Fraction(8,100)
beta=Fraction(10,100)

m=max(A/alpha,B/beta)
m=math.ceil(m.a/m.b)

M=min((A+1)/alpha,(B+1)/beta)
M=math.floor(M.a/M.b)

if m<M:
    print(m)
else:
    print(-1)

Solution (Python):
import math
A, B = map(int, input().split())
X = 1
F = False
while X <1500:
  if A == math.floor(X*0.08) and B == math.floor(X*0.1):
    F = True
    break
  else:
    X += 1
print(X if F else -1)

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

if a <= b:
    for i in range(1000000):
        if int(i*0.08) == a and int(i*0.1) == b:
            num = i
            break

        elif int(i*0.08) > a or int(i*0.1) > b:
            break

print(num)

Solution (Python):

import math

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

ans = -1
for i in range(1, 1050):
    a = math.floor(i * 0.08)
    b = math.floor(i * 0.10)
    
    if(a == A and b == B):
        ans = i
        break

print(ans)

Solution (Python):
import math
a,b = map(int, input().split())
A = int(math.floor(a * (100/8)))
A1 = int(math.ceil((a+1)*(100/8)))
B = int(math.floor(b * (100/10)))
B1 = int(math.ceil((b+1) * (100/10)))
X = []
Y = []
for i in range(A,A1+1):
  if int(math.floor(i*(8/100))) == a:
    X.append(i)
  else:
    pass
  
for i in range(B,B1+1):
  if int(math.floor(i*(10/100))) == b:
    Y.append(i)
  else:
    pass
    
if set(X)&set(Y) == set():
  print(-1)
else:
  Z = list(set(X)&set(Y))
  Z.sort()
  print(Z[0])

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

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

Solution (Python):
import math

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

p8min = math.ceil(a * 100 / 8)
p8max = math.ceil((a+1)*100 / 8) - 1

p10min = b * 10
p10max = (b + 1) * 10 - 1

p = max(p8min, p10min)

if p <= p8max and p <= p10max:
    print(p)
else:
    print(-1)

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

if(a%2 == 1):
    a_h = (a+1)*100 // 8
    a_l = a*100 // 8 + 1
else:
    a_h = (a+1)*100 // 8 + 1  
    a_l = a*100 // 8
b_h = (b+1)*10
b_l = b*10

if(a_l >= b_h or b_l >= a_h):
    print(-1)
elif(a_l < b_l):
    print(b_l)
elif(b_l <= a_l):
    print(a_l)

Solution (Python):
import math
A,B = (int(x) for x in input().split())
LowEight = math.ceil((25*A)/2)
CheckL8  = math.floor(LowEight/10)
LowTen   = 10*B
CheckL10 = math.floor(LowTen*2/25)

if   (CheckL8==B) and (CheckL10==A):
    minC = LowEight
elif (CheckL8!=B) and (CheckL10==A):
    minC = LowTen
elif (CheckL8==B) and (CheckL10!=A):
    minC = LowEight
elif (CheckL8!=B) and (CheckL10!=A):
    minC = -1
print(minC)

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

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

for i in range(100000):
    a = int(i * 0.08)
    b = int(i * 0.1)
    if a == A and b == B:
        print(i)
        break
    if a > A or b > B:
        print(-1)
        break

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

Solution (Python):
import math

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

al = []
bl = []
for i in range(2000):
  t = math.floor(i * 0.08)
  if t == a:
    al.append(i)
for i in range(2000):
  t = math.floor(i * 0.1)
  if t == b:
    bl.append(i)

for i in range(len(al)):
  for j in range(len(bl)):
    if al[i] == bl[j]:
      print(al[i])
      exit(0)
print(-1)

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

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

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

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

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

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

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

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

import math

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

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

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

Solution (Python):

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

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

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

print(-1)

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

ans = -1
for n in range(1251):
    if int(n * 0.08) == a and int(n * 0.1) == b:
        ans = n
        break
print(ans)

Solution (Python):
import sys
a, b = map(int, input().split())
for i in range(1001):
    at = int(i * 0.08)
    bt = int(i * 0.10)
    if at == a and bt == b:
        print(i)
        sys.exit()
print(-1)

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

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

for x in range(1,1009):
    if math.floor(x * 0.08 )== a and math.floor(x * 0.1) == b:
        ans.append(x)

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

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

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

Solution (Python):
import math
a,b=map(int,input().split())
for m in range (math.ceil(a/0.08),int((a+1)/0.08)):
  if int(m*0.10)== b:
    print(m)
    break
else:
  print(-1)

Solution (Python):
import math

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

if A == 0 and B == 0:
    print(0)
    exit()

for i in range(1000):
    a = math.floor((i+1)*8/100)
    b = math.floor((i+1)/10)
    if A == a and B == b:
        print(i+1)
        exit()

print(-1)

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

print(-1)

Solution (Python):
a,b=map(int,input().split())
x=100*a/8
y=100/8*(a+1)
z=10*b
w=10*(b+1)
import math
if max(math.ceil(z),math.ceil(x))<min(y,w) :
    print(math.ceil(max(z,x)))
else:
    print(-1)

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

while True:
    if int(a*0.08) == A and int(a*0.10) == B:
        print(a)
        sys.exit()
    elif int(a*0.08) > A or int(a*0.10) > B:
        print('-1')
        sys.exit()
    else:
        a += 1

Solution (Python):
import math
A, B = map(int,input().split())
minA = math.ceil(A/0.08)
maxA = math.ceil((A+1)/0.08) -1
minB = math.ceil(B/0.1)
maxB = math.ceil((B+1)/0.1) -1

if (minA>maxB) or (minB>maxA):
    print(-1)
else:
    print(max(minA,minB))

Solution (Python):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

a,b = imap()
amin,mod = divmod(a*100, 8)
if mod: amin += 1
amax,mod = divmod((a+1)*100, 8)
if mod: amax += 1
bmin,bmax = b*10, (b+1)*10
ran = set(range(amin,amax)) & set(range(bmin,bmax))
ans = min(ran) if ran else -1
print(ans)

Solution (Python):
A,B = map(int, input().split())
a=[]
q=1
while True:
    if  int(q*0.08)==A:
        a.append(q)
    if int(q*0.08)>A:
        break
    q+=1
b=[]
w=1
while True:
    if  int(w*0.1)==B:
        b.append(w)
    if int(w*0.1)>B:
        break
    w+=1
    




e=max(a[0],b[0])

if e in a and e in b:
    print(e)
else:
    print('-1')

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

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

a_inf = a / 0.08
a_sup = (a + 1) / 0.08
b_inf = b / 0.1
b_sup = (b + 1) / 0.1
a_min = int(a_inf // 1)

a = a_min
al = []
while a < a_sup:
    if a_inf <= a < a_sup:
        al.append(a)
    a += 1

if al[0] >= b_sup:
    print('-1')
else:
    for i in range(len(al)):
        if b_inf <= al[i]:
            print(int(al[i]))
            break
    else:
        print('-1')

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

a_inf = a / 0.08
a_sup = (a + 1) / 0.08
b_inf = b / 0.1
b_sup = (b + 1) / 0.1
a_min = int(a_inf // 1)

a = a_min
al = []
while a < a_sup:
    if a_inf <= a < a_sup:
        al.append(a)
    a += 1

if al[0] >= b_sup:
    print('-1')
else:
    for i in range(len(al)):
        if b_inf <= al[i]:
            print(int(al[i]))
            break
    else:
        print('-1')

Solution (Python):
A, B = map(int, input().split())
ans = -1
for i in range(1,1101):
    if (int((i*8)/100)==A)  & (int((i*10)/100)==B):
        
        
        ans = i
        break

print(ans)

Solution (Python):
a, b = map(int, input().split())
aa = 0
aaa = 0
bb = 0
bbb = 0
x = True
for i in range(1, 1100):
    if a == int(i*0.08) and x:
        aa=i
        x = False
        continue
    if a ==int(i*0.08)-1:
        aaa = i-1
        break
x = True
for i in range(1, 1100):
    if b == int(i*0.1) and x:
        bb=i
        x = False
        continue
    if b ==int(i*0.1)-1:
        bbb = i-1
        break

if bb>=aa and bb <= aaa:
    print(bb)
elif aa >=bb and aa<= bbb:
    print(aa)
else:
    print(-1)

Solution (Python):
A, B = map(float, 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):
def main():
    a, b = map(int, input().split())
    al = int(a / 0.08 + 0.5)
    bl = int(b / 0.1)
    au = al + 12 - a % 2
    bu = bl + 9
    if bu < al or au < bl:
        print(-1)
    else:
        print(max(al, bl))


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    a, b = map(int, input().split())
    eight = [i for i in range(0, 2000) if a == int(i * 0.08)]
    ten = [i for i in range(0, 2000) if b == int(i * 0.1)]
    for i in eight:
        for j in ten:
            if i == j:
                print(i)
                return
    print(-1)


if __name__ == '__main__':
    main()

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

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

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

f = True
count = 0
while f:
    count += 1
    if int(count*0.08) == a and int(count*0.1) == b:
        print(count)
        break
    elif int(count*0.1) > b:
        print(-1)
        f = False

Solution (Python):
import math
A,B=map(int,input().split())
a1=math.ceil(A/0.08)
a2=math.ceil((A+1)/0.08)-1
b1=math.ceil(B/0.1)
b2=math.ceil((B+1)/0.1)-1

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

Solution (Python):

import sys
import math
from decimal import *

def solve(A: int, B: int):
    A = Decimal(str(A))
    B = Decimal(str(B))
    s8 = Decimal('0.08')
    s10 = Decimal('0.10')
    n8 = [math.ceil(A/s8), math.floor((A+1)/s8)]
    n10 = [math.ceil(B/s10), math.floor((B+1)/s10)]

    
    if n10[0] <= n8[0] < n10[1]:
        print(int(n8[0]))
    elif n8[0] <= n10[0] < n8[1]:
        print(int(n10[0]))
    else:
        print('-1')
    return



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

if __name__ == '__main__':
    main()

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

Solution (Python):
import math

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

min_price_A = A * 12.5
max_price_A = min_price_A + 12

min_price_B = B * 10
max_price_B = min_price_B + 9

if min_price_A <= min_price_B:
    if max_price_A >= min_price_B:
        print(int(min_price_B))
    else:
        print(-1)
else:
    if max_price_B >= min_price_A:
        print(math.ceil(min_price_A))
    else:
        print(-1)

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

i = min(int(A/0.08), int(B/0.1)) * 1.0
while(True):
  if int(i * 0.08) == A and int(i*0.1) == B:
    print(int(i))
    break
  i = 1.0 + i
  if int(i * 0.08) > A or int(i*0.1) > B:
    print('-1')
    break

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

curr1 , curr2 = int(math.ceil(A/0.08)), int(math.floor(B/0.1))
low , high = min(curr1,curr2), max(curr1,curr2)

while low <= high:
    c1 ,c2= int(low*0.08), int(low*0.1)
    if c1 == A and c2 == B:
        print(low)
        sys.exit(0)
    low+=1
print(-1)

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

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

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

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

print(-1)

Solution (Python):
a,b=map(int,input().split())
d=int(a/0.08)
u=int(b/0.1)
ans=-1
if min(d,u)>12:
    start=min(d,u)-12
else:
    start=0
for i in range(start,max(d,u)+13):
    if (int(i*0.08)==a)and(int(i*0.1)==b):
        ans=i
        break
print(ans)

Solution (Python):
A,B = map(int,input().split())
x = 0
up = int(min(12.5*(A+1),10*(B+1)))
down = int(max(12.5*A,10*B))
if up - down  >=1 :
  if max(12.5*A,10*B) == down:
    print(down)
  else:
    print(down+1)
else:
  print(-1)

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

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

print(-1)

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

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

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

Solution (Python):
import math
A, B = list(map(int,input().split()))
min1 = math.ceil(A / 0.08)
min2 = math.ceil(B / 0.1)
ans = max(min1, min2)

if int(ans * 0.08) == A and int(ans * 0.1) == B:
    print(ans)
else:
    print(-1)

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

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

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

x = a / 0.08
y = b / 0.1
left = math.floor(min(x, y))
right = math.ceil(max(x, y))
for i in range(left , right + 1):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        exit()
print('-1')

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

minA=(A*125+9)//10
maxA=((A+1)*125+9)//10 - 1
minB=(B*100+9)//10
maxB=((B+1)*100+9)//10 - 1

if max(minA,minB) <= min(maxA,maxB):
    print(max(minA,minB))
else:
    print(-1)

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

import math
flag = 0

for i in range(1250):
	if math.floor(i*0.08) == A and math.floor(i*0.1) == B:

		print(i)
		flag = 1
		break

if flag == 0:
	print(-1)

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

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

if __name__ == '__main__':
    main()

Solution (Python):
a,b = map(int,input().split())
import math
c = 0
for i in range(10*b,10*b+10):
    if math.floor(i*0.08)>=a and math.floor(i*0.08)<a+1:
        print(i)
        c = 1
        break
if c == 0:
    print(-1)

Solution (Python):
a, b=map(int, input().split())
import math
la=math.ceil(a/0.08)
ua=(a+0.9999999)//0.08
lb=math.ceil(b/0.1)
ub=(b+0.9999999)//0.1

if la<=lb and lb<=ua:
  print(lb)
elif lb<=la and la<=ub:
  print(la)
else:
  print(-1)

Solution (Python):
A,B=map(int,input().split())
a=A//0.08
b=B//0.1
S=sorted([b,b+1,b+2,b+3,b+4,b+5,b+6,b+7,b+8,b+9])
for s in S:
    if int(s*0.08)==A and int(s*0.1)==B:
        print(int(s))
        break
else:
    print(-1)

Solution (Python):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")



def main():
    A, B = map(int, input().split())
    ans = -1
    for n in range(1500):
        if int(n * 0.08) == A and int(n * 0.1) == B:
            ans = n
            break
    
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from math import floor

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

Solution (Python):
import math

tax_8, tax_10 = map(int, input().split())

price_8_min = tax_8 / 0.08
price_8_max = (tax_8 + 0.99) / 0.08

price_10_min = tax_10 / 0.1
price_10_max = (tax_10 + 0.99) / 0.1

if max(price_8_min, price_10_min) <= min(price_8_max, price_10_max):
    print(math.ceil(max(price_8_min, price_10_min)))
else:
    print('-1')

Solution (Python):

A,B=map(int,input().split())
flag=True
for i in range(B*10,(B+1)*10):
    if i*0.08//1==A:
        print(i)
        flag=False
        break
if flag:
    print(-1)

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

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

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

for i in range(math.ceil(A/0.08),math.ceil((A+1)/0.08)):
    A_se.add(i)

for i in range(math.ceil(B/0.1),math.ceil((B+1)/0.1)):
    B_se.add(i)

C = A_se & B_se
if len(C)==0:
    print(-1)
else:
    print(min(C))

Solution (Python):
import math

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

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

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

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

Solution (Python):
import math

a,b=map(int,input().split())
x=-1
xa=xb=0
for i in range(1,10000):
	xa=int(i*0.08)
	xb=int(i*0.10)
	if xa==a and xb==b:
		x=i
		break
print(x)

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

P = B*10
for i in range(P, P+10):
    if i*0.08 >= A and i*0.08 < A+1:
        print(i)
        break
else:
    print(-1)

Solution (Python):
from math import floor, ceil


def solve(A, B):
    candidates = set()
    for i in range(10):
        _A = A + i * 0.1
        x = _A / 0.08
        candidates.add(floor(x))
        candidates.add(ceil(x))
    

    for i in range(10):
        _B = B + i * 0.1
        x = _B / 0.1
        candidates.add(floor(x))
        candidates.add(ceil(x))
    

    ans = -1
    for c in candidates:
        if floor(c * 0.08) == A and floor(c * 0.1) == B:
            ans = min(ans, c) if ans != -1 else c

    print(ans)


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

Solution (Python):
import math as m
a,b=map(int,input().split())
flag=True
for i in range(1,100000):
    if m.floor(i*0.08)==a and m.floor(i*0.10)==b:
        flag=False
        print(i)
        break
if flag:
    print(-1)

Solution (Python):
import math as m
a,b=map(int,input().split())
flag=True
for i in range(1,100000):
    if ((i*(8))//100)==a and (i*10)//100==b:
        flag=False
        print(i)
        break
if flag:
    print(-1)

Solution (Python):

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

Solution (Python):
import sys
A, B = map(int, input().split())
Am = -(-A * 100 // 8)
AM = (A + 1) * 100 // 8
Bm = int(B * 10)
BM = int((B + 1) * 10)
for m in range(Am, AM):
    for mm in range(Bm, BM):
        if m == mm:
            print(m)
            sys.exit()
else:
    print('-1')

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):
import math
A, B = map(int, input().split())

eightlow = math.ceil(A/0.08)
eighthigh = int((A+1)//0.08)
tenlow = math.ceil(B/0.1)
tenhigh = int((B+1)//0.1)

eight = []
ten = []

for i in range(eightlow, eighthigh+1):
    eight.append(i)
for i in range(tenlow, tenhigh+1):
    ten.append(i)

for i in range(len(eight)):
    for j in range(len(ten)):
        if eight[i] ==ten[j]:
            print(eight[i])
            exit()

print(-1)

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

def c_rate(X, Y):
    for i in range(1010):
        if (math.floor(i * 0.08) == X) and (math.floor(i * 0.1) == Y):
            return i
    return -1

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

Solution (Python):
import numpy as np


A,B = map(int, input().split())
S = B*10
C = 0
for i in range(S+9,S-1,-1):
    if np.floor(i*0.08) == A:
        C = i
if C == 0:
    print(-1)
else:
    print(C)

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

n = int(a/float(0.08))
m = int(b/float(0.10))

if int(n*float(0.08)) == a:
  n = n
else:
  n += 1

if int(m*float(0.10)) == b:
  m = m
else:
  m += 1
  
if int(n*float(0.10)) == b and int(m*float(0.08)) != a:
  print(n)
elif int(n*float(0.10)) != b and int(m*float(0.08)) == a:
  print(m)
elif int(n*float(0.10)) == b and int(m*float(0.08)) == a:
  print(min(n, m))
else:
  print('-1')

Solution (Python):
a,b = map(int,input().split())
n = 1
ans = 0
while True:
    n += 1
    if (int(n*0.08) == a and int(n*0.10) == b):
        print(n)
        break
    if n >= (a+1)*10 and n >= (b+1)*10:
        print(-1)
        break

Solution (Python):
a,b=map(int,input().split())
la,ra=12.5*a,12.5*a+12.5
lb,rb=10*b,10*b+10
for i in range(lb,rb):
  if la<=i<ra:
    print(i)
    exit(0)
print(-1)

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

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

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

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

L1, R1 = -(-(100*A) // 8), -(-(100*(A+1)) // 8) - 1
L2, R2 = -(-(100*B) // 10), -(-(100*(B+1)) // 10) - 1
L = max(L1, L2)
R = min(R1, R2)

if L <= R:
    print(L)
else:
    print(-1)

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


import math
for i in range(1,1251):
    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())
ans = -1

for price in range(1, 1251):
    if int(price * 0.08) == A and int(price * 0.1) == B:
        ans = price
        break

print(ans)