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




























flag =False
for i in range(1,1010):
    if i*0.08//1==a and i*0.1//1==b:
        print(i)
        flag=True
        break

if not flag:
    print(-1)

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

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

print(ans)

Solution (Python):
import math
def main():
    a, b = map(int, input().split())
    ra = [math.ceil(i/0.08) for i in range(1, 102)]
    rb = [math.ceil(i/0.1) for i in range(1, 102)]
    x = ra[a-1] 
    while x < ra[a] :
        if int(x*0.1) == b:
            return x
        x+=1
    return -1



if __name__ == "__main__":
    print(main())

Solution (Python):
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    A, B = MI()
    for i in range(1009):
        if int(i*0.08) == A and int(i*0.1) == B: print(i); sys.exit()
    print(-1)
if __name__ == '__main__':
    main()

Solution (Python):
def main():
    A,B = map(int,input().split())
    ans = -1
    for num in range(10001,0,-1):
        a = int(num * 0.08)
        b = int(num * 0.10)
        if A==a and B==b:
            ans = num
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import math

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

    ans = -1
    flag = True

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

if __name__ == "__main__":
    main()

Solution (Python):

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

flag = False
res = 1

while res < 1010:
    res_a = int(res * 0.08)
    res_b = int(res * 0.10)
    if res_a == A and res_b == B:
        flag = True
        break
    res += 1

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

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

for i in range(10000):
    if i*8//100==a and i*10//100==b:
        print(i)
        exit()

print(-1)

Solution (Python):
import math

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

    flag = True

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

    if(flag):
        print(-1)

if __name__ == "__main__":
    main()

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


my_index = []
for i in range(1010):
    if int((i*0.08)) ==a and int((i*0.1))==b:
        my_index.append(i)
    if int((i*0.08)) ==b and int((i*0.1))==a:
        my_index.append(i)

if my_index != []:
    print(min(my_index))
else:
    print(-1)

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

    for x in range(1, 1010):
        if int(x * 0.08) == A and int(x * 0.1) == B:
            print(x)
            return

    print(-1)


if __name__ == "__main__":
    main()

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

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

a = input1[0]
b = input1[1]

a1 = math.ceil(a / 0.08)
a2 = math.ceil((a+1) / 0.08)
b1 = math.ceil(b / 0.1)
b2 = math.ceil((b+1) / 0.1)





for i in range(a1, a2):
    for j in range(b1, b2):
        if i == j:
            print(i)
            
            
            exit(0)
print(-1)

Solution (Python):
import math
A, B = map(int, input().split())
 
max_val = int(math.ceil(A / 0.07))
min_val = int(math.floor(B / 0.11))
 
for i in range(min_val, max_val + 1):
    if int(i * 0.08) > A or int(i * 0.1) > B:
        break
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit(0)
print(-1)

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

for n in range(1, 1001):
    if n // (1/0.08) == A and n // (1/0.1) == B:
        ans = n
        break

print(ans)

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

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

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

for x in range(1, 1000+1):
  if int(x * 0.08) == a and int(x * 0.1) == b:
    print(x)
    exit()
else:
  print('-1')

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

for i in range(1,1001):
    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(1, 10000):
    if int(0.08*i) == A and int(0.1*i) == B:
        print(i)
        exit()
print(-1)

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

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

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

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

for n in range(1, 1001):
    if n // (1/0.08) == A and n // (1/0.1) == B:
        ans = n
        break

print(ans)

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

Solution (Python):

import math
A, B = list(map(int, input().split()))
ans1min = A/0.08
ans1max = (A+1)/0.08
ans2min = B/0.1
ans2max = (B+1)/0.1



if ans1min >= ans2min and ans1min < ans2max:
    print(math.ceil(ans1min))
elif ans1min <= ans2min and ans2min < ans1max:
    print(math.ceil(ans2min))
else:
    print('-1')

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

Solution (Python):
import math as mt
K = input().split(" ")
A = int(K[0])
B = int(K[1])
a = float(A*12.5)
t = float((A+1)*12.5)
t1 = mt.ceil(t)
b = B*10
a1 = mt.ceil(a)
A_data = []
B_data = []
for i in range(b,b+10):
    A_data.append(i)
for i in range(a1,t1):
    B_data.append(i)
A_set = set(A_data)
B_set = set(B_data)
AB_set = A_set & B_set
if AB_set:
    P = min(AB_set)
    print(P)
else:
    print(-1)

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

x = b * 10

for i in range(x, x+10):
   ta = (i * 0.08 * 10) // 10
   tb = (i * 0.10 * 10) // 10
   if ta == a and tb == b:
      print(i)
      exit()

print(-1)

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

Solution (Python):
import sys
import math

mymax = int(100/0.1)

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

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

1, 2 and 3

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

AA = A*100//8 + 1 if A*100%8!=0 else A*100//8
AF = (A+1)*100//8 + 1 if (A+1)*100%8!=0 else (A+1)*100//8
BB = B*10
AAA = [i for i in range(AA,AF)]
BBB = [i for i in range(BB,(B+1)*10)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list and (12<min(AB_list)<=1000) else -1
print(ans)

Solution (Python):
a,b=map(int,input().split())
a1=(a*100)//8
a2=((a+1)*100)//8
b1=b*10
b2=(b+1)*10
if (a*100)%8>0:
    a1+=1
if ((a+1)*100)%8>0:
    a2+=1
la=range(a1,a2)
lb=range(b1,b2)
l=list(set(la) & set(lb))
if len(l)==0:
    print("-1")
else:
   l.sort()
   print(l[0])

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

Solution (Python):
A_B = list(map(int, input().split()))
A = A_B[0]
B = A_B[1]

count = 1
while count * 0.08 // 1 != A or count * 0.1 // 1 != B:
    count += 1
    if count * 0.1 - 10 > B:
        print(-1)
        exit()
print(count)

Solution (Python):
a, b = map(int, input().split())
a_max = ( a + 1) // 0.08
b_max = ( b + 1) // 0.1
max = int(a_max) if a_max > b_max else int(b_max)
flg = 0
for i in range(1, max):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        flg = 1
        print(i)
        break

if flg == 0:
    print(-1)

Solution (Python):

import math

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

temp_a1 = 100 * a // 8
temp_a2 = 100 * (a + 1) // 8
temp_b1 = 10 * b
temp_b2 = 10 * (b + 1)

result = -1
for i in range(min(int(temp_a1), int(temp_b1)), min(int(temp_a2), int(temp_b2))):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        result = i
        break

print(result)

Solution (Python):
A,B = map(int,input().split())
mina= 100
minb=100
a = set()
b = set()
C = A/0.08
D= B/0.1
E=(A+1)/0.08
F=(B+1)/0.1 
if C.is_integer() ==False:
  C= A//0.08 +1
if D.is_integer() ==False:
  D= B//0.1 +1

if E.is_integer() ==False:
  E= (A+1)//0.08 

if F.is_integer() ==False:
  F= (B+1)//0.1

C=int(C)
D=int(D)
E=int(E)
F=int(F)
for i in range(C,E):
  a.add(i)
for i in range(D,F):
  b.add(i)
c = a&b
d = list(c)
d.sort()
if len(d) ==0:
  print(-1)
else:
  print(d[0])

Solution (Python):
A, B = map(int,input().split())
ans = 0
flag = False;
for i in range(1,10000):
	a = int(i*0.08)
	b = int(i*0.1)
	if((a==A) and (b==B)):
		ans = i
		flag =True
		break
if(flag == False):
	print(-1)
else:
	print(ans)

Solution (Python):
a, b = map(int, input().split())
for i in range(991):
    c = int((i + 10) * 0.08)
    d = int((i + 10) * 0.10)
    if c == a and d == b:
        print(i + 10)
        exit()
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):
import math
a,b=map(int,input().split())
ans=-1
for i in range(1,5000):
    
    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())
k=True
for i in range(1,1250):
    if (i*(8/100))//1==a:
        if (i*(1/10))//1==b:
            print(i)
            k=False
            break
if k==True:
    print(-1)

Solution (Python):

import sys
import math


def solve(A: int, B: int):

    result = 100000
    count = 0
    for i in range(1, 10000 + 1):
        if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
            result = min(result, i)
            count += 1
    if count == 0:
        print(-1)
    else:
        print(result)
    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 = [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

if __name__ == "__main__":
    A, B = map(int, input().split())
    a = math.ceil(A / 0.08)
    b = math.ceil(B / 0.1)
    
    if math.floor(a * 0.08) == A and math.floor(a * 0.1) == B:
        ret = a
    elif math.floor(b * 0.08) == A and math.floor(b * 0.1) == B:
        ret = b
    else : 
        ret = -1
    print(ret)

Solution (Python):
cmin = lambda a,b : a if a<b else b
cmax = lambda a,b : a if a>b else b
iin = lambda : int(input())
lin = lambda : list(map(int,input().split()))
rin = lambda n : [int(input()) for _ in range(n)]

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

at = []
for i in range(1,1500):
    if int(i*0.08)==a: at += [i]

bt = []
for i in range(1,1500):
    if int(i*0.1)==b: bt += [i]

ans = set(at) & set(bt)

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

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

yes = 0
no = 0
for tax_free in range(1,1011):
    if A == int(tax_free*0.08) and B == int(tax_free*0.1):
        yes += 1
        if yes == 1: Z = tax_free
        else: pass
    else:
        no += 1

if no == 1010: print(-1)
else: print(Z)

Solution (Python):











def main():
    A,B = map(int,input().split())
    a_min = (A/0.08)
    a_max = (A+1)/0.08
    b_min = (B/0.1)
    b_max = (B+1)/0.1
    if a_min!=int(a_min):
        a_min = int(A/0.08)+1
    if b_min!=int(b_min):
        b_min = int(B/0.1)+1
    s_a = [i for i in range(int(a_min),int(a_max))]
    s_b = [i for i in range(int(b_min),int(b_max))]
    for common in s_a:
        if common in s_b:
            print(common)
            return
    print(-1)


if __name__ == "__main__":
    main()

Solution (Python):
A, B = map(int, input().split())
ans1 = int(A *100// 8) 
ans2 = int(B *100 // 10)
ans1_2 = int((A+1) *100 // 8)
ans2_2 = int((B+1) *100 // 10)
list1 = []
list2 = []

for i in range(ans1,ans1_2):
    if int(i * 0.08) == A: 
        list1.append(int(i))
for j in range(ans2,ans2_2):
    if int(j * 0.1) == B:
        list2.append(int(j))
if list1[0] == list2[0]:
    print(list1[0])
elif list1[0] > list2[0]:
    if list1[0] in list2:
        print(list1[0])
    else:
        print(-1)
elif list1[0] < list2[0]:
    if list2[0] in list1:
        print(list2[0])
    else:
        print(-1)

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

x_a = np.arange(math.ceil(12.5 * A), math.ceil(12.5 * (A + 1)))
x_b = np.arange(10 * B, 10 * (B + 1))

a_set = set(x_a)
b_set = set(x_b)

c_set = a_set & b_set
c = list(c_set)

if len(c) != 0:
    print(min(c))

else:
    print("-1")

Solution (Python):
import math;
a,b = map(int,input().split())
x = []
y = []
ans = -1
x.append(math.ceil(a*25/2))
x.append((a+1)*25//2-1)
y.append(b*10)
y.append((b+1)*10-1)
if min(x) < max(y) and min(y) < max(x) and min(y) <= min(x):
  ans = min(x)
elif min(x) < max(y) and min(y) < max(x) and min(x) < min(y):
  ans = min(y)
print(ans)

Solution (Python):
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    result = 1
    while True:
        a = int(result * 0.08)
        b = int(result * 0.1)
        if a == A and b == B:
            print(result)
            break
        if A < a and B < b:
            print(-1)
            break
        result += 1


if __name__ == "__main__":
    main()

Solution (Python):
i = input().split(' ')
A = int(i[0])
B = int(i[1])

for x in range(1,10000000):
    B_hat = int(x/10)
    if B_hat>100:
        break
    if int(x*2/25)==A and B_hat==B:
        print(x)
        exit()
print(-1)

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


for x in range(1500):
  if a/0.08 <= x < (a+1)/0.08 and b/0.1<= x < (b+1)/0.1:

    list.append(x)

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

Solution (Python):
a, b = list(map(int, input().split()))
l = list(range(1, 1001))
s = int(b / 0.1)
t = int(a / 0.08)
temp_a = int(a / 0.08)
temp_b = int(b / 0.1)
ans_8 = []
ans_10 = []
for i in l:
    if i >= t:
        temp = int(i * 0.08)
        if temp == a:
            ans_8.append(i)
for i in l:
    if i >= s:
        temp = int(i * 0.1)
        if temp == b:
            ans_10.append(i)
s = set(ans_8) & set(ans_10)
if s:
    print(min(s))
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 = (int(x) for x in input().split())
h = []
for i in range(1, 1100):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        h.append(i)
h.append(-1)
print(h[0])

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

X1=math.ceil(A/0.08)
X2=math.floor((A+1)/0.08)

if (A+1)*100%8==0:
  X2=X2-1

Y1=math.ceil(B/0.1)
Y2=math.floor((B+1)/0.1)-1



if (Y1>X2)or(X1>Y2):
  print(-1)
elif X1>=Y1:
  print(X1)
else:
  print(Y1)

Solution (Python):
import math

num = {}

num = input().split()



answer1 = math.ceil(int(num[0]) / 0.08)
answer2 = math.ceil(int(num[1]) / 0.1)

kensyo1 = math.floor(answer1 * 0.1) == int(num[1])
kensyo2 = math.floor(answer2 * 0.08) == int(num[0])




if int(num[0]) < 0 or int(num[1]) < 0:
  print(-1)
elif kensyo1:
  print(answer1)
elif kensyo2:
  print(answer2)
else:
  print(-1)

Solution (Python):
import math
A, B =map(int,input().split())
a_assume=math.ceil(A/0.08)
a_upper_limit=math.ceil((A+1)/0.08)
b_upper_limit=(B+1)*10
upper_limit=min(a_upper_limit,b_upper_limit)
while a_assume<upper_limit:
  if B==math.floor(a_assume*0.1):
    print(a_assume)
    break
  else:
    a_assume+=1
if a_assume>=upper_limit:
  print(-1)

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


for x in range(1500):
  if a/0.08 <= x < (a+1)/0.08 and b/0.1<= x < (b+1)/0.1:
    list.append(x)
    
if len(list) == 0 :
  print(-1)
  
else:
  print(min(list))

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

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

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

Solution (Python):
import sys
import math

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

downera = math.ceil(100/8 * a)
uppera = math.floor(100/8 * (a+1))

downerb = 10 * b
upperb = 10 * (b+1)

if uppera < downerb or upperb < downera:
    print("-1")
    sys.exit()
for i in range(downera, uppera):
    if i >= downerb and i < upperb:
        print(i)
        sys.exit()

print("-1")

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

x = 0

ans = -1

while x <= 2000:
    x_a = int(0.08*x)
    x_b = int(0.10*x)

    if x_a == a and x_b == b:
        ans = x
        break

    x += 1

print(int(ans))

Solution (Python):
a,b=map(int,input().split())
ans=0
flag=False
for i in range(b*10,(b+1)*10):
    x=i*8
    if 100*(a+1)>x>=100*a:
        flag=True
        ans=i
        break
print(ans if flag else -1)

Solution (Python):


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

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


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

Solution (Python):
import math

i = list(map(float, input().split()))
m=0

j=i[0]/0.08
k=math.ceil(j)

l=i[1]/0.10
n=math.ceil(l)

while n*0.10<math.ceil(i[1])+1:
	k=math.ceil(j)
	while k*0.08<math.ceil(i[0])+1:
		if k==n:
			m=1
			
			break
		else:
			k+=1
			
			continue
	else:
		n+=1
		
		continue
	break
  
else:
	print('-1')

if m==1:
	print(k)

Solution (Python):

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

eight = int(math.ceil(A / 0.08))
ten = int(math.ceil(B / 0.1))

ans = 10000000000

for i in range(min(ten, eight), max(ten, eight)+1):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans = min(ans,i)


if ans == 10000000000:
    ans = -1
print(ans)

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

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

Solution (Python):
import math

list_8 = []
list_10 = []

for i in range(101):
  list_8.append( math.ceil((i+1) * 12.5) )
  list_10.append( (i+1) * 10 )
  
A, B = map(int, input().split())

A_ = list_8[A] - 1
A = list_8[A-1]
  
B_ = list_10[B] - 1
B = list_10[B-1]

if A <= B <= A_:
  print(B)
elif B <= A <= B_:
  print(A)
else:
  print(-1)

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

Solution (Python):
A, B = map(int,input().split())
import math
a = list()
i = A/0.08
j = (A+1)/0.08
while i < j:
    if int(i) == i:
        k = int(i)
        a.append(k)
        i = i+1
    elif int(i) != i:
        k = int(i+1)
        a.append(k)
        i = i+1
ko = max(a)
if ko == j:
    a.remove(ko)

b = list()
p = B/0.10
q = (B+1)/0.10
while p < q:
    if int(p) == p:
        l = int(p)
        b.append(l)
        p = p+1
    elif int(p) != p:
        l = int(p+1)
        b.append(l)
        p = p+1
mo = max(b)
if mo == q:
    b.remove(mo)

a.append(1000000)
b.append(1000000)
c= set(a) & set(b)
m = min(c)
if m == 1000000:
    print("-1")
else:
    print(m)

Solution (Python):


nums = [int(e) for e in input().split()]
flag = 0
for i in range(1,1001):
  if ((((i * 8) // 100) == nums[0]) & (((i * 10) // 100) == nums[1])):
    flag = 1
    print(i)
    break

if flag == 0:
    print(-1)

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

a_min = float(a)*12.5
a_max = float(a+1)*12.5
b_min = float(b*10)
b_max = float((b+1)*10)

o_min = max(a_min, b_min)
o_max = min(a_max, b_max)

import math

if math.ceil(o_min) < o_max:
    print(str(math.ceil(o_min)))
else:
    print('-1')

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

for value in range(1002):
    if value==1001:
        print('-1')
        break

    if a == math.floor(value * 0.08) and b == math.floor(value * 0.1):
        print(int(value))
        break

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

tmp = int((a*12.5) // 1)
cnt = tmp
'''
while (cnt*0.08)//1 == a:
  cnt += 1
  
if cnt == tmp:
  if (cnt * 0.1)//1 == b:
    print(cnt)
    exit()
'''
for i in range(tmp, 10001):
  ans = (i * 0.08)//1
  bans = (i*0.1)//1
  
  if (bans==b) and ans==a:
    print(i)
    exit()
  elif ans > a:
    break
print(-1)

Solution (Python):
import math

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

aa = math.ceil(A / 0.08)
bb = math.ceil(B / 0.1)


if aa > bb:
    if int(aa * 0.08) != A or int(aa * 0.1) != B:
        print('-1')
    else:
        print(aa)
else:
    if int(bb * 0.08) != A or int(bb * 0.1) != B:
        print('-1')
    else:
        print(bb)

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

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

non_taxed = sorted([(A/0.08),((A+1)/0.08),(B/0.1),((B+1)/0.1)])

for m in range(int(non_taxed[0]),int(non_taxed[3])+1):
    if int(m*0.08) == A and int(m*0.1) == B:
        print(m)
        exit()
print(-1)

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

A_min = math.ceil(A * 25 / 2)
A_max = ((A + 1) * 25 / 2)
if A_max > math.floor(A_max):
    A_max = math.floor(A_max) + 1
else:
    A_max = A_max
A_max = int(A_max)
B_min = B * 10
B_max = (B + 1) * 10

A_list = list(range(A_min, A_max))
B_list = list(range(B_min, B_max))



min_ans = -1
for num in A_list:
    if num in B_list:
        min_ans = num
        break
    else:
        continue

print(min_ans)

Solution (Python):
import math
a, b = (int(i) for i in input().split())
x = math.ceil(a / 0.08)
flag = False
while math.floor(x * 0.08) == a:
    if (math.floor(x * 0.1) == b):
        flag = True
        break
    x = x + 1
if flag:
    print(int(x))
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, raw_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())
N=0
flag=0
while N<1250 and flag==0:
  N += 1
  a = int(N * 0.08 // 1)
  b = int(N * 0.1 // 1)
  
  if a==A and b==B:
    flag = 1
    
if flag==1:
  print(N)
else:
  print(-1)

Solution (Python):
from math import floor

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

res = -1
for price in range(1, 10**6):
    if floor(price*0.08) == A and floor(price*0.1) == B:
        res = price
        break

print(res)

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

Solution (Python):
n,m = map(int,input().split())
l = -1
for num in range(n*10,(m+1)*10+1):
    if int(num * 0.08) == n and int(num * 0.1) == m:
        l = num
        break
    else:
        continue
print(l)

Solution (Python):
import sys
import math

read = sys.stdin.readline
S = read()

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

fin = False
for i in range(1000+1):
    if a == math.floor(i * 0.08):
        if b == math.floor(i * 0.1):
            print(i)
            fin = True
            break
if not fin:
    print(-1)

Solution (Python):
import math

a, b = list(map(int, input().split()))
result = -1
end_flag = False
for i in range(1, 1251):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 1001):
                y = math.floor(j * 0.1)
                if i == j:
                    if int(y) == b:
                        result = i
                        end_flag = True
                        break
print(result)

Solution (Python):
a, b = map(int, input().split())
a_min = int(a / 0.080 + 0.9)
a_max = int((a + 0.9) / 0.080)
b_min = int(b / 0.100 + 0.9)
b_max = int((b + 0.9) / 0.100)
if a_max < b_min or b_max < a_min:
    ans = -1
elif a_min <= b_min:
    ans = b_min
elif b_min <= a_min:
    ans = a_min
print(ans)

Solution (Python):
import math
A,B = map(int,input().split())
a = A / 0.08
b = B / 0.1

if a > b:
    if int(a * 0.1) == B:
        print(math.ceil(a))
    else:
        print(-1)
elif b > a:
    if int(b * 0.08) == A:
        print(math.ceil(b))
    else:
        print(-1)
else:
    print(math.ceil(a))

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

h,j = map(int,input().split())
s=int(h*(25/2))
while True:
    hh=int(s*(2/25))
    jj=int(s/10)
    if(hh==h and jj==j):
        print(s)
        exit()
    if(hh>h and jj>j):
        print(-1)
        exit()
    s+=1

Solution (Python):
import math

s = input()

ss = s.split(" ")

TAX_A = 0.08
TAX_B = 0.1

A = int(ss[0])
B = int(ss[1])

ans = 10000
re = False
for i in range(10000,0,-1):
  tax_a = math.floor( i * TAX_A ) 
  tax_b = math.floor( i * TAX_B )
  if tax_a == A and tax_b == B:
    if i < ans :
      ans = i
      re = True

if re == True:
  print( ans )
else:
  print(-1)

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

x = 9
while True:
  if a == int(x * 0.08) and b == int(x*0.1):
    print(x)
    break
  elif a < int(x * 0.08) and b < int(x*0.1):
    print(-1)
    break
  x += 1

Solution (Python):

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

x1 = -(-a //0.08)
x2 = -(-b //0.1)
counter = int(max(x1,x2))
for i in range(1,counter+1):
  y1 = int(i * 0.08)
  y2 = int(i * 0.1)
  if y1 == a and y2 == b:
    print(i)
    exit()
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())

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

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

N2min = AB[1] * 10
N2max = AB[1] * 10 + 9

N1min = int(AB[0] * 12.5)
N1max = int((AB[0] + 0.9) * 12.5)
if (N2min <= N1max) and (N1min <= N2max):
    if (N1min < N2min):
        print(N2min)
    else:
        i = 0
        while (int((N1min - i) * 0.08) == AB[0]):
            i += 1
        print(N1min - i + 1)
else:
    print(-1)

Solution (Python):
import math
 
def main():
  a, b = list(map(int, input().split()))
  
  for i in range(a, 1099):
    if not math.floor(i * 0.08) == a:
      continue
    if not math.floor(i * 0.1) == b:
      continue
    return i
  
  return -1
  
print(main())

Solution (Python):
import math
a,b=map(int,input().split())
m=b*10
n=m
result=-1
while math.floor(n*0.1)==b:
  if math.floor(n*0.08)==a:
    result=n
    break
  n+=1
print(result)