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

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


resultTmp = B * 10
result = 0
isHit = False
isFirstHit = True
while resultTmp < B * 10 + 10:
    if math.floor(resultTmp * 0.08) == A and math.floor(resultTmp * 0.1) == B:
        isHit = True
        if isFirstHit:
            result = resultTmp
            isFirstHit = False
    resultTmp += 1

if isHit:
    print(result)
else:
    print(-1)

Solution (Python):
import numpy as np
import math

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

answer = -1
for i in range(1000, 1, -1):
    check1 = math.floor(i * 0.08)
    check2 = math.floor(i * 0.1)
    if ((check1 == A) & (check2 == B)):
        answer = i
print(answer)

Solution (Python):
import math

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

for i in range(1100):
  x = i+1
  if math.floor(x*1.08) == A + x and math.floor(x*1.1) == B + x:
    print(x)
    break
  if x == 1100:
    print(-1)

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

x_min_A = A / 0.08
x_Max_A = (A + 1) / 0.08
x_min_B = B / 0.10
x_Max_B = (B + 1) / 0.10

x_min = max(x_min_A, x_min_B)
x_Max = min(x_Max_A, x_Max_B)

x = math.ceil(x_min)
if x < x_Max:
  print(x)
else:
  print(-1)

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

for i in range(0,10000):
  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(1 ,1001):
    aa = int(i * 0.08)
    bb = int(i * 0.1)
    if a == aa and b == bb:
        print(i)
        sys.exit()

print(-1)

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

Solution (Python):
import math
List = [int(i) for i in input().split()]
zei8min = List[0] * 25 / 2
zei8max = (List[0] + 1) * 25 / 2
for i in range(math.ceil(zei8min),math.floor(zei8max)):
    if math.floor(i * 0.1) == List[1]:
        print(i)
        exit()
print(-1)

Solution (Python):

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

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

Solution (Python):
import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

def main():
    A,B = map(int,input().split())
    for x in range(3000):
        if math.floor(x*0.08) == A and math.floor(x*0.1) == B:
            print(x)
            exit()

    print(-1)



if __name__ == "__main__":
  main()

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

Solution (Python):
from collections import deque
import sys
input = sys.stdin.readline
import bisect as bi
from operator import mul
from functools import reduce
import math

def fast_comb(a,b,mod):
    up = reduce(lambda x,y: x*y%mod, range(a,a-b,-1))
    down = reduce(lambda x,y: x*y%mod, range(1,b+1))
    return (up * pow(down, mod-2, mod)) % mod

def prime(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]:
            continue
        for j in range(i*2, n+1, i):
            is_prime[j] = False
    return is_prime

def readlines(n):
    for _ in range(n):
        map(int, input().split())
        yield

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

    for i in range(20000):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)

        if (a, b) == (a_, b_):
            print(i)
            return

    print(-1)





main()

Solution (Python):
a,b=map(int,input().split())
i=0
while(True):
    xa=int(i*0.08)
    xb=int(i*0.10)
    if(xa==a and xb==b):
        print(i)
        break
    elif(xa>a and xb>b):
        print(-1)
        break
    else:
        i+=1

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

for i in range(10000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        result = i
        break
print(result)

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

for i in range(10001):
  d=int(i*0.08)
  if d==a:
    e=int(i*0.1)
    if e==b:
      print(i)
      exit()
print('-1')

Solution (Python):
A, B = map(int, input().split())
Ax = A * 25
if Ax & 1:
    Ax += 1
Ay = (A + 1) * 25
if Ay & 1:
    Ay += 1
Ax //= 2
Ay //= 2
Bx = B * 10
By = (B + 1) * 10

if Ay <= Bx or By <= Ax:
    print(-1)
else:
    ans = max(Bx, Ax)
    print(ans)

Solution (Python):


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

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

    print(ans)

Solution (Python):
import math

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

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


print(cnt)

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

ans=-1
for k in range(10**4):
    hati=k*8//100
    ju=k//10
    if(hati==a and ju==b):
        ans=k
        break

print(ans)

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

for i in range(1001):

  if int(i * 0.08) == a and int(i *0.1) == b:
    ans = i
    break
print(ans)

Solution (Python):
if __name__ == '__main__':
    a, b = map(int, input().split())
    ans = 0
    alist = []
    blist=[]
    for i in range(1300):
        tax = int(i * 1.08 - i)
        if int(tax) == a:
            alist.append(i)


    for i in range(1100):
        tax = int(i * 1.1 - i)
        if int(tax) == b:
            blist.append(i)

    ablist = set(alist) & set(blist)
    ablist = list(ablist)

    if len(ablist) == 0:
        print(-1)
    else:
        ablist.sort()

        print(ablist[0])

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

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

Solution (Python):
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = map(int, sys.stdin.readline().split())

    ret = -1
    for a in range(1, 1250):
        tmpA = math.floor(a * 0.08)
        tmpB = math.floor(a * 0.1)
        if (tmpA == A and tmpB == B):
            ret = a
            break

    print(ret)


if __name__ == '__main__':
    main()

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

Solution (Python):
def inputs(): return [int(x) for x in input().split()]
a,b = inputs()
for i in range(2000):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    exit()
print(-1)

Solution (Python):


import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

a, b = MAP()

for x in range(100000):
    if int(x * 1.08) == x + a and int(x * 1.1) == x + b:
        print(x)
        exit()
print(-1)

Solution (Python):

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


for i in range(int(101/0.08)+1):
  i+=1
  if int(i*(0.08)) == a and int(i*(0.10)) == b:
    print(i)
    quit()

print(-1)

Solution (Python):
import math
A,B=map(int,input().split())
al=A*12.5
ar=(A+0.99)*12.5
bl=B*10
br=(B+0.9)*10
if bl>ar or br<al:
  print(-1)
elif al<bl:
  print(math.ceil(bl))
elif bl<=al:
  print(math.ceil(al))

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

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

def floor(x, f):
    res = int(x / f)
    if int(res * f) < x:
        res += 1
    return res

ra = [floor(A, 0.08), floor(A + 1, 0.08)]
rb = [floor(B, 0.1), floor(B + 1, 0.1)]

if ra[1] <= rb[0] or rb[1] <= ra[0]:
    print(-1)
else:
    print(max(ra[0], rb[0]))

Solution (Python):
a,b=map(int,input().split())
for i in range(2*10**3):
    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())
ans = -1
for i in range(1, 1100):
    if i * 0.08 // 1 == a and i * 0.1 // 1 == b:
        ans = i
        break
print(ans)

Solution (Python):
a,b=(int(x) for x in input().split())
a_1=int(a*12.5+0.999999)
a_2=int((a+1)*12.5)
list_a = []
for i in range(a_1,a_2):
	list_a.append(i)

b_1=int(b*10+0.999999)
b_2=int((b+1)*10)
list_b = []
for i in range(b_1,b_2):
	list_b.append(i)
li_a_b = set(list_a) & set(list_b)
if len(li_a_b) ==0:
	print(-1)
else:
	print(min(li_a_b))

Solution (Python):
import math

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

la = A/0.08
ra = (A+1)/0.08
lb = B/0.1
rb = (B+1)/0.1

ans = math.ceil(max(la, lb))
if ra <= lb or rb <= la:
  print(-1)
else:
  print(ans)

Solution (Python):
a, b = map(int, input().split())
c = min(int(a/0.08), int(b/0.1))
while(1):
  if int(c*0.08)==a and int(c*0.1)==b:
    print(c)
    exit()
  else:
    c+=1
    if int(c*0.08)>a and int(c*0.1)>b:
      print(-1)
      exit()

Solution (Python):

import math

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

if __name__ == '__main__':
    main()

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



xa = int(a/0.08)
xb = int(b/0.1)

ans = -1
x = min(xa, xb)
for i in range(-20, 30):
  x_tmp = x + i
  
  if int(x_tmp*0.08)==a and int(x_tmp*0.1)==b:
    ans = x_tmp
    break

if ans==-1:
  print(-1)
else:
  print(int(ans))

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

print("-1")

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a,b = m()

aaa = -(-a * 100 // 8)

aa = (a+1) * 100 // 8

bbb = -(-b * 100 // 10)

bb = (b+1) * 100 // 10


p = set(range(aaa,aa))
pp = set(range(bbb,bb))

ppp = p & pp

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

Solution (Python):
import math


a,b = map(int,input().split())
a_st = math.ceil(a /0.08) 
a_ed = math.ceil((a+1) /0.08) 
b_st = 10*b
b_ed = 10*(b+1) 
a_lis = list(range(a_st,a_ed))
b_lis = list(range(b_st,b_ed))
aandb = list(set(a_lis) & set(b_lis))
if len(aandb) == 0:
    print('-1')
else:
    print(min(aandb))

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(A: int, B: int):
    
    from math import floor, ceil
    ans = []
    for i in range(1, 20000):
        if floor(i*0.08) == A and floor(i*0.1) == B:
            ans.append(i)

    ans.sort()
    
    if len(ans) != 0:
        print(ans[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):
import sys
input = sys.stdin.readline


def main():
    a, b = map(int, input().split())
    for i in range(1250+1):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)
        if a == a_ and b == b_:
            print(i)
            return
    print(-1)


if __name__ == "__main__":
    main()

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

for i in range(1,10 ** 6):
    asub = math.floor(i * 0.08)
    bsub = math.floor(i * 0.1)
    if asub == a and bsub == b:
        print(i)
        exit()

print("-1")

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






for i in range(1001):
    ans1 = math.floor(i*0.08)
    ans2 = math.floor(i*0.1)
    if (ans1 == a) & (ans2 == b):
        print(i)
        sys.exit()
print(-1)

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

ans = -1
for i in range(int(B / 0.1), int((A + 1) / 0.08)):
  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 x in range(max(int(12.5 * A), int(10 * B)), min(int(12.5 * A + 12.5), int(10 * B + 10)) + 1):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        break
else: print(-1)

Solution (Python):
info = [int(i) for i in input().split()]
_min = max(int(info[0]*12.5), int(info[1]*10))
_max = min(int((info[0]+1)*12.5), int((info[1]+1)*10))
for i in range(_min, _max):
    if int(0.1*i)==info[1] and info[0]== int(0.08*i):
        print(i)
        break
else:
    print(-1)

Solution (Python):
A,B = map(int, input().split())
ans=-1
for i in range(1250):
    if ans>0:
        break
    x=i*0.08
    x=int(x)
    if x==A:
        y=i*0.1
        y=int(y)
        if y==B:
            ans=i


if ans<0:
    print("-1")
else:
    print(ans)

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

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

flag = 0

for i in range(10**4+1):
    if(int(i*0.08) == a and int(i*0.1) == b):
        print(i)
        flag = 1
        break

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

Solution (Python):
a,b=map(int,input().split())
def z(n):
    d=0
    while n>=1:
        d+=1
        n-=1
    return d

def x(n):
    d=0
    while n>1:
        d+=1
        n-=1
    return d+1

an=[]
a1=a*12.5
a2=(a+0.99999999999)*12.5
b1=b*10
b2=(b+0.99999999999)*10
for i in range(x(a1),z(a2)+1):
    an.append(i)



ans=-1
for i in range(x(b1),z(b2)+1):
    if i in an:
        ans=i
        break
print(ans)

Solution (Python):


import math


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

for i in range(1, 1500):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        ans_list.append(i)

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

Solution (Python):
A, B = map(int, input().split())
amin = -(-A // 0.08)
amax = (A+1) // 0.08
bmin = -(-B / 0.1)
bmax = (B+1) // 0.1

mi = max(amin, bmin)
ma = min(amax, bmax)

if mi > ma:
  print(-1)
else:
  print(int(mi))

Solution (Python):
import math
a,b=map(int,input().split())
start=0
end=1000000
ans=1000000
while start<=end:
    mid=(start+end)//2
    aa=math.floor(mid*0.08)
    bb=math.floor(mid*0.1)
    if aa==a and bb==b:
        ans=min(ans,mid)
        
        end=mid-1
    elif aa>a or bb>b:
        end=mid-1
    else:
        start=mid+1 
if ans==1000000:
    print(-1)
else:
    print(ans)

Solution (Python):
N = 10000

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

set_a = set()
set_b = set()

for x in range(N):
  if int(x * 0.08) == A:
    set_a.add(x)
  if int(x * 0.1) == B:
    set_b.add(x)
    
print(min(set_a & set_b)) if set_a & set_b else print(-1)

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

a_min=math.ceil(A/0.08)
b_min=math.ceil(B/0.1)
a_list=[]
b_list=[]

for i in range(a_min,a_min+12):
  a_list.append(i)
for j in range(b_min,b_min+10):
  b_list.append(j)
  
ans=-1
for item in a_list:
  if item in b_list:
    ans=item
    break
  
print(ans)

Solution (Python):
A, B = map(int, input().split())
 
def check(X):
  global A
  global B
  return (int)(X*0.08) == A and (int)(X*0.1) == B
 
for x in range(1, max(A, B)*20):
  if check(x):
    print(x)
    exit(0)
 
print(-1)

Solution (Python):
def main(a,b):
    a1 = a / 0.08
    a2 = (a+1) / 0.08
    b1 = b / 0.1
    b2 = (b+1) / 0.1
    x = max(a1,b1)
    y = min(a2,b2)
    if (y <= x):
        return -1
    else:
        if(x//1 == x):
            return x
        elif(y > (x//1)+1):
            return x+1
    return -1


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

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

mina = a*12.5
maxa = (a+1)*12.5
minb = b*10
maxb = (b+1)*10

def calc_price(mina,maxa,minb,maxb):
    if mina >= maxb or minb >= maxa:
        return -1
    else:
        price = max(mina, minb)
        return math.ceil(price)

print(calc_price(mina,maxa,minb,maxb))

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

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

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

minans = int(a / 0.08)

if minans > int(b / 0.1):
    minans = int(b / 0.1)

for i in range(minans, 2000):
    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())
answer=-1
for i in range(10):
    if (b*10+i)*0.08>=a and (b*10+i)*0.08<a+1:
        answer=b*10+i
        break
print(answer)

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

for i in range(10000):
    if i * 0.08 // 1 == A and i * 0.10 // 1 == B:
        print(i)
        exit()

print(-1)

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

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

if x1<=y1 and y1<=x2:
    print(int(y1))

elif y1<=x1 and x1<=y2:
    print(int(x1))


else:
    print(-1)

Solution (Python):
a, b = map(int, input().split())
ans = float('inf')
for i in range(1400):
    
    if a == int(i*0.08) and b == int(i*0.1):
        ans = i
        break

if ans == float('inf'):
    print(-1)
else:
    print(ans)

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

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

Solution (Python):
a,b=(int(x) for x in input().split())
answer=-1
for price in range(1,1251):
    if price*8//100==a and price*10//100==b:
        answer=price
        break
print(answer)

Solution (Python):
import math
a,b = map(int,input().split())
a1 = round(a/0.08)
b1 = round(b/0.1)
c = min(a1,b1)
while True:
	if math.floor(c*0.08) == a and math.floor(c*0.1) == b:
		print(c)
		break
	elif math.floor(c*0.08) > a and math.floor(c*0.1) > b:
		print(-1)
		break
	else:
		c+=1

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

print(ans)

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

ans = 0

for i in range(1, 1011):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        ans = i
        break
print(ans if ans > 0 else -1)

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

Solution (Python):
import math
a,b = map(int,input().split())
flag = False
for i in range(1,10001):
    ans1 = math.floor(i*0.08)
    ans2 = math.floor(i*0.1)
    if ans1==a and ans2==b:
        ans = i
        flag = True
        break
if flag == True:
    print(ans)
else:
    print(-1)

Solution (Python):
import math
a, b = map(int, input().split())
K = [i for i in range(10, 1251)]
ans = -1
for k in K:
    if math.floor(k*0.08) == a and math.floor(k*0.1) == b:
        ans = k
        break
print(ans)

Solution (Python):

import math

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

a1=A/0.08
b1=B/0.1

a2=(A+1)/0.08
b2=(B+1)/0.1

af=math.ceil(a1)
ac=math.ceil(a2)
bf=math.ceil(b1)
bc=math.ceil(b2)

if ac<=bf or bc<=af:
    ans=-1
else:
    ans=max(af,bf)

print(ans)

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




n_max_fromA = 100*(A+1) // 8
n_min_fromA = 100*A // 8

n_max_fromB = 100*(B+1) // 10
n_min_fromB = 100*B // 10

ans_min = max(n_min_fromA, n_min_fromB)
ans_max = min(n_max_fromA, n_max_fromB)

ans_tmp = ans_min
ans = -1
while ans_tmp <= ans_max:
    tax_8 = int(ans_tmp*0.08)
    tax_10 = int(ans_tmp*0.1)

    if tax_8 == A and tax_10 == B:
        ans = ans_tmp
        break

    ans_tmp += 1

print(ans)

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


for i in range(1251):
    aa=math.floor(0.08*i)
    bb=math.floor(0.1*i)
    if aa==a and bb==b :
        print(i)
        sys.exit()
print(-1)

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

Solution (Python):
s=list(map(int,input().split()))
a=0
b=0
c=-1
for i in range(1,10000):
  a=int(i*0.08)
  b=int(i*0.1)
  if a==s[0]:
    if b==s[1]:
      c=i
      break
print(c)

Solution (Python):
import math


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

min_8 = math.ceil(tax_8 * 100 / 8)
limit_8 = math.ceil((tax_8 + 1) * 100 / 8)

min_10 = tax_10 * 100 // 10
limit_10 = (tax_10 + 1) * 100 // 10

target = max(min_8, min_10)

if target < limit_8 and target < limit_10:
    print(target)
else:
    print(-1)

Solution (Python):
import math
a, b = map(int, input().split())
lista = []
listb = []
pa1 = math.ceil(a * 12.5)
pa2 = math.ceil((a+1) * 12.5)
pb1 = int(b * 10)
pb2 = int((b+1) * 10)
for i in range(pa1, pa2) :
    lista.append(i)
for j in range(pb1, pb2) :
    listb.append(j)
aandb = set(lista)&set(listb)
if len(aandb) == 0 :
    print("-1")
else :
    print(min(aandb))

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

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

    if a % 2 == 0:
        lis_a = [i for i in range(int(12.5 * a), int(12.5 * a)+13)]
    else:
        lis_a = [i for i in range(int(12.5 * a + 1), int(12.5 * a + 12.5))]
    lis_b = [i for i in range(int(10 * b),int(10*b)+10)]
    a_new = set(lis_a)
    b_new = set(lis_b)
    c = list(a_new & b_new)
    if len(c) > 0:
        print(min(c))
    else:
        print(-1)


if __name__ == "__main__":
    main()

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

Solution (Python):
def aaaa(h):
    if h == int(h):
        return int(h)
    else:
        return int(h) + 1

a, b = map(int, input().split())
s = [a / 0.08, (a + 1) / 0.08]
r = [b / 0.1, (b + 1) / 0.1]

for i in range(aaaa(s[0]), aaaa(s[1])):
    for j in range(aaaa(r[0]), aaaa(r[1])):
        if i == j:
            print(i)
            exit()

print(-1)

Solution (Python):
import math
A, B = map(int, input().split())
ans = -1
for i in range(10000):
  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())

xa = math.ceil(a / 0.08)
xb = math.ceil(b / 0.10)
if xa >= xb:
    xmin = xa
else:
    xmin = xb

ya = math.ceil((a + 1) / 0.08)
yb = math.ceil((b + 1) / 0.10)
if ya <= yb:
    xmax = ya
else:
    xmax = yb

if xmax <= xmin:
    print(-1)
else:
    print(xmin)

Solution (Python):
A,B=list(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 sys


def input():
    return sys.stdin.readline()[:-1]


def main():
    A, B = map(int, input().split())
    if A > B:
        print(-1)
        exit()
    for n in range(int(A / 0.08)-10, 10 * B + 10):
        if int(n * 0.08) == A and int(n * 0.1) == B:
            print(n)
            exit()
    print(-1)


if __name__ == "__main__":
    main()

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

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

A, B = list(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())
ans = -1
for i in range(1, 1251):
    if a == int(i*0.08) and b == int(i*0.1):
        ans = i
        break
print(ans)

Solution (Python):
import math
def main():
    A,B=map(int, input().split())
    X=[]
    for i in range(1,1001):
        if math.floor(i * 0.08) == A:
            X.append(i)
    for x in X:
        if math.floor(x * 0.10) == B:
            print(x)
            return
    print(-1)
    return

if __name__ == '__main__':
    main()

Solution (Python):
import sys
from io import StringIO
import unittest

doTest=0

def yn(n):
    if n==1:
        print("Yes")
    else:
        print("No")
    return

def resolve():
    readline=sys.stdin.readline

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

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

    return

if doTest==0:
    resolve()
    sys.exit()

Solution (Python):
from math import floor
def main():
    a, b = map(int, input().split())
    r = -1
    for i in range(b * 10, (b + 1) * 10 + 1):
        if floor(i * 0.08) == a and floor(i * 0.1) == b:
            r = i
            break


    print(r)
main()

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

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

for i in range(1010000):
    if int(i*1.08)==i+a and int(i*1.1)==i+b:
        print(i)
        exit(0)
print(-1)

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

ans_A_kouho = []
A_kouho_start = int(A / 0.08)

i = A_kouho_start
while int(i * 0.08) <= A:
  if int(i * 0.08) == A:
    ans_A_kouho.append(i)
  i += 1


ans = -1
for ans_kouho in ans_A_kouho:
  if int(ans_kouho * 0.1) == B:
    ans = ans_kouho
    break

print(ans)

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

is_true = False
for i in range(10**7):
    if a == int(i * 0.08) and b == int(i * 0.1):
        is_true = True
        break
if is_true:
    print(i)
else:
    print('-1')

Solution (Python):
import math


def main():
    a, b = map(int, input().split(" "))
    
    
    
    
    
    
    
    for i in range(1, 1001):
        eight = math.floor(i * 0.08)
        ten = math.floor(i * 0.1)
        if eight == a and ten == b:
            print(i)
            return
    print("-1")


if __name__ == '__main__':
    main()

Solution (Python):


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

a = B * 10
b = (B+1) * 10

flag = False
for i in range(a,b):
    if((int)(i*0.08) == A):
        flag = True
        print(i)
        break

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

Solution (Python):



import numpy as np
from numpy import newaxis, float32, float64, int32, int64, int16, int8, uint8, uint32, complex64, complex128



def getIntList(inp):
	return [int(_) for _ in inp]


from sys import stdin
import sys

def getInputs():
	inputs=[]
	for line in stdin:
		line=line.split()
		inputs.append(line)
	return inputs


def main(inputs):
	a8,b10=getIntList(inputs[0])
	
	min8=int(np.ceil(a8/0.08))
	max8=int(a8/0.08+12)
	min10=b10*10
	max10=b10*10+9
	
	for i8 in range(min8, max8+1):
		if i8>=min10 and i8<=max10:
			print(i8)
			sys.exit(0)
	print(-1)

if __name__=="__main__":
	inputs=getInputs()

	main(inputs)

Solution (Python):
import math

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

for i in range(1251):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        flag = False
        break

if flag:
    print("-1")

Solution (Python):
import math
A, B = [int(s) for s in input().split()]
max_price = 100000
found = False
for i in range(max_price):
  ii = i+1
  priceA = math.floor(ii*0.08)
  priceB = math.floor(ii*0.1)
  if priceA == A and priceB == B:
    print(ii)
    found = True
    break
if found == False:
  print(-1)

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

Solution (Python):
A, B = map(int, input().split())
n = 1
a = 0
b = 0
while b <= 100:
    a = int(n * 0.08)
    b = int(n * 0.10)
    if a == A and b == B:
        print(n)
        break
    n += 1
else:
    print(-1)