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):
x, y = map(int, input().split())
tmp = range(int(y//0.1)+1, int((y+1)/0.1))
ans=-1
for i in range(int(x//0.08)+1, int((x+1)/0.08)):
    if i in tmp:
        ans=i
        break
print(ans)

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

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

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

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

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

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

Solution (Python):
import math

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

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

Amin = A + 0.0
Amax = A + 0.9
Bmin = B + 0.0
Bmax = B + 0.9
priceA = priceB = 0
priceAA = priceBB = 0

priceA = math.ceil(Amin / 0.08)
priceAA = math.ceil(Amax / 0.08)
priceB = math.ceil(Bmin / 0.10)
priceBB = math.ceil(Bmax / 0.10)

ansi = ansj = 0

for i in range(priceA, priceAA+1):
  if i == priceB:
    ansi = i
    break
  if i == priceBB:
    ansi = i
    break

for j in range(priceB, priceBB+1):
  if j == priceA:
    ansj = j
    break
  if j == priceAA:
    ansj = j
    break





if ansi == 0 and ansj == 0:
  print(-1)
else:
  if ansi ==0 or ansj == 0:
    print(max(ansi, ansj))
  else:
    print(min(ansi, ansj))

Solution (Python):
import math
A, B = map(int, input().split())
x1 = math.ceil(100 * A / 8)
x2 = 100 * (A+1) / 8
y1 = 100 * B / 10
y2 = 100 * (B+1) / 10
if x1 <= y1 and y1 < x2:
  print(int(y1))
elif y1 <= x1 and x1 < y2:
  print(int(x1))
else:
  print(-1)

Solution (Python):
import math
A, B = map(float, input().split())
p = max(A/0.08,B/0.1)
q = min((A+1)/0.08,(B+1)/0.1)
if q.is_integer():
    q = q-1
low = math.ceil(p)
high = math.floor(q)
if low>high:
    print(-1)
else:
    print(low)

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

if -(-a//0.08) < -(-(b+1)//0.1) and -(-b//0.1) < -(-(a+1)/0.08):
    print(int(max(-(-a//0.08), -(-b/0.1))))
else:
    print(-1)

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

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

Solution (Python):
import math

raw_input = input()
l = raw_input.split()
A = int(l[0])
B = int(l[1])

A_min = math.ceil((A*100)/8)
A_maxlim = math.floor(((A+1)*100)/8)



B_min = math.ceil((B*100)/10)
B_maxlim = math.floor(((B+1)*100)/10)



if A_min <= B_min and B_min < A_maxlim:
    print(B_min)
elif B_min <= A_min and A_min < B_maxlim:
    print(A_min)
else:
    print("-1")

Solution (Python):
from math import floor, ceil

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

pa1 = ceil(A * 100 / 8.0)
pa2 = floor((A * 100 + 100) / 8.0)
pb1 = ceil(B * 100 / 10.0)
pb2 = floor((B * 100 + 100) / 10.0)

p1 = max(pa1, pb1)
if p1 >= pa2 or p1 >= pb2:
    print(-1)
else:
    print(p1)

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

c = -1
for i in range(13, 1500):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        c = i
        break

print(c)

Solution (Python):
import math

a, b = map(int, input().split())
c1 = a / 0.08
c2 = b / 0.1
kouho = []
for i in range(10):
  if math.floor((c2 + i) * 0.08) == a: 
    print(int(c2 + i))
    exit()
print(-1)

Solution (Python):
import sys
import math
def input(): return sys.stdin.readline().rstrip()

def main():
    A, B = map(int, input().split())
    a = math.floor(A // 0.08)

    for i in range(a, a + 20):
        if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
            print(i)
            exit()
    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)
        exit()
print(-1)

Solution (Python):
import math
a, b = map(int, input().split())
a_min = a / 0.08
a_max = (a + 1) / 0.08
b_min = b / 0.1
b_max = (b + 1) / 0.1
if a_min > b_min:
  min = a_min
else:
  min = b_min
if a_max < b_max:
  max = a_max
else:
  max = b_max
min = math.ceil(min)
if math.floor(max) == max:
  max = max - 1 
else:
  max = math.floor(max)
if min <= max:
  print(min)
else:
  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)
    break
else:
  print(-1)

Solution (Python):
import math

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

m = math.ceil(a*(100/8))
while int(m*(8/100)) == a:
    if int(m*0.1) == b:
        print(m)
        break
    else:
        m += 1
else:
    print(-1)

Solution (Python):
import math

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


per8_list = []
for i in range(math.ceil(A / 0.08), math.ceil(A / 0.08)+13):
  if math.floor(i*0.08) == A:
    per8_list.append(i)
per8_set = set(per8_list)
per10_set = set(range(math.ceil(B / 0.1), math.ceil(B / 0.1)+10))

x = per8_set & per10_set

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

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

prca = math.ceil(a / 0.08)
prcb = math.ceil(b / 0.1)
base = max(prca, prcb)
while True:
    if int(base * 0.08) < a or int(base * 0.1) < b:
        ans = base + 1
        break
    base -= 1

if int(ans * 0.08) != a or int(ans * 0.1) != b:
    ans = -1
    
print(ans)

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

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



if a_min <= b_min <= a_max:
    print(b_min)
elif b_min <= a_min <= b_max:
    print(a_min)
else:
    print(-1)

Solution (Python):
from math import ceil
from math import floor
A, B = map(int, input().split())
a1 = ceil(A/0.08)
b1 = ceil(B/0.10)
a2 = floor((A+1)/0.08)-1
b2 = floor((B+1)/0.10)-1
if b2 < a1 or a2 < b1:
  print(-1)
else:
  print(max(a1, b1))

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

Solution (Python):
import math
a,b=map(int,input().split())
a_min=math.ceil(a*12.5)
a_max=math.ceil((a+1)*12.5)-1
b_min=math.ceil(b*10)
b_max=math.ceil((b+1)*10)-1
if a_min<=b_min:
    if a_max<b_min:
        print(-1)
    else:
        print(b_min)
else:
    if b_max<a_min:
        print(-1)
    else:
        print(a_min)

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

for i in range(1,1263):
    if (100/8)*(a) <= i < (100/8)*(a+1):
        A.append(i)
        
for i in range(1,1011):
    if (100/10)*(b) <= i < (100/10)*(b+1):
        B.append(i)
        
A = set(A)
B = set(B)

C = A&B

if len(C) > 0:
    print(min(C))
else:
    print(-1)

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

def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]

la = [-1]*10099
lb = [-1]*10099


for i in range(10099):
  la[i] = math.floor(i*0.08) 

for i in range(10099):
  lb[i] = math.floor(i*0.1)

alist = (my_index_multi(la,A))
blist = (my_index_multi(lb,B))

alist.sort()
blist.sort()


andl = list(set(alist) & set(blist))
andl.sort()
if len(andl) > 0:
  print(andl[0])
  
else :
  print(-1)

Solution (Python):



def main():
    tax_8, tax_10 = map(int, input().split())

    rate8 = 0.08
    rate10 = 0.1
    value8 = tax_8 / rate8
    value10 = tax_10 / rate10
    price_min = int(min(value8, value10))
    price_max = int(max(value8, value10)) + 1

    for price in range(price_min, price_max + 1):
        if int(price * rate8) == tax_8 and int(price * rate10) == tax_10:
            print(price)
            return 0
   
    print('-1')

    return 0


if __name__ == '__main__':
    main()

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

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

print(ans)

Solution (Python):
def ceil(n):
    return(n//1)

a,b=map(float,input().split())
t=[]
for i in range(10000):
    if ceil(i*0.08)==a and ceil(i*0.1)==b:
        t.append(i)
if len(t)==0:
    print(-1)
else:
    print(min(t))

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

Solution (Python):


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

na = int(A / 8)
if A % 8 > 0:
    na +=1
npa = int((A + 100) / 8)
if (A + 100) % 8 == 0:
    npa -= 1

nb = int(B / 10)
if B % 10 > 0:
    nb +=1
npb = int((B + 100) / 10)
if (B + 100) % 10 == 0:
    npb -= 1

if na <= npb and nb <= npa:
    print(max(na, nb))
else:
    print(-1)

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

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

mina = ceil(a/0.08)
minb = ceil(b/0.1)

la = []
lb = set()

flag = True
while flag == True:
    if int(mina * 0.08) == a:
        la.append(mina)
        mina += 1
    else:
        break
while flag == True:
    if int(minb * 0.1) == b:
        lb.add(minb)
        minb += 1
    else:
        break
for i in la:
    if i in lb:
        print(i)
        break
else:
    print(-1)

Solution (Python):
A,B=input().split()
a=int(A)
b=int(B)
am=a/0.08
aM=(a+1)/0.08
bm=b/0.1
bM=(b+1)/0.1
import math
am=math.ceil(am)
aMx=math.floor(aM)
if aMx==aM:
  aM=aMx-1
else:
  aM=aMx
bm=math.ceil(bm)
bMx=math.floor(bM)
if bMx==bM:
  bM=bMx-1
else:
  bM=bMx

if am<=bm:
  if bm<=aM:
    x=bm
  else:
    x=-1
else:
  if am<=bM:
    x=am
  else:
    x=-1
print(x)

Solution (Python):
import numpy as np

AB=np.array(input().split(" "),dtype=np.int32)

A=AB[0]
B=AB[1]

canA=A/0.08
canB=B/0.1

start=0
if(canA<canB):
    start=canA
else:
    start=canB

ans=-1
th=2*start
while (True):
    outA=int(start*0.08)
    outB=int(start*0.10)
    if(outA==A and outB==B):
        ans=start
        break
    if(start>2*th):
        break
    start+=1

print(int(ans))

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

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

Solution (Python):
a,b = (int(x) for x in 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())

N_A = A / 0.08
N_B = B / 0.1
A_list = [int(N_A + i) for i in range(20) if A <= int(N_A+i)*0.08 < A+1]
B_list = [int(N_B + i) for i in range(20) if B <= int(N_B+i)*0.1 < B+1]

N_min = float('inf')
for i in B_list:
    if i in set(A_list) and i < N_min:
        N_min = i
if N_min == float('inf'):
    print(-1)
else:
    print(N_min)

Solution (Python):
import math
a, b = list(map(int, input().split(' ')))
e = True
for i in range(11, 1010):
    n8 = math.floor(i * 0.08)
    n10 = math.floor(i*0.1)
    if n8 == a and n10 == b:
        print(i)
        e = False
        break
if e:
    print(-1)

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

Solution (Python):
import math

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

def func():
    b = B*10
    for i in range(b,2*b):
        if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
            return i
    return -1
    
print(func())

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

Solution (Python):

import sys
import math

def check1(k):
    return math.floor(k*0.08) == math.floor(k*0.1)

def check2(k, A , B):
    return math.floor(k*0.08) == A and math.floor(k*0.1) == B

def solve(A: int, B: int):
    k1 = A / .08
    k2 = B / .1

    min_k = math.floor(min(k1 - k1*0.08, k2 - k2 * 0.1))
    max_k = math.floor(max(k1 + k1*0.08, k2 + k2 * 0.1))

    
    

    ans = -1
    for k in range(min_k, max_k+1):
        c1 = check1(k)
        c2 = check2(k, A, B)
        if c2:
            ans = k
            break

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

import math
A, B = map(int, input().split())
X = math.ceil(A/0.08)
Z = -1
while True:
    if int(X*0.08) != A:
        break
    if int(X*0.10) == B:
        Z = X
        break
    X = X + 1
print(Z)

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

for i in range(9):
    j=b
    j+=i 
    if int(j*0.08)==a:
        ans=j
        break
if ans!=0:
    print(ans)
else :
    print(-1)

Solution (Python):
import math

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

min = int(math.ceil(a / 0.08))
max = min
while math.floor(max * 0.08) == a:
    max += 1

for i in range(min, max):
    if math.floor(i * 0.1) == b:
        print(i)
        break
else:
    print(-1)

Solution (Python):
isFound = False
li = list(map(int,input().split()))
min = int(li[0] / 0.08)
max = int((li[0] + 1) / 0.08) - 1
for i in range(min, max):
    if((int(i * 0.1) == li[1]) and (int(i * 0.08) == li[0])):
        print(i)
        isFound = True
        break
if(not(isFound)):
    print(-1)

Solution (Python):
a,b = map(int, input().split())
ans = -1
for i in reversed(range(1,1001)):
  if int(i*1.08)-i == a and int(i*1.10)-i == b:
    ans = i
print(ans)

Solution (Python):



def main():
    tax8, tax10 = map(int, input().split())

    rate8 = 0.08
    rate10 = 0.1
    value8 = tax8 / rate8
    value10 = tax10 / rate10
    price_min = int(min(value8, value10))
    price_max = int(max(value8, value10)) + 1

    for price in range(price_min, price_max + 1):
        if int(price * rate8) == tax8 and int(price * rate10) == tax10:
            print(price)
            return 0
   
    print('-1')

    return 0


if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())
amin = -(-a*25//2)
amax = -(-(a+1)*25//2)
bmin = b*10
bmax = bmin + 10
for i in range(amin, amax):
    for j in range(bmin, bmax):
        if i == j:
            print(i)
            exit()
print(-1)

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

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

print(ans)

Solution (Python):
import math

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

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

Solution (Python):
import math

def tax_increase(a, b):
    a_list = []
    b_list = []
    if (a+1.0)/0.08+1 == int((a+1.0)/0.08)+1:
        for i in range(math.ceil((a)/0.08), int((a+1.0)/0.08)):
            a_list.append(i)
    else:
        for i in range(math.ceil((a)/0.08), int((a+1.0)/0.08)+1):
            a_list.append(i)
    if (b+1.0)/0.1+1 == int((b+1.0)/0.1)+1:
        for i in range(math.ceil((b)/0.1), int((b+1.0)/0.1)):
            b_list.append(i)
    else:
        for i in range(math.ceil((b)/0.1), int((b+1.0)/0.1)+1):
            b_list.append(i)
    if a_list[0] == b_list[0]:
        return a_list[0]
    elif a_list[0] < b_list[0]:
        for a_i in a_list:
            if a_i in b_list:
                return a_i
    else:
        for b_i in b_list:
            if b_i in a_list:
                return b_i
    return -1

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

print(tax_increase(a, b))

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

Solution (Python):

import math

def main():
    t8, t10 = map(int, input().split())

    notax = math.ceil(max(t8 / 0.08, t10 / 0.1))
    nt_max = min((t8 + 1) / 0.08, (t10 + 1) / 0.1)

    if notax < nt_max:
        print(notax)
    else:
        print(-1)

if __name__ == '__main__':
    main()

Solution (Python):
a,b=map(int,input().split())
if ((25*a)+1)//2 > 10*b+9 or ((25*(a+1))-1)//2  < 10*b:
    print(-1)
else:
    print(max(10*b,((25*a)+1)//2))

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

xa=int(12.5*a-0.0001)+1
xb=10*b
x=max(xa,xb)
ra=int(x*0.08)
rb=int(x*0.1)

if ra==a and rb==b:
    print(x)
else:
    print(-1)

Solution (Python):
a, b = map(int, input().split())
a_max = (a + 1)/0.08
a_min = a / 0.08
b_max = (b + 1)/0.1
b_min = b / 0.1
u = 0
for i in range(int(b_max) + 1):
    if a_min <= i < a_max and b_min <= i < b_max:
        print(i)
        break
    else:
        u += 1
if u == int(b_max) + 1:
    print(-1)

Solution (Python):
import math

a = list(map(int, input().split()))
b = -1
for i in range(1001):
    x = math.floor(i*0.08)
    y = math.floor(i*0.1)
    if a[0] == x and a[1] == y:
        b = i
        break

print(b)

Solution (Python):
from math import floor, ceil

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



candidates = [floor(A/0.08),ceil(A/0.08),floor(B/0.10),ceil(B/0.10)]



ans = -1
for candidate in candidates:
    
    if floor(candidate*0.08) == A and floor(candidate*0.10) == B:
        ans = candidate
        break
print(ans)

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

import math

la = []
lb = []
for i in range(1001):
    if math.floor(0.08*i) == A:
        la.append(i)
    else:
        continue

for i in range(1001):
    if math.floor(0.1*i) == B:
        lb.append(i)
    else:
        continue

lab = set(la) & set(lb)

if not lab:
    print(-1)
else:
    print(min(lab))

Solution (Python):
import sys









mod = int(1e9+7)
INF = 1<<29

def main():
    a,b = map(int,input().split())
    ans = []
    x = int(min(a//0.08,b//0.1))
    y = int(max((a+1)//0.08,b//0.1))
    for i in range(x,y+1):
        if int(i*0.08)==a and int(i*0.1)==b:
            ans.append(i)
    if len(ans):
        print(min(ans))
    else:
        print(-1)
    return

if __name__=='__main__':
    main()

Solution (Python):
import math

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

priceA_min = math.ceil(A / 0.08)
priceA_max = math.ceil((A + 1) / 0.08)
priceB_min = math.ceil(B / 0.1)
priceB_max = math.ceil((B + 1) / 0.1)

priceAs = []
if priceA_min != priceA_max:
    price = priceA_min
    while True:
        if price >= priceA_max:
            break
        priceAs.append(price)
        price += 1
else:
    priceAs.append(priceA_min)

priceBs = []
if priceB_min != priceB_max:
    price = priceB_min
    while True:
        if price >= priceB_max:
            break
        priceBs.append(price)
        price += 1
else:
    priceBs.append(priceB_min)

P = False
for i in range(len(priceAs)):
    for j in range(len(priceBs)):
        if priceAs[i] == priceBs[j]:
            print(priceAs[i])
            P = True
            break
    if P == True:
        break
if P == False:
    print(-1)

Solution (Python):
a, b = map(int, input().split())
b = b/0.1
b_list = [i+b for i in range(10)]
for i in b_list:
    if int(i*0.08) == a:
        print(int(i))
        exit()
print("-1")

Solution (Python):




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

ep = list()
tp = list()


e_st = -1
e_ed = -1
t_st = -1
t_ed = -1

for i in range(1010):
    ep.append(int(i * 0.08))
    tp.append(int(i * 0.1))
    
    if e_st == -1 and ep[i] == a:
        e_st = i
    elif e_ed == -1 and e_st != -1 and ep[i] != ep[i-1]:
        e_ed = i - 1

    if t_st == -1 and tp[i] == b:
        t_st = i
    elif t_ed == -1 and t_st != -1 and tp[i] != tp[i-1]:
        t_ed = i - 1

ans = 0
if (e_ed < t_st and e_st < t_ed) or (t_ed < e_st and t_st < e_ed):
    ans = -1
else:
    ans = max(e_st, t_st)


print(ans)

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

Solution (Python):
import math

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

if a/(b+1) < 0.8 and 0.8 < (a+1)/b:
    mina = a/0.08
    minb = b/0.1
    bigger = max(mina, minb)
    print(math.ceil(bigger))
else:
    print(-1)

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

def no_tax(tax,tax_r):
    origin,min,max = 0,0,0
    while int(origin*tax_r) < tax:
        origin += 1
    min = origin
    while int(origin*tax_r) <= tax:
        origin += 1
    max = origin-1
    return (min,max)

A_min,A_max,B_min,B_max = \
no_tax(A,0.08)[0],no_tax(A,0.08)[1],no_tax(B,0.1)[0],no_tax(B,0.1)[1]

if A_min <= B_max and B_min <= A_max:
    print(max(A_min,B_min))
else:
    print(-1)

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

ans = -1
for x in range(20000):
  tmp1 = int(x*0.08)
  tmp2 = int(x*0.10)
  if((tmp1 == A)and(tmp2 == B)):
    ans = x
    break
print(ans)

Solution (Python):
import math

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

cnt = 0
for i in range(1,100000):
    X = math.floor(i * 0.08)
    Y = math.floor(i * 0.1)
    if A == X and B == Y:
        print(i)
        cnt += 1
        break
        
if cnt == 0:
    print(-1)

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


def main():
    x = int(A / 0.08) + 1
    y = int(B / 0.1) + 1

    p = max(x, y)
    correct = -1
    while True:
        if p < 0:
            break

        if int(p * 0.08) == A and int(p * 0.1) == B:
            correct = p

        p -= 1

    return correct


print(main())

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

Solution (Python):
a, b = map(int, open(0).read().split())

a_l = a / 0.08
a_r = (a + 1) / 0.08
b_l = b / 0.1
b_r = (b + 1) / 0.1

x_l = max(a_l, b_l)
x_r = min(a_r, b_r)

if x_l < x_r:
    if(x_l * 10 % 10 == 0):
        print(int(x_l))
    else:
        print(int(x_l + 1))
else:
    print(-1)

Solution (Python):

a,b = map(int,input().split())
a1=(a*100)//8
if (a*100)%8!=0:
    a1+=1
a2=(a+1)*100//8
b1=b*10
b2=(b+1)*10




for i in range(1,1250):
    if a1<=i<a2 and b1<=i<b2:
        print(i)
        exit()

print(-1)

Solution (Python):
from math import ceil

a, b = tuple(map(int, input().split()))
min_a = ceil(a / 0.08)
max_a = ceil((a + 1) / 0.08)
min_b = ceil(b / 0.1)
max_b = ceil((b + 1) / 0.1)

if (max_a <= min_b) or (max_b <= min_a):
    print(-1)
else:
    print(max(min_a, min_b))

Solution (Python):
import math
def ccc(a, b):

    for i in range(1, 100000):
        an = math.floor(i * 0.08)
        bn = math.floor(i * 0.1)
        if an == a and bn == b:
            return i
    return "-1"

def main():
    a , b = map(int , input().split())
    print(ccc(a , b))

if __name__ == '__main__':
    main()

Solution (Python):
import math

a,b = map(lambda x: int(x), input().split())


hati_s = a/0.08
hati_l = (a+1)/0.08

ten_s = b/0.1
ten_l = (b+1)/0.1




def intersec(a_min,a_max,b_min,b_max):
    if a_min < b_min:
        if a_max < b_min:
            return [0,0]
        else:
            if a_max < b_max:
                return [b_min,b_max]
            else:
                return [b_min,a_max]
    else:
        if b_max < a_min:
            return [0,0]
        else:
            if b_max < a_max:
                return [a_min,a_max]
            else:
                return [a_min,a_max]


def min_int(pair):
    if pair == [0,0]:
        return -1
    else:
        return math.ceil(pair[0])



tmp = intersec(hati_s,hati_l,ten_s,ten_l)

if math.ceil(tmp[0]) == math.ceil(tmp[1]):
    print(-1)
else:
    tst = min_int(tmp)
    if math.floor(tst*0.08) == a and math.floor(tst*0.1) == b:
        print(tst)
    else:
        print(-1)

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

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

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

print("-1")

Solution (Python):
AB = input().split(' ')
A = int(AB[0])
B = int(AB[1])
predictA = round(A/0.08)
if predictA < A/0.08:
    predictA += 1
predict_maxA = round((A+1)/0.08)
if predict_maxA < (A+1)/0.08:
    predict_maxA += 1
predictB = B*10
predict_maxB = (B+1)*10
preA = [x for x in range(predictA,predict_maxA)]
preB = [x for x in range(predictB,predict_maxB)]
pre = preA + preB
res = [x for x in set(pre) if pre.count(x) > 1]
if len(res)>0:
    print(min(res))
else:
    print(-1)

Solution (Python):
def main():
	a,b = map(int,input().split())
	import math
	ans = 0
	i = 2
	while i <= 1250:
		if math.floor(i * 0.08) == a and  math.floor(i *0.1) == b:
			print(i)
			ans = 1
			break
		else:
			i += 1
	if ans == 0:
		print(-1)

if __name__ == '__main__':
	main()

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

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

Solution (Python):
import math

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

res1 = math.floor(a / 0.08)

while True:
    if math.floor(res1 * 0.08) != a:
        res1 += 1
    else:
        break

while True:

    if math.floor(res1 * 0.1) == b and math.floor(res1 * 0.08) == a:
        print(res1)
        break
    elif math.floor(res1 * 0.1) > b or math.floor(res1 * 0.08) > a:
        print(-1)
        break    
    else:
        res1 += 1

Solution (Python):
import math

a, b = map(int, input().split())
MAX = 1001
for i in range(1, MAX):
  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())
a=math.ceil(A/0.08)
list=[]
count=0
while math.floor((a+count)*0.08)==A:
    list.append(a+count)
    count+=1
suuji=0

for b in list:
    if math.floor(b*0.1)==B:
        print(b)
        break
    else:
        suuji+=1
if suuji==len(list):
    print(-1)
else:
    pass

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

a = math.ceil(A/0.08)
b = math.ceil(B/0.1)
a2 = math.ceil((A+1)/0.08)
b2 = math.ceil((B+1)/0.1)
ans = max(a,b)
if a > b:
    if a >= b2:
        ans = -1
else:
    if b >= a2:
        ans = -1
print(int(ans))

Solution (Python):
import math

a, b = map(int, input().split())
MAX = 1001
for i in range(1, MAX):
  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())

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

if a % 2 == 0:
    a_min = int(a * 12.5)
else:
    a_min = int(a * 12.5) + 1

if (a + 1) % 2 == 0:
    a_max = int((a + 1) * 12.5) - 1
else:
    a_max = int((a + 1) * 12.5)

b_min = b * 10
b_max = (b + 1) * 10 - 1

if a_max < b_min:
    print("-1")
elif a_min <= b_min:
    print(int(b_min))
elif b_max >= a_min:
    print(int(a_min))
else:
    print("-1")

Solution (Python):
a, b = map(int, input().split())
if a * 100 % 8 == 0:
    low = max(a * 100 // 8, b * 10)
else:
    low = max(a * 100 // 8 + 1, b * 10)
if 100 * (a + 1) % 8 == 0:
    a_ = 100 * (a + 1) // 8 - 1
else:
    a_ = 100 * (a + 1) // 8

high = min(a_, 10 * (b+1) -1)

if low <= high:
    print(low)
else:
    print(-1)

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

X = 0

if math.ceil(A * (100 / 8)) >= math.ceil(B * 10):
    X = math.ceil(A * (100 / 8))
    if math.floor(X * 0.08) == A and math.floor(X * 0.1) == B:
        print(X)
    else:
        print(-1)
else:
    X = math.ceil(B * 10)
    if math.floor(X * 0.08) == A and math.floor(X * 0.1) == B:
        print(X)
    else:
        print(-1)

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

A_down = (25 * A ) //2
A_up = (25 * (A + 1 )) //2

if (A_down * 8 )//100 != A:
    A_down += 1

if (A_up * 8 )//100 != A:
    A_up -= 1


B_down = 10 * B
B_up = 10 * (B + 1) - 1 

if A_up < B_down or B_up < A_down:
    print(-1)
else:
    if  B_down <= A_down <= B_up:
        print(A_down)
    elif A_down <= B_down <= A_up:
        print(B_down)
    else:
        print(-1)

Solution (Python):
import math
a, b = list(map(int, input().split(' ')))
x = 10 * b
result = -1
for i in range(x, x+10):
    if math.floor(i * 0.08) == a:
        result = i
        break
print(result)

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

tax8 =0.08
tax10=0.1




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

org_a = math.ceil(A / tax8)
org_b = math.ceil(B / tax10)






if math.floor(org_a * tax8) == A and  math.floor(org_a * tax10) == B:
    print int(org_a)
elif math.floor(org_b * tax8) == A and math.floor(org_b * tax10) == B:
    print int(org_b)
else:
    print -1