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):
a, b = map(int, input().split())

ans = 10**9
for i in range(1, 1101):
    if (i*8)//100 == a and (i*10)//100 == b:
        ans = min(ans, i)
if ans == 10**9:
    print(-1)
else:
    print(ans)

Solution (Python):
from math import floor
a, b = map(int, input().split())
x1 = a/0.08
x2 = b/0.1
max_ = max(int(x1), int(x2)) + 100
min_ = min(int(x1), int(x2)) - 100

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

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

for i in range(B*10, B*10+10):
  if int(i*0.08) == A:
    print(i)
    break
else:
  print('-1')

Solution (Python):
A,B = map(int, input().split())
L = []
for i in range(1,1001):
    if int(i*0.08) == A and int(i*0.1) == B:
        L.append(i)
        break
if len(L) == 1:
    print(L[0])
else:
    print(-1)

Solution (Python):
import math

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

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

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

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

a = set(range(int(A / 0.08), int((A + 1) / 0.08)))
b = set(range(int(B / 0.1), int((B + 1) / 0.1)))
if abs(A / 0.08 - int(A / 0.08)):
    a.remove(int(A / 0.08))
print(min(a & b)) if a & b else print(-1)

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

ans=-1

for i in range(1,1001):
	a = int(i * 0.08)
	if A!=a: continue
	
	b = int(i * 0.1)
	if B!=b: continue
	
	ans=i
	break

print(ans)

Solution (Python):
import math

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

A_min = math.ceil(float(A)/0.08)
A_max = math.floor(float(A+1)/0.08)

A_list = [i for i in range(A_min, A_max)]

B_min = math.ceil(float(B)/0.10)
B_max = math.floor(float(B+1)/0.10)

B_list = [i for i in range(B_min, B_max)]

A_set = set(A_list)
B_set = set(B_list)
matched_list = sorted(list(A_set & B_set))

if matched_list != []:
    print(matched_list[0])
else:
    print(-1)

Solution (Python):
from sys import stdin
a,b = [int(x) for x in stdin.readline().rstrip().split()]
x = a * 25 // 2
if a % 2 == 1:
    x += 1
y = b * 10
ant = 0
while int(x * 0.08) == a:
    if int(x * 0.1) == b:
        ant = 1
        print(x)
        break
    x += 1
if ant == 0:
    print(-1)

Solution (Python):
import math
A,B= map(int, input().split())
for i in range(1,100*1000):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        exit()
    else:
        pass

print(-1)

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

 
import math
import itertools
import sys
import copy

 






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

i = 1
while math.floor(i*0.08) <= A and math.floor(i*0.1) <= B :
  if math.floor(i*0.08) == A and math.floor(i*0.1) == B :
    print (i)
    exit()
  i += 1
print (-1)

Solution (Python):
from sys import exit
A, B = map(int,input().split())
for i in range(20000):
  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())
bl=int(b/0.1)
bh=int((b+1)/0.1)

ans=-1
for x in range(bl,bh)[::-1]:
  y=x*0.08
  if a<=y and y<a+1:
    ans=x

print(ans)

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

for i in range (1,1001):
    a1 = math.floor(i*0.08)
    b1 = math.floor(i*0.1)
    if a1 == a and b1 == b:
        print(i)
        flag += 1
        break

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

Solution (Python):
import sys
a, b = map(int, input().split())
resa_min = int(-(-a//0.08))
resa_max = int(-((-a-1)//0.08))
resb_min = int(-(-b//0.1))
resb_max = int(-((-b-1)//0.1))
al = range(resa_min, resa_max)
bl = range(resb_min, resb_max)
for i in al:
    for j in bl:
        if i == j:
            print(i)
            sys.exit()
print(-1)

Solution (Python):
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

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

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

print(-1)

Solution (Python):
def main():
    import sys
    
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    
    from itertools import combinations, permutations
    
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    

    

    a,b = map(int, input().split())
    x1 = ceil(a*12.5)
    x2 = ceil((a+1)*12.5) - 1
    y1 = b*10
    y2 = (b+1)*10 - 1
    if x2<y1 or y2<x1:
        print(-1)
    elif x1>=y1:
        print(x1)
    else:
        print(y1)


if __name__ == '__main__':
    main()

Solution (Python):
from math import floor
A, B = map(int, input().split())
for i in range(1000):
    if floor((i + 1) * 0.08) == A and floor((i + 1) * 0.1) == B:
        print(i + 1)
        exit()

print(-1)

Solution (Python):
import math

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

c = b*10
i = 0
flag = False
while i<10:
    if math.floor(0.08*c)==a:
        ans = c
        flag = True
        break
    c += 1
    i += 1

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

Solution (Python):
def resolve():
    a, b = map(int, input().split())
    j=-1
    for i in range(1263):
        c = i*0.08//1
        d = i*0.1//1
        if c==a and d==b:
            j=i
            break
    print(j)
resolve()

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

Solution (Python):
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random


def LI(): return list(map(int, sys.stdin.readline().split()))


def I(): return int(sys.stdin.readline())


def LS():return list(map(list, sys.stdin.readline().split()))


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


def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l

def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l





A, B = LI()

low = 0
high = A * 12.5 + B * 10

min_price = float('inf')

while low <= high:
    mid = low + ((high - low) // 2)

    a = math.floor(mid * 0.08)
    b = math.floor(mid * 0.1)

    if a < A or b < B:
        low = mid + 1
    elif a == A and b == B:
        min_price = mid
        high = mid - 1
    elif a > A or b > B:
        high = mid - 1

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

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

Solution (Python):
import math

a, b = map(int, input().split())
limit = int(100 / 0.08) + 1
ans = limit

for i in range(1, limit):
    x = math.floor(i * 0.08)
    y = math.floor(i * 0.1)
    if x == a and y == b:
        ans = min(ans, i)

print(ans) if not ans == limit else print(-1)

Solution (Python):
import math

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

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

    print('-1')
    return

if __name__ == "__main__":
    main()

Solution (Python):
a,b=map(int,input().split())
a_set = set(range(-int(-a//0.08),-int(-(a+1)//0.08)))
b_set = set(range(-int(-b//0.1),-int(-(b+1)//0.1)))
candi = sorted(list(a_set&b_set))
print(candi[0] if len(candi)>0 else -1)

Solution (Python):
A, B = [int(x) for x in input().split(' ')]
C, D = A + 1, B + 1

for i in range(int(min(A / 0.08, B * 10, C / 0.08, D * 10) // 1),
               int(max(A / 0.08, B * 10, C / 0.08, D * 10) // 1) + 1):
  if int(i * 0.08 // 1) == A and int(i * 0.1 // 1) == B:
    print(i)
    break
else:
  print(-1)

Solution (Python):
a,b = map(int,input().split())
alist = []
blist = []
for i in range(b*10,b*10+10):
         blist.append(i)
for j in range(int(a*12.5+0.6),int(a*12.5+0.6+12.5)):
         alist.append(j)
answer = set(alist) & set(blist)
answer = list(answer)
if answer == []:
         print(-1)
else:
         print(min(answer))

Solution (Python):
import sys,math

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	A,B = MI()
	f = False
	for ans  in range(10000):
		if(int(ans * 0.08)==A and int(ans * 0.10)==B):
			print(ans)
			f = True
			break
	if(f==False):
		print(-1)

if __name__ == '__main__':
	main()

Solution (Python):
A, B=(int(i) for i in input().split())
import math

a=math.ceil(A*100/8)
b=math.ceil(B*100/10)
ans=max(a,b)
if ans*8//100==A and ans*10//100==B:
    print(ans)
else:
    print(-1)

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

def solve(x):
    return math.floor(x * 0.08) == a and math.floor(x * 0.1) == b

for i in range(1, 10**5):
    if solve(i):
        print(i)
        exit()

print(-1)

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

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

print("-1")

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

Solution (Python):
import math

a, b = map(int, input().split())
i = -1
atax = -1
btax = -1
while not ((atax == a and btax == b) or (btax > 100)):
    i += 1
    atax = math.floor(i * 0.08)
    btax = math.floor(i * 0.1)
if btax > 100:
    print(-1)
else:
    print(i)

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


x = 10*B

if A%2 == 0:
	x_low = 25*(A//2)
	x_high = int(12.5*(A+1))
else:
	x_low = int(12.5*A)+1
	x_high = int(12.5*(A+1))-1


while x < (10*B+10):
	if x_low <= x and x <= x_high:
		print(x)
		exit()
	x += 1
print(-1)

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

for x in range(10000):
    if int(x*0.08) == a and int(x*0.1) == b:
        print(x)
        exit()

print(-1)

Solution (Python):
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

A, B = input_int()



flg=True
for i in range(1, 10000):
    temp_A = int(i*0.08)
    temp_B = int(i*0.1)
    
    if temp_A == A and temp_B == B:
        print(i)
        flg=False
        break

if flg:
    print(-1)

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

am=math.ceil(A/0.08)
bm=math.ceil(B/0.1)
aM=math.ceil((A+1)/0.08)-1
bM=math.ceil((B+1)/0.1)-1
if max(am,bm)>min(aM,bM):
    print(-1)
else:
    print(max(am,bm))

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

Solution (Python):
a , b = map(int,input().split())
c = []
bool = False
for i in range(1250):
    if i * 8 //100 ==a and i * 10 // 100 == b:
        bool = True
        c.append(i)
        exit
if bool == True:
    print(min(c))
if bool == False:
    print(-1)

Solution (Python):
import math
A,B = map(int,input().split())
for i in range(10000):
  if math.floor(i * 1.08 -i )==A and math.floor(i * 1.1 -i)==B:
    print(i)
    exit()
print(-1)

Solution (Python):
A, B = map(int, input().split())
A_under = (A * 25 + 1) // 2
A_top = ((A + 1) * 25 + 1) // 2 - 1
B_under = B * 10
B_top = B * 10 + 9

ans = -1

for p in range(A_under, A_top + 1):
    if B_under <= p <= B_top:
        ans = p
        break

print(ans)

Solution (Python):
import math
a,b = map(int, input().split())
a1 = a*12.5
a2 = (a+1)*12.5
b1 = b*10
b2 = (b+1)*10
if max(a1,b1) >= min(a2,b2):
  print(-1)
else:
  print(math.ceil(max(a1,b1)))

Solution (Python):
import math

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

for i in range(b+1,1001):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans = i
        break
else:
    ans = -1
print(ans)

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

Solution (Python):
from math import floor, ceil
a, b = map(int, input().split())
minim = ceil(max(a / 0.08, b / 0.10))
maxim = min((a + 1) / 0.08, (b + 1) / 0.10)
if minim >= maxim:
    print(-1)
else:
    print(minim)

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

for x in range(1,1250):
    tax_a = int(x*0.08)
    tax_b = int(x*0.1)

    if tax_a == a and tax_b == b:
        print(x)
        exit()
else:
    print(-1)

Solution (Python):
import math

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

ans = -1
for i in range(1, 10001):
    c = math.floor(i * 0.08)
    d = math.floor(i * 0.10)

    if a == c and b == d:
        ans = i
        break

print(ans)

Solution (Python):
a,b = map(int,input().split())
for x in range(max(a,b),10001):
    if (x*0.08)//1 == a and (x*0.1)//1 == b:
        print(x)
        exit(0)
print(-1)

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


for price in range(int(100/0.08 + 2)):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        print(price)
        break
else:
    print(-1)

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

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

if minA <= minB <= maxA :
    print(minB)
elif minB <= minA <= maxB:
    print(minA)
else:
    print("-1")

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

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

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

Solution (Python):
import math
[A,B] = [int(s) for s in input().rstrip().split(' ')]
for i in range(10*B,10*B+10): 
  if math.floor(i * 0.08) == A:
    print(i)
    break
else:
  print("-1")

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

ans = -1

for i in range(1250):
    if int(i * 0.08) == A and int(i * 0.10) == B:
        ans = i
        break

print(ans)

Solution (Python):
import numpy as np

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

xa = list(range(int(np.ceil(A/0.08)),int(np.ceil((A+1)/0.08))))
xb = list(range(int(np.ceil(B/0.1)),int(np.ceil((B+1)/0.1))))

ans=str()

for i in xa:
    if i in xb:
        ans = str(i)
        break
        
if len(ans)==0:
    ans="-1"
    
print(ans)

Solution (Python):
a, b = map(int, input().split())
x = max(a*12.5,b*10)
if x != int(x):
  x = int(x)+1
else:
  x = int(x)
if x < min((a+1)*12.5,(b+1)*10):
  print(x)
else:
  print(-1)

Solution (Python):
A,B=[int(x) for x in input().rstrip().split()]
count=0
for i in range(1,20000):
    ans1=int(0.08*i)
    ans2=int(0.1*i)
    if ans1==A and ans2==B:
        print(i)
        count=1
        break
if count==0:
    print(-1)

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

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

mn=max(b*10,a*12.5)
if mn==a*12.5 and a%2==1:
    mn=int(mn)+1
mx=min((b+1)/0.1,(a+1)/0.08)
if mn<mx:
    print(int(mn))
else:
    print(-1)

Solution (Python):
import sys

a, b = map(float, sys.stdin.readline().split())
ans = -1
for i in range(1, 1251):
    if (int(i * 0.08) == a) and (int(i * 0.1) == b):
        ans = i
        break

print(ans)

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

print(n)

Solution (Python):
def check(x, A, B):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        return True
    else:
        return False

def solve(A, B):
    left = 0
    right = 1250
    ans = []
    for i in range(0, 1251):
        if check(i, A, B):
            print(i)
            exit()
    print(-1)

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

    solve(A, B)

if __name__ == "__main__":
    main()

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

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

a = [math.ceil(a * 12.5),(a + 1) * 12.5]
b = [math.ceil(b * 10),math.floor((b + 1) * 10)]


if max(a[0], b[0]) < min(a[1], b[1]):
    print(max(a[0], b[0]))
else:
    print(-1)

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

for i in range(10**4+100):
    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())
for i in range(1,1010):
    x = math.floor(i*0.08)
    y = math.floor(i*0.1)
    if (x==a and y==b):
        print(i)
        break
else:
    print(-1)

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

_a = a/0.08

if _a % 1 == 0.5:
    _as = [int(_a+0.5+i) for i in range(12)]
else:
    _as = [int(_a+i) for i in range(12)]

ans = -1
for x in _as:
    if b == int(x * 0.10):
        ans = x
        break

print(ans)

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

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

ans = 1

while True:
    if ans == 1010:
        ans = -1
        break
    if int(ans * 0.08) == A and int(ans * 0.1) == B:
        break
    ans += 1

print(ans)

Solution (Python):
import math

P = [int(p) for p in input().split()]
A = P[0]
B = P[1]


for i in range(1010):
    if(math.floor(i*0.08)==A and math.floor(i*0.1)==B):
        print(i)
        exit()
print("-1")

Solution (Python):
d8 = {}
d10 = {}
for i in range(1, 10000):
    if int(i * 0.08) not in d8:
        d8[int(i * 0.08)] = i
    if int(i * 0.1) not in d10:
        d10[int(i * 0.1)] = i

A, B = map(int, input().rstrip().split())
a = d8.get(A, None)
aa = d8.get(A + 1, None)
b = d10.get(B, None)
bb = d10.get(B + 1, None)
if a is None or b is None:
    print(-1)
elif max(a, b) < min(aa, bb):
    print(max(a, b))
else:
    print(-1)

Solution (Python):
import math
A,B = map(int,input().split())
A_range = [math.ceil(100*A/8),100*(A+1)//8]
B_range = [10*B,10*(B+1)]

if(min(A_range[1],B_range[1])<=max(A_range[0],B_range[0])):
    print("-1")
else:
    print(max(A_range[0],B_range[0]))

Solution (Python):
import math
a, b = map(int, input().split())
ans = 1000000
for i in reversed(range(a, 10000)):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
        ans = min(i, ans)
        if i * 0.08 == math.floor(i * 0.08):
            break
print(ans) if ans != 1000000 else print(-1)

Solution (Python):
import math
A, B = map(int, input().split())
h = 100/8
l1 = h*A
l2 = 10*B

l = l1 if l1 > l2 else l2

u1 = h*A + h
u2 = 10*B+10

u = u1 if u1 < u2 else u2

cand = math.ceil(l)
if cand < u:
    print(cand)
else:
    print(-1)

Solution (Python):
import math


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

def solve(a, b):
  for n in range(1, 1250 + 1):
    if math.floor(n * 0.08) == A and math.floor(n * 0.1) == B:
      return n

  return -1  
  
print(solve(A, B))

Solution (Python):
import math
a, b = map(int, input().split())
result = 0
m = 99999
for i in range(1, 10001):
    temp1 = math.floor(i * (8/100))
    temp2 = math.floor(i * (10/100))
    if a == temp1 and b == temp2:
        result = i
        break
if result == 0:
    print(-1)
else:
    print(result)

Solution (Python):
A,B=map(int,input().split())
a=[]
b=[]
i=-(-A*25//2)
while int(i*0.08)==A:
  a.append(i)
  i+=1
j=B*10
while int(j*0.1)==B:
  b.append(j)
  j+=1
x=list(set(a).intersection(set(b)))
print(min(x) if len(x)>0 else -1)

Solution (Python):
a, b  = map(int, input().split())
diva = int(a / 0.08)
divb = int(b / 0.1)
start = min(diva,divb)
flag = 0
for i in range(start,start+100):
    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())

upper = 1300

price = -1
for i in range(1, upper):
    tax8 = int(i * 0.08)
    tax10 = int(i * 0.1)
    if a == tax8 and b == tax10:
        price = i
        break

print(price)

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

a=A/0.08
b=(A+1)/0.08
c=10*B
d=10*(B+1)



if a<=c:
    if math.ceil(c)<b:
        print(math.ceil(c))
    else:
        print(-1)
else:
    if math.ceil(a)<d:
        print(math.ceil(a))
    else:
        print(-1)

Solution (Python):
import sys
import math
import copy
import queue
input = sys.stdin.readline
def LI(): return [int(x) for x in input().split()]
INF = 10**15
EPS = 10**(-10)
DD = ((1,0),(0,1),(-1,0),(0,-1))

a , b  = LI()
a0 = math.ceil(a / 0.08)
a1  = int((a+1)/0.08 - EPS)
b0 = math.ceil(b / 0.1)
b1 = int((b+1)/0.1 - EPS)
x = max(a0,b0)
y = min(a1,b1)
if x > y : print (-1)
else : print (x)

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

al = []
for i in range(1, 10001):
    if int(i * 0.08) == a:
        al.append(i)
    elif int(i * 0.08) > a:
        break

bl = []
for i in range(1, 10001):
    if int(i * 0.1) == b:
        bl.append(i)
    elif int(i * 0.1) > b:
        break

for aa in al:
    for bb in bl:
        if aa == bb:
            print(aa)
            exit(0)
else:
    print(-1)

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

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

eight_min = a / 0.08
eight_max = (a+1) / 0.08
ten_min = b / 0.1
ten_max = (b + 1) / 0.1

ans = False
for p in range(int(eight_min), int(eight_max)):
    if eight_min <= p < eight_max and ten_min <= p < ten_max:
        ans = p
        break


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

Solution (Python):
import math

a, b = map(int, input().split())
for n in range(1, 10000):
    if math.floor(n * 0.08) == a and math.floor(n * 0.1) == b:
        print(n)
        exit(0)
print(-1)

Solution (Python):
A,B = map(int,input().split())
X = -1
for i in range(1300):
    if (A <= i * 0.08 and i * 0.08 < A+1) and (B <= i * 0.1 and i * 0.1 < B+1):
        X = i
        break
print(X)

Solution (Python):
import math

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

m=math.ceil( max(a*100/8,b*100/10) )
M=min( (a+1)*100/8 , (b+1)*100/10 ) - 0.0000001
M=math.floor(M)

if m>M:
    print(-1)
else:
    print(int(m))

Solution (Python):
A,B=map(int,input().split())
vA=[]
vB=[]
for i in range(10001):
    if int(i*0.08) == A: vA.append(i)
    if int(i*0.1) == B: vB.append(i)
        
ans=10000

for i in vA:
    if i in vB:ans=min(ans,i)
for i in vB:
    if i in vA:ans=min(ans,i)

if ans==10000: ans=-1        

print(ans)

Solution (Python):

MOD = 10 ** 9 + 7
INFI = 10**10

import math

import itertools



import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default






def main():
    a,b=map(int,input().split())
    ans=-1
    for i in range(1,10001):
        if i*0.08//1==a and i*0.1//1==b:
            ans=i
            break
    print(ans)


if __name__ == "__main__":
    main()

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):
a,b = map(int,input().split())
for i in range(1,10100):
    if(int(i*0.08) == a and int(i*0.1) == b):
        print(i)
        exit()
print('-1')

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

Solution (Python):

import sys
import math


def solve(A: int, B: int):
    
    ans = 1
    for _ in range(1100):
        e = math.floor(ans * 0.08)
        t = math.floor(ans * 0.1)
        if e == A and t == B:
            print(ans)
            return
        ans += 1
    print(-1)
    return



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

if __name__ == '__main__':
    main()

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

for i in range(10001):
    a_tax = int(i * 0.08)
    b_tax = int(i * 0.1)
    if a == a_tax and b == b_tax:
        print(i)
        exit()

print(-1)

Solution (Python):

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



import math
flag=False
ans=-1
for i in range(1,10001):
    a2=i*0.08
    a1=int(i*0.08)
    b1=int(i*0.1)

    if a1==a and b1==b:
        ans=i
        break
print(ans)

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

flg = 0
for i in range(1, math.ceil(max(a, b)/0.08)+1):
    aa = math.floor(i * 0.08)
    bb = math.floor(i * 0.1)
    if a == aa and b == bb:
        print(i)
        flg = 1
        exit()

if flg == 0:
    print(-1)

Solution (Python):
import math

a, b = map(int, input().split())
a_price = (math.ceil(a * 100 / 8), math.ceil((a + 1) * 100 / 8))
b_price = (b * 10, (b + 1) * 10)
ans = max(a_price[0], b_price[0])
if ans >= min(a_price[1], b_price[1]):
    ans = -1
print(ans)

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

pmin = -(-A//0.08)
pmax = (A+1)//0.08

qmin = -(-B//0.1)
qmax = (B+1)//0.1

if pmax < qmin or qmax < pmin:
    print(-1)
else:
    if pmin < qmin:
        print(int(qmin))
    else:
        print(int(pmin))

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    A, B = MAP()

    for i in range(1000):
        if int((i+1)*0.08) == A and int((i+1)*0.1) == B:
            print(i+1)
            sys.exit()

    print(-1)


if __name__ == '__main__':
    main()

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

flag = False
for i in range(1001):
  if math.floor(i*0.08) == a[0]:
    if math.floor(i*0.1) == a[1]:
      flag = True
      break

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

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

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

if ans == 0:
    ans = "-1"

print(ans)

Solution (Python):
a, b = map(int, input().split())
out = -1
for i in range(1250):
    j = i + 1
    if a <= j * 0.08 < a + 1 and b <= j * 0.1 < b + 1:
        out = j
        break

print(out)

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

count = float('inf')
for i in range(int(a//0.08 -1), int((b+1)// 0.1 +1)):
    if i *0.08 >= a and i * 0.08 < (a+1) and i* 0.1 >= b and i* 0.1 < (b+1):
        if i <= count:
            count = i

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

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

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

min = B * 10
max = (B+1) * 10 -1

ans = -1
for i in range(min, max+1):
  if int(i * 0.08) == A:
    ans = i
    break

print(ans)

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

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

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