Problem:
 Score : 300 points    Problem Statement Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1 .      Constraints  1 \leq A \leq B \leq 100  A and B are integers.         Input Input is given from Standard Input in the following format:  A  B       Output If there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1 .        Sample Input 1 2 2      Sample Output 1 25  If the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:   When the consumption tax rate is 8 percent: \lfloor 25 \times 0.08 \rfloor = \lfloor 2 \rfloor = 2 yen.  When the consumption tax rate is 10 percent: \lfloor 25 \times 0.1 \rfloor = \lfloor 2.5 \rfloor = 2 yen.   Thus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25 .       Sample Input 2 8 10      Sample Output 2 100  If the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:   When the consumption tax rate is 8 percent: \lfloor 100 \times 0.08 \rfloor = 8 yen.  When the consumption tax rate is 10 percent: \lfloor 100 \times 0.1 \rfloor = 10 yen.        Sample Input 3 19 99      Sample Output 3 -1  There is no price before tax satisfying this condition, so print -1 .

Solution (Python):
import math
import sys

A, B = list(map(lambda x: int(x), input().split()))
ten_pats = [i for i in range(B*10, B*10 + 10)]

for num in ten_pats:
  if int(num * 0.08) == A:
    print(num)
    sys.exit()

print(-1)

Solution (Python):

a,b = map(int, input().split())
if a > b:
    print(-1)
else:
    a_min, a_max, b_min, b_max = 0,0,0,0
    
    if (a*100)%8 == 0:
        a_min = a/0.08
    else:
        a_min = a/0.08 + 1
    a_max = a_min
    while int(a_max*0.08) == a:
        a_max += 1
    a_max -= 1
    
    b_min = b*10
    b_max = b_min
    while int(b_max*0.1) == b:
        b_max += 1
    b_max -= 1
    
    if b_max >= a_min and a_max >= b_min:
        print(int(max(a_min,b_min)))
    else:
        print(-1)

Solution (Python):

import math
 
a, b = map(int, raw_input().split())
 
xa = int(math.ceil(a / 0.08))
xb = int(math.ceil(b / 0.10))

z = 1e10
if int(xa * 0.10) == b and xa < z:
    z = xa
    
if int(xb * 0.08) == a and xb < z:
    z = xb
    

print [z, -1][z == 1e10]

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

a_nontax = 0
b_nontax = 0
kakaku = -1
a_nontax = int(A/0.08)
b_nontax = int(B/0.10) + 13
kakaku = -1
if a_nontax != b_nontax:
  start = 0
  end = 0
  if a_nontax > b_nontax:
    start = b_nontax
    end = a_nontax
  else:
    start = a_nontax
    end = b_nontax  
  
  for i in range(start, end + 1, 1):
    if int(i*0.08) == A and int(i*0.10) == B:
      kakaku = i
      break
else:
  kakaku = a_nontax  

print(kakaku)

Solution (Python):
a, b = map(int, input().split())
i = 1
found = False
while True:
    if int(i * 0.08) > a + 1 or int(i * 0.1) > b:
        break
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        found = True
        break
    i = i + 1
if not found:
    print(-1)

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

price_A = 0
price_B = 0

price_A = math.ceil(A / 0.08)
price_B = math.ceil(B / 0.1)

min_price = min(price_A, price_B)
max_price = max(price_A, price_B)

for i in range(min_price, max_price+1, 1):
    tax_A = int(i * 0.08)
    tax_B = int(i * 0.1)

    if tax_A == A and tax_B == B:
        print(i)
        sys.exit()

print(-1)

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

import math

Aset = set([i for i in range(math.ceil(A/0.08), math.floor((A+1)/0.08))])
Bset = set([i for i in range(math.ceil(B/0.10), math.floor((B+1)/0.10))])


ABset = Aset & Bset

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

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
def keisan(a):
    return math.floor(a*0.08),math.floor(a*0.10)

A,B = map(int, input().split())
b = B*10
while b<1001:
    tempa,tempb = keisan(b)
    if tempa == A and tempb == B:
        print(b)
        exit()
    b += 1
print(-1)

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

res = -1

for i in range(1,3500):
    judge = True

    p = (i*8) // 100
    q = (i*10) // 100
    if a == p and b == q:
        res = i
        break


print(res)

Solution (Python):
import math


def find(a, b):
    for bxn in range(math.ceil(b / 0.1), math.ceil((b + 1) / 0.1)):
        for axn in range(math.ceil(a / 0.08), math.ceil((a + 1) / 0.08)):
            if axn == bxn:
                return axn
    return -1


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

Solution (Python):
import math

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

for i in range(1, 1300):
    if math.floor(i * 0.08) > 100:
        break
    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())
c = math.ceil(a*100/8)
d = math.ceil((a+1)*100/8)
e = math.ceil(b*100/10)
f = (b+1)*100//10
for i in range(d-c):
  if c+i>=e and c+i<f:
    print(c+i)
    break
else:
  print(-1)

Solution (Python):
A,B=map(int,input().split())
a=A/0.08
b=(A+1)/0.08
c=B/0.1
d=(B+1)/0.1
if b<=c or d<=a:
  print(-1)
else:
  t=max(a,c)
  if t==int(t):
    print(int(t))
  else:
    print(int(t)+1)

Solution (Python):
import math
 
A, B = list(map(int, input().split()))
 
rangeA = [A / 0.08, (A + 1) / 0.08]
rangeB = [B / 0.1, (B + 1) / 0.1]
 
if rangeA[0] < rangeB[0]:
  if math.ceil(rangeB[0]) < rangeA[1]:
    print(math.ceil(rangeB[0]))
    exit(0)
elif rangeA[0] > rangeB[0]:
  if math.ceil(rangeA[0]) < rangeB[1]:
    print(math.ceil(rangeA[0]))
    exit(0)
else:  
  if math.ceil(rangeA[0]) < rangeB[1] and math.ceil(rangeA[0]) < rangeA[1]: 
    print(math.ceil(rangeA[0]))
    exit(0)
print(-1)

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

Amin = A / 0.08
Amax = (A + 0.999999) / 0.08

Bmin = B / 0.10
Bmax = (B + 0.999999) / 0.10

Aset = set(list(range(math.ceil(Amin), math.floor(Amax))))
Bset = set(list(range(math.ceil(Bmin), math.floor(Bmax))))

result_set = Aset & Bset

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

Solution (Python):
A, B = map(int, input().rstrip().split())
ret = 1000000
for i in range(1, 10001):
    if int(i * 0.08) == A and int(i*0.1) == B and ret > i:
        ret = i
        break
if ret == 1000000:
    ret = -1
print(ret)

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

A_min = 12.5 * A
A_max = 12.5 * (A + 1)

B_min = 10 * B
B_max = 10 * (B + 1)


if A % 2 == 0:
    myList1 = list(range(int(A_min), int(A_max + 1)))
else:
    myList1 = list(range(int(A_min + 1), int(A_max)))

myList2 = list(range(int(B_min), int(B_max)))

mySet = list(set(myList1) & set(myList2))

mySet = [item for item in mySet if item >= 1]

if len(mySet) == 0:
    print(-1)
else:
    print(sorted(mySet)[0])

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):
line = input()
a, b = line.split(" ")
a = int(a)
b = int(b)
flag = 0








flag = 0
for i in range(1,1251):
    if int(i * 0.08) == a:
        if int(i * 0.1) == b:
            print(i)
            flag = 1
            break
if flag == 0:
    print("-1")

Solution (Python):

import sys
import math
import numpy as np
import itertools


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

p = []
answer=-1
for i in range(1,1001):
    if int(i*0.08) == a:
        p.append(i)

for i in p:
    if int(i*0.1) == b:
        answer = i
        break

print(answer)

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

n = int((a/0.08)//1)
ans = -1

for i in range(n,n+10**2):
  if int((i*0.08)//1) == a and int((i*0.1)//1) == b:
    ans = i
    break
  else:
    continue

print(ans)

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

price = math.ceil(a / 0.08)

price_ = math.floor(b / 0.1)

if price < price_:
    start, end = price, price_
else:
    start, end = price_, price
for i in range(start, end+1):
    
    
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        exit()
if price == price_:
    print(price)
    exit()
print(-1)

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

for i in range(10, 1251):
    aa = int(i*0.08)
    bb = int(i*0.1)
    if aa == A and bb == B:
        print(i)
        exit()
print("-1")

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

UE_8 = math.ceil((A+1)/0.08)-1
SHITA_8 = A/0.08
UE_10 = math.ceil((B+1)/0.10)-1
SHITA_10 = B/0.10

if UE_8 < math.ceil(SHITA_10) or UE_10 < math.ceil(SHITA_8):
    print(-1)
else:
    i = math.ceil(SHITA_8)
    j = math.floor(UE_8)
    for n in range(int(i),int(j+1),1):
        if i < UE_10 and i >= SHITA_10:
            print(i)
            break
        i+=1

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

ax = int(a*100/8)
bx = int(b*10)

for i in range(1010):
  if int(i*0.08) == a and int(i*0.1) == b:
    ans = i
    break

print(ans)

Solution (Python):
import sys
A,B =map(int, input().split())
x = 0
for b in range(B*10,B*10+10):
  if int(b*0.08) == A:
    print(b)
    sys.exit()
print(-1)

Solution (Python):
A,B=map(int,input().split())
ans=0
b1=int(B/0.1)
b2=int((B+1)/0.1)
for i in range(b1,b2):
    a=int(i*0.08)
    if a==A:
        ans=i
        break
if ans==0:
    print(-1)
else:
    print(ans)

Solution (Python):

A,B = map(int,input().split())
A1 = list()
B1 = list()
for i in range(1,1250):
    if int(i*0.08) == A:
        A1.append(i)
for j in A1:
    if int(j*0.1) == B:
        B1.append(j)
if not B1:
    print(-1)
else:
    print(min(B1))

Solution (Python):
import math
A,B=map(int,input().split())
a=set(range(math.ceil(A/0.08),int((A+1)/0.08)))
b=set(range(math.ceil(B/0.1),int((B+1)/0.1)))
s=a&b
print(min(a&b) if len(s)>0 else -1)

Solution (Python):
A,B=map(int,input().split())
p=0;q=0;x=0;f=0
for i in range(13,1251):
  if int(i*0.08)==A and int(i*0.1)==B:
    print(i)
    f=1
    break
if f==0:
  print(-1)

Solution (Python):




a=[]
def myin(fun=int):
    global a
    a=list(map(fun,input().split()))

a,b=map(int,input().split())
oner=(a+1)/0.08
if a%2==0:
    oner=a//2*25+13
    onel=a//2*25
else:
    oner=(a+1)/2*25
    onel=(a-1)//2*25+13

twol=b*10
twor=b*10+10
l=[[onel,oner],[twol,twor]]
if l[0][0]>l[1][0]:
    l = [[twol, twor],[onel, oner], ]

if l[1][0]<l[0][1]:
    print(l[1][0])
else:
    print(-1)

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

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

if __name__ == "__main__":
    main()

Solution (Python):
A,B=map(int,input().split())
p=0;q=0;x=0;f=0
for i in range(13,1251):
  if int(i*0.08)==A and int(i*0.1)==B:
    print(i)
    f=1
    break
if f==0:
  print(-1)

Solution (Python):
a, b = map(int, input().split())
i = 1
found = False
while True:
    if int(i * 0.08) > a + 1 or int(i * 0.1) > b:
        break
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        found = True
        break
    i = i + 1
if not found:
    print(-1)

Solution (Python):
from math import ceil
from math import floor
A, B = map(int,input().split())
PA = A / 0.08
PA_max = (A + 1) /0.08
P = ceil(PA)
while P < PA_max:
    if floor(P * 0.1) == B:
        print(P)
        break
    P += 1
else:
    print(-1)

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

if ((a+1)/0.08).is_integer():
  s = [math.ceil(a/0.08), int((a+1)/0.08-1)]
else:
  s = [math.ceil(a/0.08), math.floor((a+1)/0.08-1)]
  
t = [int(b/0.1), int((b+1)/0.1 - 1)]

s_set = set([i for i in range(s[0], s[1]+1)])
t_set = set([i for i in range(t[0], t[1]+1)])

ans = list(s_set & t_set)
if ans:
  print(min(ans))
else:
  print(-1)

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

ans_min = min(a*100//8,b*100//10)
ans_max = max((a+1)*100//8-1,(b+1)*100//10-1)

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

print(-1)

Solution (Python):
A, B = map(int, input().split())
sisi = [min((A+1)*12.5 ,  (B+1)*10), max(A*12.5, B*10)]
sisi = [i-0.1 if i == int(i) else i for i in sisi]
print

if sisi[0] < sisi[1]:
    ans = -1
elif int(sisi[0]) == int(sisi[1]):
    ans = -1
else:
    ans = int(sisi[1]) +1

print(ans)

Solution (Python):
import math

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

x = a * 100 / 8
y = (a+1) * 100 / 8
z = b * 100 / 10
w = (b+1) * 100 / 10
    
if z <= x and x < w and w <= y:
    print(math.ceil(x))
elif x <= z and z < y and y <= w:
    print(math.ceil(z))
else:
    print(-1)

Solution (Python):
import math

inp = input().split(" ")
A, B = int(inp[0]), int(inp[1])



possible = int(B * 1/0.10) // 10


answer = []
for i in range(possible * 10, possible * 10 + 10):
  tax_a = int(i * 0.08)
  tax_b = int(i * 0.1)
  
  if tax_a == A and tax_b == B:
    answer.append(i)

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

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

Solution (Python):
import sys
import math

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




a,b= map(int,input().split())
ju=ans=0
li=[]
li1=[]

i=0
for i in range(10001):
  if a==math.floor(i*0.08):
    li.append(i)
  if b==math.floor(i*0.1):
    li1.append(i)

li.sort()
li1.sort()

if len(li1)>0:
  ans=min(li1)
if len(li)>0:
  ju=min(li)
for i in range(len(li1)):
  if ju==li1[i]:
    print(ju)
    sys.exit()
for i in range(len(li)):
  if ans==li[i]:
    print(ans)
    sys.exit()
print('-1')

Solution (Python):
import math
import sys
A,B = map(int,input().split())
x = math.floor(A/0.08)
y = math.floor(B/0.1)
for i in range(min(x,y),max(x,y)+3):
    s = math.floor(i*0.08)
    t = math.floor(i*0.1)
    if s == A and t == B:
        print(i)
        sys.exit()
print(-1)

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


rangeA = range(math.ceil(A * 12.5), math.ceil((A+1) * 12.5))

rangeB = range(math.ceil(B * 10), math.ceil((B+1) * 10))

common = set(rangeA) & set(rangeB)
if len(common) > 0:
    print(min(common))
else:
    print(-1)

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

if a%2 == 1:
    xa = int(a*12.5)+1
else:
    xa = int(a*12.5)
xb = int(b*10)

flag = True
maxi = max(xa,xb)
mini = min(xa,xb)
for i in range(mini,maxi+1):
    if (int(0.08*i) == a) and (int(0.1*i) == b):
        print(i)
        flag = False
        break
        
if flag == True:
    print('-1')

Solution (Python):
a,b=map(int,input().split())
if max(25*a,20*b) >= min(25*(a+1),20*(b+1)):
    ans = -1
else:
    ans = (max(25*a,20*b)+1) // 2

print(ans)

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

ans = -1

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

print(ans)

Solution (Python):
A, B = [int(y) for y in input().split(' ')]
if int((A/8) * 100) == (A/8) * 100:
  priceA_min = int((A/8) * 100)
else:
  priceA_min = int((A/8) * 100) + 1
if int(((A+1)/8) * 100) == ((A+1)/8) * 100:
  priceA_max = int(((A+1)/8) * 100) - 1
else:
  priceA_max = int(((A+1)/8) * 100)
found = False
for x in range(priceA_min,priceA_max+1,1):
  if int(x*0.1) == B:
    print(x)
    found = True
    break
if not found:
  print(-1)

Solution (Python):
import math

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

ans = []

true_A_max = A + 0.999
true_B_max = B + 0.999

X_A = math.floor(A / 0.08)
X_max_A = math.ceil(true_A_max /0.08)
X_B = math.floor(B / 0.1)
X_max_B = math.ceil(true_B_max /0.08)

if X_max_A - X_A >= X_max_B - X_B:
    X_min = X_B
    X_max = X_max_B

else:
    X_min = X_A
    X_max = X_max_A

for X in range(X_min, X_max):
    cal_A = math.floor(X * 0.08)
    cal_B = math.floor(X * 0.1)
    
    if cal_A == A and cal_B == B:
        ans.append(X)
            
if len(ans) > 0:
    print(min(ans))
else:
    print(-1)

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

result = -1
for i in range(int(a_min), int(a_max)+1):
    if (i*0.1//1 == B)*(i*0.08//1 == A):
        result = i
        break
print(result)

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

pa = [[] for i in range(110)]
pb = [[] for i in range(111)]

for i in range(1251):
  pa[int(i*0.08)].append(i)
  
for i in range(1101):
  pb[int(i*0.10)].append(i)
  
na = pa[a]
nb = pb[b]

for ca in na:
  if ca in nb:
    print(ca)
    exit()

print(-1)

Solution (Python):
import math

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




ans=9999

for i in range(1,1251):
  v_08 = math.floor(i * 0.08)
  v_10 = math.floor(i * 0.1)
  
  if v_08==A and v_10==B:
    ans=min(ans,i)

print(ans if ans != 9999 else -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())
import math
for i in range(1,1200):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b and (a <= b):
        print(i)
        exit()
print(-1)

Solution (Python):
import math
a, b = map(int, input().split())
x = math.ceil(a / 0.08)
y = math.ceil(b / 0.1)
if (x==y):
    print(x)
else:
    if x < y:
        if math.floor(math.ceil(b / 0.1) * 0.08) == a:
            print(y)
        else:
            print(-1)
    if x > y:
        if math.floor(x * 0.1)==b:
            print(x)
        else:
            print(-1)

Solution (Python):
import math

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


ARangemin = math.ceil(A * (100/8))
BRangemin = math.ceil(B * (100/10))

ARangemax = ARangemin
BRangemax = BRangemin
while int(ARangemax * 0.08) == A:
    ARangemax = ARangemax + 1
while int(BRangemax* 0.10) == B:
    BRangemax = BRangemax + 1
ARangemax = ARangemax -1
BRangemax = BRangemax -1

if ARangemax >= BRangemin or ARangemin >= BRangemax:
    if ARangemin >= BRangemax:
        print(-1)
    else:
        if ARangemin > BRangemin:
            print(ARangemin)
        else:
            print(BRangemin)
else:
    print(-1)

Solution (Python):
tax = []
a,b = map(int, input().split())
for i in range(1,10000):
  tax8 = int(i * 0.08)
  if tax8 == a:
    if int(i * 0.1) == b:
      tax.append(i)
if tax == []:
  print(-1)
else:
  print(tax[0])

Solution (Python):
import math
A, B = map(int, input().split())
tmpa = math.floor(A / 0.08)
tmpb = math.floor(B / 0.1)
alst = []
blst = []

indexa = 0
while True:
    tmp = math.floor((tmpa + indexa) * 0.08)
    if tmp == A:
        alst.append(tmpa + indexa)
        indexa += 1
    elif tmp > A:
        break
    else:
        indexa += 1

indexb = 0
while True:
    tmp = math.floor((tmpb + indexb) * 0.1)
    if tmp == B:
        blst.append(tmpb + indexb)
        indexb += 1
    elif tmp > B:
        break
    else:
        indexb += 1
ans = -1
alst.sort()
blst.sort()
for i in alst:
    if blst.count(i) >= 1:
        ans = i
        break

print(ans)

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

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

Solution (Python):
from math import floor

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

num = int(-(-B // 0.1))

for i in range(10):
    if floor((num + i) * 0.08) == A:
        print(num + i)
        break
else:
    print(-1)

Solution (Python):



A, B = list(map(int, input().split()))
nums = []
for i in range(1, 10000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        nums.append(i)
if len(nums) == 0:
    print(-1)
else:
    print(min(nums))

Solution (Python):
a, b = map(int, input().split())
a *= 25
b *= 10
r = max((a + 1) // 2, b)
print((-1, r)[r < min((a + 26) // 2, b + 10)])

Solution (Python):
import math
A,B=map(int,input().split())
C=max(math.ceil(100*A/8),math.ceil(10*B))
D=min(math.floor(100*(A+1)/8),math.floor(10*(B+1)))
if C>=D:
    print("-1")
else:
    print(C)

Solution (Python):
import math
a, b = map(int,input().split())
ansA = math.ceil(a / 0.08)
ansB = math.ceil(b / 0.1)
if ansA < ansB:
  rr = range(ansA, ansB + 1)
elif ansA > ansB:
  rr = range(ansB, ansA + 1)
else:
  print(ansA)
  exit()
  
for i in rr:
  if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
    print(i)
    exit()
print(-1)

Solution (Python):
import math

a, b = (int(x) for x in input().split())
ans = 0
i = 0
ok = False

while i < 10000 :
    case_a = math.floor(i * 0.08)
    
    case_b = math.floor(i * 0.10)
    

    if case_a == a and case_b == b :
        
        ans = i
        ok = True
        break

    i = i + 1

if ok == False : 
    ans = -1

print(ans)

Solution (Python):
a,b=map(float,input().split())
a_tax = a*100//8
b_tax = b*100//10
min_tax = 0

if a_tax <= b_tax:
    min_tax = int(a_tax)
else:
    min_tax = int(b_tax)

r_a_tax = int(min_tax*0.08)
r_b_tax = int(min_tax*0.1)

flag = True
while(flag):
    if r_a_tax == a and r_b_tax == b:
        flag = False
    elif r_a_tax > a or r_b_tax > b:
        print(-1)
        exit()
    else:
        min_tax += 1
        r_a_tax = int(min_tax*0.08)
        r_b_tax = int(min_tax*0.1)

print(min_tax)

Solution (Python):
import math
def resolve_c():
    a, b = map(int, input().split())
    flg = 0
    xs = math.ceil(a / 0.08)
    ys = math.ceil(b / 0.1)
    xf = math.ceil((a + 1) / 0.08)
    yf = math.ceil((b + 1) / 0.1)

    for i in range(xs, xf, 1):
        for j in range(ys, yf, 1):
            if i == j:
                flg = 1
                print(i)
                break
        else:
            continue
        break
        
    if flg == 0:
        print(-1)
resolve_c()

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

flg = True

if math.ceil(12.5*A) >= B*10:
    N = B*10
    while int(N*0.08) < A:
        N += 1
        if int(N*0.1) > B:
            flg = False
            break
    if flg: ans = N

else:
    N = math.ceil(12.5*A)
    while int(N*0.1) < B:
        N += 1
        if int(N*0.08) > A:
            flg = False
            break
    if flg: ans = N

print(ans)

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

ans = -1
for yen in range(1263):
    a = yen * 8 // 100
    b = yen * 10 // 100
    if a == A and b == B:
        ans = yen
        break
print(ans)

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

Solution (Python):

import sys

x = input().split(" ")

a = int(x[0])
b = int(x[1])

ch = 0
v = []
w = []

for i in range(1250):
    t = int((i + 1) * 0.08)
    if t == a :
        v.append(i + 1)
        ch = 1
    elif t != a and ch == 1 :
        break
ch = 0

for i in range(1000):
    t = int((i + 1) * 0.1)
    if t == b :
        w.append(i + 1)
        ch = 1
    elif t != b and ch == 1 :
        break
ans = -1

for i in v :
    for j in w :
        if i == j :
            ans = i
            break
    if i == j :
        break

print(ans)

Solution (Python):
import math
A, B = map(int, input().split())
value = math.ceil(A / 0.08)
limit = math.ceil((A + 1) / 0.08)
while value < limit:
    if B == int(value * 0.1):
        print(value)
        break
    value += 1
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())
import math

A = []
B = []
S = []


if a % 2 == 0:
    for i in range(13):
        A.append(int((12.5*a))+i)
else:
    for i in range(1,13):
        A.append(int((12.5*a))+i)
        

for k in range(10):
    B.append((10*b)+k)
    
if len(list((set(A))& set(B))) > 0:
    S = list((set(A))& set(B))
    print(min(S))
else:
    print(-1)

Solution (Python):
import math
 
A, B = map(int, input().split())
min_ans = -(-A // 0.08)
 
kouho = [min_ans]
to_continue = True
while to_continue:
    min_ans += 1
    if math.floor(min_ans * 0.08) == A:
        kouho.append(min_ans)
    else:
        break
        
print_flag = False
for i in kouho:
    if math.floor(i * 0.1) == B:
        print_flag = True
        print(int(i))
        break
    
if print_flag == False:
    print(-1)

Solution (Python):
import math


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

test1 = math.ceil((a+1) / 0.08 -1)
test2 = math.ceil(a / 0.08)
test3 = math.ceil((b+1) / 0.10 -1)
test4 = math.ceil(b / 0.10)

if test2 >= test4 and test2 <= test3:
    print(test2)
elif test4 >= test2 and test4 <= test1:
    print(test4)
else:
    print("-1")

Solution (Python):
from math import ceil
A, B = map(int, input().split(' '))
x0 = ceil(A / 0.08)
x1 = ceil((A+1) / 0.08)
y0 = ceil(B / 0.1)
y1 = ceil((B+1) / 0.1)
if x1 <= y0 or y1 <= x0:
  print(-1)
else:
  print(min(max(x0, y0), min(x1, y1)))

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

if 100*A%8 == 0:
    ans1 = int(A/0.08)
else:
    ans1 = int(A/0.08) + 1
ans2_max = int(ans1 + ans1*0.1)

ans2 = int(B/0.1)

if ans2 > ans2_max:
    print(-1)
    sys.exit()

while True:
    if int(ans1*0.08) == A and int(ans1*0.1) == B:
        print(ans1)
        break
    if ans1 > ans2_max:
        print(-1)
        break
    ans1 += 1

Solution (Python):
import math

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

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

print(ans)

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


def calc_a(n):
    return n // 0.08


def calc_b(n):
    return n / 0.1


estimate = int(min(calc_a(a), calc_b(b)))
for i in range(estimate, estimate*2):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        exit()

print(-1)

Solution (Python):
ans=0
a,b=map(int,input().split())
for i in range(10000):
    ans1=int(i*1.08)
    ans2=int(i*1.1)
    ans11=ans1-i
    ans22=ans2-i
    if ans11==a and ans22==b:
        print(i)
        exit(0)
print(-1)

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

lA=[]
lB=[]

minV,minID=0,0
for i in range(1300):
    k=int(i*0.08)
    if minV<k:
        lA.append((minID,i-1))
        minV=k
        minID=i

minV,minID=0,0
for i in range(1300):
    k=int(i*0.1)
    if minV<k:
        lB.append((minID,i-1))
        minV=k
        minID=i

a1,a2=lA[a]
b1,b2=lB[b]

for i in range(min(a1,a2,b1,b2),max(a1,a2,b1,b2)+1):
    if a1<=i and b1<=i and a2>=i and b2>=i:
        print(i)
        exit(0)

print(-1)

Solution (Python):

import glob



REL_PATH = 'ABC\\158\\C'


TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        q = [int(i) for i in self.input_data().split()]

        A = q[0]
        B = q[1]

        no_tax_A = int(A / 0.08) 
        no_tax_B = int(B / 0.1)  

        if int(no_tax_A) * 0.08 != A:
            no_tax_A += 1

        if no_tax_A == no_tax_B:
            result = no_tax_A
        elif no_tax_A > no_tax_B:
            if int(no_tax_A * 0.1) == B:
                result = no_tax_A
            else:
                result = -1
        else:
            if int(no_tax_B * 0.08) == A:
                result = no_tax_B
            else:
                result = -1

        print(str(result))

solver = Solver(REL_PATH)
solver.exec_resolve()

Solution (Python):
import math

f = [int(i) for i in input().split()]
a = f[0]
b = f[1]

a_lower = math.ceil(a/0.08)
a_upper = int((a+1)/0.08)
b_lower = math.ceil(b/0.1)
b_upper = int((b+1)/0.10)


g = 0
for i in range((a_lower),(a_upper)):
  if (b_lower <= i < b_upper):
    print(str(int(i)))
    g = 1
    break
if g == 0:
  print("-1")

Solution (Python):


def abc158c(a, b):
    min_b = b * 10
    for cand in range(min_b, min_b+10):
        if int(cand * 0.08) == a:
            return cand
    
    return -1



if(__name__ == '__main__'):
    
    a, b = map(int, input().split(" "))
    
    accomplishment = abc158c(a, b)
    
    
    print(accomplishment)

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

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

x_min_tmp = A * 12.5
if x_min_tmp.is_integer:
  x_min = int(x_min_tmp)
else:
  x_min = int(x_min_tmp) + 1

x_max_tmp = (A + 1) * 12.5
x_max = int(x_max_tmp) + 1

ans = -1
for n in range(x_min, x_max + 1):
  if int(n * 0.08) == A and int(n * 0.1) == B:
    ans = n
    break

print(ans)

Solution (Python):
import math
from decimal import *
A,B=list(map(lambda i:int(i),input().split()))


Amax = (A+0.9)
Amax= Decimal(str(Amax))/ Decimal('0.08')
Amin = Decimal(str(A))/ Decimal('0.08')


Bmax= (B+0.9)
Bmax= Decimal(str(Bmax)) *  Decimal('10')
Bmin = Decimal(str(B)) *  Decimal('10')

As = list(range(math.ceil(Amin), math.floor(Amax)+1))
Bs = list(range(math.ceil(Bmin), math.floor(Bmax)+1))

A_B = set(As) & set(Bs)


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

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

low_A = A / 0.08
low_B = B / 0.10
high_A = (A + 1) / 0.08
high_B = (B + 1) / 0.10

result = 0
if (low_A >= high_B) or (low_B >= high_A):
  result = -1
else:
  low_end = low_B if (low_A < low_B) else low_A
  result = math.ceil(low_end)

print(result)

Solution (Python):
a, b = [int(x) for x in input().split()]
 
if (b < a):
    tmp = b
    b = a
    a = tmp
 
 
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