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



a = ceil(12.5*A)
b = ceil(10*B)




if A%2==0:
    if (a+12 < b) or (b+9 < a):
        print(-1)
    else:
        if a==b:
            print(a)
        elif a > b:
            print(a)
        else:
            print(b)
            
else:
    if (a+11 < b) or (b+9 < a):
        print(-1)
    else:
        if a==b:
            print(a)
        elif a > b:
            print(a)
        else:
            print(b)

Solution (Python):
a,b=input().strip().split(" ")
a,b=[int(a),int(b)]
k=0
for i in range(1200):
    aa=(i*8)//100
    bb=(i*10)//100
    if (a==aa and b==bb):
        print(i)
        k=1
        break
if k==0:
    print(-1)

Solution (Python):
import math
a, b = map(int,input().split())
ans = []
for i in range(1001):
    price_8 = math.floor(i * 0.08)
    price_10 = math.floor(i * 0.1)
    if price_8 == a and price_10 == b:
        ans.append(i)

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

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

ans = -1
for i in range(1, 1011):
    ai = math.floor(i * 1.08)
    bi = math.floor(i * 1.10)
    if ai == i + a and bi == i + b:
        ans = i
        break

print(ans)

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

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

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

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

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

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

Solution (Python):
import math
from sys import stdin


def get_result(data):
    A, B = data
    min_A, max_A = math.ceil(A / 0.08), math.floor((A+1) / 0.08)
    min_B, max_B = math.ceil(B / 0.10), math.floor((B+1) / 0.10)

    tmp_A = [i for i in range(min_A, max_A)]
    tmp_B = [i for i in range(min_B, max_B)]
    ans = list(set(tmp_A) & set(tmp_B))
    if len(ans) == 0:
        return -1

    return min(ans)


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    result = get_result(data)
    print(result)

Solution (Python):
A,B=map(int,input().split())
ans=max((A*100-1)//8+1,B*10)
if ans>=min((((A+1)*100)-1)//8+1,(B+1)*10):
    print(-1)
else:
    print(ans)

Solution (Python):
import math

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

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

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

Solution (Python):
A,B=map(int,input().split());v=max(A*25+1>>1,B*10);print(v if v<min(A*25+26>>1,B*10+10)else-1)

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

ans = -1
for i in range(1, 10100):
    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())
x=min(25*a/2,10*b)
if 25*a/2>=10*(b+1) or 25*(a+1)/2<=10*b:
  print(-1)
else:
  while x<max(25*a/2,10*b):
    x=x+1
  print(int(x))

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

Solution (Python):
import sys, math

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

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

print(-1)

Solution (Python):
import math
a,b = map(int ,input().split())
for i in range(1,10**5):
    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())
if b*10 <= a*100/8 < (b+1)*10:
    if int(a*100/8) == a*100/8:
        print(int(a*100/8))
    else:
        print(int(a*100/8)+1)
else:
    if a*100/8 <= b*10 < (a+1)*100/8:
        print(b*10)
    else:
        print(-1)

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

ret = -1
for i in range(1,1500):
	tax_A = int(i * 0.08)
	tax_B = int(i * 0.10)
	if tax_A == A and tax_B == B:
		ret = i
		break

print(ret)

Solution (Python):
import math
import sys

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

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

Solution (Python):
import sys
import math
readline = sys.stdin.readline
a, b = [int(x) for x in readline().strip().split(" ")]
ans = -1
for i in range(13, 1001):
    if a == math.floor(i * 0.08) and b == math.floor(i * 0.1):
        ans = i
        break
print(ans)

Solution (Python):
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_max < b_min or b_max < a_min):
    print(-1)
elif(a_min <= b_min):
    print(int(b_min))
elif(b_min <= a_min):
    print(int(a_min))

Solution (Python):
import math
A,B = map(int,input().split())
c = 0
for i in range(math.ceil(A/0.08),math.floor((A+0.99)/0.08)+1):
    if c == 1:
        break
    for j in range(math.ceil(B/0.1),math.floor((B+0.99)/0.1)+1):
        if i == j:
            print(i)
            c = 1
            break
if c == 0:
    print(-1)

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

Solution (Python):
A, B = map(int, input().split())
for x in range(10 * B, 10 * B + 10):
    if 12.5 * A <= x < 12.5 * A + 12.5:
        print(x)
        break
else:
    print(-1)

Solution (Python):
a, b = map(int, input().split())
ans=-1
for i in range(1,1010):
  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())
p=10*b
for i in range(10):
  if int(p*0.08)==a:
    print(p)
    break
  p+=1
if p==10*b+10:
  print(-1)

Solution (Python):
A, B = list(map(int, input().split()))
n = int(A/0.08)
while n < (A+1)/0.08 and n < (B+1)/0.1:
  if n >= A/0.08 and n >= B/0.1:
    print(n)
    break
  n += 1
else:
  print(-1)

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

flg = 0
for i in range(1, 1009):
  if int(i * 0.08) == a and int(i * 0.1) == b:
    print(i)
    flg = 1
    break
if flg == 0:
  print(-1)

Solution (Python):
import math

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

A1 = A * 12.5
A2 = (A + 0.9) * 12.5
B1 = B * 10
B2 = (B + 0.9) * 10

if B1 <= A1 and A1 < (B + 1) * 10:
    print(math.ceil(A1))
elif A1 <= B1 and B1 < (A + 1) *12.5 :
    print(B1)
else:
    print(-1)

Solution (Python):

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

price = -1
for n in range(10000):
  if int(n * 0.08) == A and int(n * 0.1) == B:
    price = n
    break
  else:
    pass

print(price)

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


def check(p):
    return int(p * 0.08) == a and int(p * 0.10) == b


def check_all():
    for p in range(10001):
        if check(p):
            return p

    return -1


ans = check_all()
print(ans)

Solution (Python):
a, b = map(int, input().split())
for i in range(1, 10 ** 5):
    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())
min = math.floor(a / 0.08)
max = math.ceil((a+1)/0.08)
ans = 0
for i in range(min, max):
    if math.floor(i * 0.08) == a and math.floor(i*0.1) == b:
        ans = i
        break
if ans == 0:
    print("-1")
else:
    print(ans)

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




min_A = math.ceil(A/0.08)
max_A = math.ceil((A+1)/0.08) - 1

min_B = math.ceil(B/0.1)
max_B = math.ceil((B+1)/0.1) - 1

if min(max_A, max_B) < max(min_A, min_B):
  print('-1')
else:
  print(max(min_A, min_B))

Solution (Python):
A, B =map(int, input().split())
max_A=(A+1)*25/2
max_B=10*(B+1)
p=int(round(max([A*12.5,B*10])+0.4999999999,0))
print(p if(p<min([(A+1)*25/2, 10*(B+1)]) and not(4<5*A-4*B) and not(5*A-4*B<-5)) else -1)

Solution (Python):
ret = "-1"

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

for i in range(1,2000):
    if int(i*0.08) == A and int(i * 0.1) == B:
        ret = str(i)
        break

print(ret)

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

for i in range (1251):
  if (int(i*0.08)==a) and (int(i/10)==b):
    print(i)
    exit()

print(-1)

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

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

def tax(A,B):
    count=0
    x=B/0.1
    if int(x*0.08)>A:
        return '-1'
    y=int(x*0.08)
    while True:
        if y<A:
            count+=1
            x+=1
            y=int(x*0.08)
        else:
            if count>9:
                return '-1'
            else:
                return int(x)
            break

print(tax(A,B))

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

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

M = 1009
for n in range(1,M):
  if (int(n*0.08) == A) and (int(n*0.1) == B):
    print(int(n))
    sys.exit()

print(-1)

Solution (Python):
a,b = map(int, input().split())
v = round(a*12.5+0.1)
w = round(a*12.5+11.6)
x = int(b*10)
y = int(b*10+9)
if(max(v,x) <= min(w,y)):
    print(max(v,x))
else:
    print(-1)

Solution (Python):
import math
a,b = map(int, input().split())
for i in range(1,1200):
    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 = [int(i) for i in input().split()]

p = -1
b = int(B / 0.1)

for i in range(10):
    n = math.floor((b+i) * 0.08)
    if n == A:
        p = b+i
        break

print(p)

Solution (Python):
A, B = map(int, input().split())
def func():
    for ans in range(2000):
        if int(ans * 0.08) == A and int(ans * 0.1) == B:
            return ans
    return -1
print(func())

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

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

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

for i in range(1, 10000):
    if (i * 8) // 100 == a and (i * 10) // 100 == b:
        print(i)
        break
else:
    print(-1)

Solution (Python):
import sys
a,b=map(int,sys.stdin.readline().split())

left=1
right=1009
for i in range(1,1010):
    if int(0.08*i)==a and int(0.1*i)==b:
        print(i)
        sys.exit()

print(-1)

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

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

else :
        print(-1)

Solution (Python):
import math
A,B = map(int,input().split())
Acand = []
for i in range(math.ceil(A*(100/8)),math.floor((A+1)*(100/8))):
  Acand.append(i)
Bcand = []
for i in range(math.ceil(B*10),math.floor((B+1)*10)):
  Bcand.append(i)
doub = list(set(Acand) & set(Bcand))
doub.sort()
if len(doub) == 0:
  print(-1)
else:
  print(doub[0])

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

for i in range(1200):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        flg=1
        break

if flg==0:
    print(-1)

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

N=[i for i in range(int(-(-A//0.08)),int(-(-(A+1)//0.08)))]
M=[i for i in range(int(-(-B//0.1)),int(-(-(B+1)//0.1)))]

if N[0] in M:
    print(int(-(-A//0.08)))
elif M[0] in N:
    print(int(-(-B//0.1)))
else:
    print(-1)

Solution (Python):
import sys
import math

f = sys.stdin.readline()
xx = f.split(' ')
x = [int(str) for str in xx]

a = x[0]
aa = a+1
b = x[1]
bb = b+1


x = int(a / 0.08)
xx = int(aa / 0.08)
y = int(b / 0.1)
yy = int(bb / 0.1)


if ( x > y ):
	min = x
	if( x * 0.08 < a):
		min = x + 1
	if( min >= yy):
		print "-1"
	else:
		print min
else:
	min = y
	if( min >= xx):
		print "-1"
	else:
		print min

sys.stdout.flush()

Solution (Python):

AB = input().split(' ')
A = int(AB[0]) ; B = int(AB[1])
ans = []
for x in range(1,10*(B + 1)):
    p = x * 0.1 - B
    q = x * 0.08 - A
    if (p >= 0) and (p < 1) and (q >= 0) and (q < 1):
        ans.append(x)
        break
if len(ans) == 0:
    print(-1)
else:
    print(ans[0])

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

for p in range(10**4):
    tax8 = p*0.08
    tax10 = p*0.1

    if int(tax8)==a and int(tax10)==b:
        print(p)
        exit()

print(-1)

Solution (Python):
a,b = map(int, input().split())
j = -1
for t in range(1, 1010):
    if int(t*0.08) == a and int(t*0.1) == b:
        j = t
        break

print(j)

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

Solution (Python):
import math

s = input().split(' ')
a = int(s[0])
b = int(s[1])
a1 = a / 0.08
a += 0.9999
a2 = a / 0.08
b1 = b / 0.1
b += 0.9999
b2 = b / 0.1


if a2 < b1 or b2 < a1:
    print(-1)
elif a1 >= b1:
    print(int(math.ceil(a1)))
else:
    print(int(math.ceil(b1)))

Solution (Python):

import math

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

for n in range(25):
  l = (25 * a + n) % 2
  m = 25 * a + n
  if(l == 0):
    if((m/2 - 10 * b) == int(m/2 - 10 * b) and (m/2 - 10 * b) < 10 and (m/2 - 10 * b) >= 0):
      x = int(m/2)
      break
  if(n == 24):
    x = -1
    break
    
print("{}".format(x))

Solution (Python):
import math

s = input().split(' ')
a = int(s[0])
b = int(s[1])
a1 = a / 0.08
a += 0.9999
a2 = a / 0.08
b1 = b / 0.1
b += 0.9999
b2 = b / 0.1


if a2 < b1 or b2 < a1:
    print(-1)
elif a1 >= b1:
    print(int(math.ceil(a1)))
else:
    print(int(math.ceil(b1)))

Solution (Python):
import math
a , b = map(int,input().split())
al = math.ceil(a / 0.08)
ar = math.floor((a + 1)/0.08)
bl = math.ceil(b/0.1)
br = math.floor((b+1)/0.1)
ans = 0
if al <= bl and ar > bl:
    ans = bl
elif al >= bl and br > al:
    ans = al
else:
    ans = -1
print(ans)

Solution (Python):
import math
a , b = map(int,input().split())
al = math.ceil(a / 0.08)
ar = math.floor((a + 1)/0.08)
bl = math.ceil(b/0.1)
br = math.floor((b+1)/0.1)
ans = 0
if al <= bl and ar > bl:
    ans = bl
elif al >= bl and br > al:
    ans = al
else:
    ans = -1












if ar < al or br < bl:
    ans = -1
print(ans)

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

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

print(-1)

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 = list(map(int,input().split()))
X = []
mA = int(100/8*A)
MA = int(100/8*(A+1))+1
mB = int(10*B)
MB = int(10*(B+1))+1
 

for i in range(max(mA,mB),min(MA,MB)):
    X.append(i)


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

Solution (Python):
A, B = map(int, input().split())
done = False
for i in range(1, 1001):
    if A == (i *8 // 100) and B == (i * 10 // 100):
        print(i)
        done = True
        break

if not done:
        print(-1)

Solution (Python):
A,B=map(int,input().split())
for i in range(10,1250):
  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())
flag = 0
for i in range(1,10**5):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        print(i)
        flag += 1
        break
if flag == 0:
    print(-1)

Solution (Python):
import math

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
eight_list = []
ten_list = []
eight_min = math.ceil(A/0.08)
ten_min = math.ceil(B/0.10)
eight_list.append(eight_min)
ten_list.append(ten_min)

eight_min += 1
while(math.floor(eight_min*0.08)==A):
    eight_list.append(eight_min)
    eight_min += 1

ten_min += 1
while(math.floor(ten_min*0.10)==B):
    ten_list.append(ten_min)
    ten_min += 1



try:
    print(min(set(eight_list)&set(ten_list)))
except ValueError:
    print(-1)

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

res = -1;

for x in range(10 * b, 10 * b + 10):
    if (2 * x) // 25 == a:
        res = x;
        break;

print(res);

Solution (Python):
A,B=(int(x) for x in input().split())
for N in range(1001):
    a=int(N*0.08)
    b=int(N*0.1)
    if a==A and b==B:
        print(N)
        break
    if N==1000:
        print("-1")

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

ans = -1

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

print(ans)

Solution (Python):
def main():
    a, b = map(int, input().split())
    
    flg = 0
    for i in range(10000):
        tmp_a = int(i*0.08)
        tmp_b = int(i*0.1)
        if a == tmp_a and b == tmp_b:
            print(i)
            flg = 1
            break
    
    if flg == 0:
        print(-1)



if __name__ == '__main__':
    main()

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

for i in range(1001):
  a = int(i * 0.08)
  b = int(i * 0.10)
  if a == A and b == B:
    print(i)
    break
else:
  print(-1)

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

Solution (Python):
import math

def main():

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

    a_l = A / 0.08
    a_m = (A + 1) / 0.08

    b_l = B / 0.1
    b_m = (B + 1) / 0.1

    l = max(a_l, b_l)
    m = min(a_m, b_m)

    c = math.ceil(l)

    if c < m:
        print(int(c))
    else:
        print(-1)


if __name__ == '__main__':
    main()

Solution (Python):
import math
a,b = map(float, input().split())
min8 = 12.5*a
max8 = 12.5*(a+1)
min10 = 10*b
max10 = 10*(b+1)
if max8 < min10 or max10 < min8:
    print('-1')
    exit()
if min8 > min10:
    min = min8
else:
    min = min10
if max8 < max10:
    max = max8
else:
    max = max10
if math.ceil(min) < max:
    print(math.ceil(min))
else:
    print("-1")

Solution (Python):
import math 

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

if (A / 0.08) > (B / 0.10):
  withOutA = math.ceil(A / 0.08)
  withOutB = math.floor(B / 0.10)
else:
  withOutA = math.floor(A / 0.08)
  withOutB = math.ceil(B / 0.10)


mark = True

for i in range(min(int(withOutA), int(withOutB)), max(int(withOutA), int(withOutB)) + 1):  
  if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
    print(i)
    mark = True
  else:
    mark = False

if not mark:
  print(-1)

Solution (Python):
import sys

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

max_n = (b + 1) * 10

for i in range(max_n):
    if a == int(i * 0.08) and b == int(i * 0.1):
        print(i)
        sys.exit()

print(-1)

Solution (Python):
import math
ab = input().split(' ')
if len(ab) != 2:
    raise Exception

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

min_x_a = math.ceil(a / 0.08)
bound = (a + 1) / 0.08
if bound == int(bound):
    max_x_a = int(bound) - 1
else:
    max_x_a = int(bound)

min_x_b = math.ceil(b / 0.1)
bound = (b + 1) / 0.1
if bound == int(bound):
    max_x_b = int(bound) - 1
else:
    max_x_b = int(bound)

if min_x_a < min_x_b and max_x_a < min_x_b:
    print(-1)
elif min_x_b < min_x_a and max_x_b < min_x_a:
    print(-1)
else:
    print(max(min_x_a, min_x_b))

Solution (Python):
import math 

from sys import stdin
 



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

A_min = int(math.ceil(100*A/8))
A_max = int(math.floor((100*A + 1)/8))
B_min = 10*B 


A_ = []
c = int(math.ceil(100*A/8))
while c < (A + 1)*100/8:
	A_.append(c)
	c += 1
B_ = []
c = 10*B 
while c < 10*B + 10:
	B_.append(c)
	c += 1 

C = list(set(A_) & set(B_))
if len(C) == 0:
	print (-1)
else:
	print (min(C))

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

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

for x in range(1010):
    if(x * 8 // 100 == A and x * 10 // 100 == B):
        print(x)
        exit()
    
print(-1)

Solution (Python):


import math

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

lower = math.ceil(a / 0.08)
upper = math.ceil(a / 0.08 + 12.5) - 1

if upper >= b * 10 and lower <= b * 10 + 9:
    print(max(b * 10, lower))
else:
    print(-1)

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

Solution (Python):
import numpy as np


eight, ten = map(lambda x: int(x), input().split(' '))

def oriPrice(a, b):
  """
  <int> a = round(0.08 * ori)
  <int> b = round(0.10 * ori)
  """
  
  for i in range(10, 0, -1):
    possibleOri = (b+1)/0.10-i
    if np.int(np.floor(possibleOri*0.08)) == a:
      return np.int(possibleOri)
    
  return -1

print(oriPrice(eight, ten))

Solution (Python):
import numpy as np


eight, ten = map(lambda x: int(x), input().split(' '))

def oriPrice(a, b):
  """
  <int> a = round(0.08 * ori)
  <int> b = round(0.10 * ori)
  """
  
  possibleOri = [(b+1)/0.10-i for i in range(10, 0, -1)]
  
  for i in range(len(possibleOri)):
    if np.int(np.floor(possibleOri[i]*0.08)) == a:
      return np.int(possibleOri[i])
  
  return -1

print(oriPrice(eight, ten))

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

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

print(-1)

Solution (Python):
a,b = map(int,input().split())
n = 1
while n <=10000:
  if n*8//100 == a and n*10//100 == b:
    print(n)
    break
  n +=1
else:
  print(-1)

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

for i in range(1, 1001):
    if int(i * 0.08) == a and int(i * 0.10) == b:
        print(i)
        break
else:
    print(-1)

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

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

Solution (Python):
import math

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

    
    x_min = max(math.ceil(A / 0.08), math.ceil(B / 0.1))
    
    x_max = min((math.ceil((A + 1) / 0.08), math.ceil((B + 1) / 0.1)))

    
    for x in range(x_min, x_max + 1):
        if (math.floor(x * 0.08) == A) and (math.floor(x * 0.1) == B):
            print(x)
            quit()

    
    print(-1)


if __name__ == "__main__":
    main()

Solution (Python):
A, B = map(int,input().split())
base_A = int(A / 0.08) if A / 0.08 - int(A/0.08) < 0.5 else int(A / 0.08)+1
base_Aplus = int((A+1) / 0.08)
count = 0
for i in range(base_A, base_Aplus):
  if (int(i * 0.1) == B):
    ans = i
    count += 1
    break
if count > 0:
  print(ans)
else:
  print(-1)

Solution (Python):

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

min_8 = ceil(A / 0.08)
max_8 = ceil((A+1) / 0.08)

min_10 = ceil(B / 0.1)
max_10 = ceil((B+1) / 0.1)

ans = -1

for i in range(min_8,max_8):
    if i in range(min_10,max_10):
        ans = i
        break

print(ans)

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

def non_taxed_price_8(x):
    min_8 = x/0.08
    Max_8 = (x+1)/0.08
    eight = set(range(ceil(min_8), ceil(Max_8)))
    return eight

def non_taxed_price_10(x):
    min_10 = x/0.1
    Max_10 = (x+1)/0.1
    ten = set(range(ceil(min_10), ceil(Max_10)))
    return ten

a = non_taxed_price_8(A)
b = non_taxed_price_10(B)

r = a&b
if len(r) == 0:
    print(-1)
else:
    print(min(list(r)))

Solution (Python):
import math

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

INF = 10**4
for x in range(INF):
    if math.floor(x * 0.08) == A:
        if math.floor(x * 0.10) == B:
            print(x)
            exit()

print(-1)

Solution (Python):
from math import ceil 
A, B = map(int,input().split())
def non_taxed_price_8(x):
    min_8 = x*12.5
    Max_8 = (x+1)*12.5
    eight = set(range(ceil(min_8), ceil(Max_8)))
    return eight

def non_taxed_price_10(x):
    min_10 = x*10
    Max_10 = (x+1)*10
    ten = set(range(ceil(min_10), ceil(Max_10)))
    return ten

a = non_taxed_price_8(A)
b = non_taxed_price_10(B)

r = a&b
if len(r) == 0:
    print(-1)
else:
    print(min(list(r)))

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

for x in range(10000):
    if math.floor(x * 8 / 100) == a:
        if math.floor(x * 10 / 100) == b:
            print(x)
            exit()

print(-1)

Solution (Python):
import numpy as np


A,B = map(int,input().split())
point = 0
for i in range(1,1001):
    
    if np.floor(i * 0.08) == A and np.floor(i * 0.1) == B:
        print(i)
        point = 1
        break
        
if point == 0:
    print('-1')

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

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

def tax8(n):
  res = n*(8/100)
  res = math.floor(res)
  return res

def tax10(n):
  res = n*(1/10)
  res = math.floor(res)
  return res

def excluded(a, b):
  for i in range(1300):
    if ((tax8(i)) == a) and ((tax10(i)) == b):
      return i
  return -1

print(excluded(A,B))

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

price = range(1100)

for i in price:
    if int(i*0.08) == A and int(i*0.1) == B:
        print(i)
        break
else:
    print(-1)

Solution (Python):
from math import ceil, floor

def tax(yen, percent):
  start = yen * 100 / percent
  end = (yen + 1) * 100 / percent
  return set(range(ceil(start), ceil(end)))

A, B = map(int, input().split(" "))
a = tax(A, 8)
b = tax(B, 10)
r = a & b
if len(r):
  print(sorted(list(r))[0])
else:
  print(-1)

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

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

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

for i in range(10, 1300):
  if int(i*0.08) == a:
    if int(i*0.1) == b:
      print(i)
      break
else:
  print(-1)

Solution (Python):

import math

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

min_A = int(math.ceil(A * 12.5))
max_A = int(math.ceil((A + 1) * 12.5) - 1)

grp_A = {i for i in range(min_A, max_A + 1)}

min_B = int(math.ceil(B * 10))
max_B = int(math.ceil((B + 1) * 10) - 1)

grp_B = {i for i in range(min_B, max_B + 1)}

ans = grp_A & grp_B

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

print(ans)

Solution (Python):
import math

S = input().split(' ')
A = int(S[0])
B = int(S[1])
p = -1
for x in range(2100):
    if math.floor(x*0.08) == A and math.floor(x*0.1) == B:
        p = x
        break
print(p)

Solution (Python):
import math
A,B = map(int,input().split())
minA=math.ceil(float(A  )*100/8) 
minB=math.ceil(float(B  )*100/10)
maxA=float(A+1)*100/8
maxB=float(B+1)*100/10

print(max(minA,minB)) if max(minA,minB)<min(maxA,maxB) else print(-1)

Solution (Python):
import math

inputs=input().split()
a=float(inputs[0])
b=float(inputs[1])

res=-1
for p in range(1111):
  if a == math.floor(p *0.08) and b == math.floor(p *0.1):
    res=p
    break
print(res)

Solution (Python):
from math import ceil,floor
def without_tax(a,b):
    w_a = ceil(a/0.08)
    m_w_a = ceil((a+1)/0.08) -1
    w_b = ceil(b/0.1)
    m_w_b = ceil((b+1)/0.1) -1
    result = max(w_a,w_b)
    if result > min(m_w_a,m_w_b): 
        return -1
    return result
a,b = [int(e) for e in input().split()]
print(without_tax(a,b))

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

while True:
  p=i*8//100
  q=i//10
  if p==a and q==b:
    break
  i+=1
  if i>=(a+1)*13 and i>(b+1)*10:
    print(-1)
    exit()
print(i)

Solution (Python):
cuts = []
for i in range(2000):
  cuts+= [[int(i*0.08), int(i*0.10)]]
  
A, B = map(int,input().split())

for i in range(1,2000):
  if [A, B] == cuts[i]:
    print(i)
    break
else:
  print(-1)

Solution (Python):
import math


class Solution:
    def solve(self, A: int, B: int) -> int:

        for i in range((B+1)*10):
            if int(math.floor(i * 0.08)) == A and int(math.floor(i * 0.10)) == B:
                return i

        return -1


if __name__ == '__main__':

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

    
    solution = Solution()
    print(solution.solve(A, B))

Solution (Python):
tax_8, tax_10 = map(int, input().split())
ans = -1

for i in range(1250):
  if (i+1) * 0.08 //1 == tax_8 and (i+1) * 0.1 //1 == tax_10:
    ans = i+1
    break

print(ans)