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



for x in range(1,100001):
    if int(0.08 * x) == a and int(0.1 * x) == b:
        print(x)
        break
    elif x == 100000:
        print(-1)

Solution (Python):



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

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

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

for i in range(1009):
    if A == int(0.08*i) and B == int(0.10*i):
        ans = i
        break
    elif i == 1008:
        ans = -1  

print (ans)

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

xa_min = math.ceil((A * 100) / 8)
xa_max = math.floor(((A + 1) * 100) / 8)

xb_min = math.ceil((B * 100) / 10)
xb_max = math.floor(((B + 1) * 100) / 10)

low_price = max(xa_min, xb_min)

if xb_max <= xa_min or xa_max <= xb_min:
    print(-1)
else :
    print(low_price)

Solution (Python):
import math

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

a_low = math.ceil(a*12.5)
a_high = math.floor((a+1)*12.5-0.01)
b_low=b*10
b_high=b*10+9

if b_high < a_low or a_high < b_low:
    print(-1)
else:
    print(max(a_low, b_low))

Solution (Python):
a,b = map(int,input().split())
li = []
for i in range(1,1010):
    if int(i*0.08) == a and int(i*0.1) == b:
        li.append(i)
if len(li) > 0:
    print(li[0])
else:
    print(-1)

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

min8 = (A * 25 + 1) // 2 
max8 = ((A+1) * 25 - 1) // 2
min10 = B * 10
max10 = (B+1) * 10 - 1

if min10 > max8 or min8 > max10:
	print(-1)
else:
	print(max([min8, min10]))

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


def solve():
    for i in range(100*100):
        if( int(i * 0.08) == A and int(i*0.1)==B ):
            return i
    return -1
print(solve())

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

count = 0
for i in range(1,10001):
  if i *0.08//1 == a:
    if i *0.1//1 == b:
      print(i)
      if i *0.1//1 == b:
        break
    else:
        count = count +1
  else:
    count = count + 1

if count == 10000:
  print(-1)

Solution (Python):
import math
a1,b1 = map(int,input().split())
a2 = a1+1
b2 = b1+1
p1 = a1/0.08
p2 = a2/0.08
p3 = b1/0.1
p4 = b2/0.1

i1 = math.ceil(p1)
i2 = math.floor(p2-0.000001)
i3 = math.ceil(p3)
i4 = math.floor(p4-0.000001)

for i in range(i1, i2):
  if i >=i3 and i<i4:
    print(i)
    exit()
print(-1)

Solution (Python):
import math
a,b = map(int,input().split())
a_min = math.ceil(a / 0.08)
a_max = math.floor((a + 1) / 0.08) - 1
b_min = math.ceil(b / 0.1)
b_max = math.floor((b + 1) / 0.1) - 1
 
if a_max < b_min or b_max < a_min:
  print('-1')
else:
  result = b_min if a_min <= b_min else a_min
  print(result)

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

Solution (Python):
a,b=(int(x) for x in input().split())
 
import math 
 
i=0
while i<10001:
  i+=1
  if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
    print(i)
    break
else:
  print(-1)

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

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

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

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

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

i = math.floor(a/0.08)
while i < 10001:
    if math.floor(i*0.08) == a and math.floor(i*0.1) ==b:
        print(i)
        break
    i += 1
else:
    print(-1)

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

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

Solution (Python):


t = input().split()
a = int(t[0])
b = int(t[1])

def judge(a, b):
    a_min = a / 0.08
    a_max = (a+1) / 0.08

    b_min = b / 0.1
    b_max = (b+1) / 0.1

    for c in range(int(a_min), int(a_max)):
        if c < a_min:
            continue
        for d in range(int(b_min), int(b_max)):
            if d < b_min:
                continue
            if c == d:
                return c
    return -1

print(judge(a,b))

Solution (Python):
import math
tax = input().split(" ")
tax_8 = int(tax[0])
tax_10 = int(tax[1])

price_8 = [math.ceil(tax_8*(100/8)), math.ceil((tax_8+1)*(100/8))-1]
price_10 = [math.ceil(tax_10*(10)), math.ceil((tax_10+1)*(10))-1]
if(min(price_8[1], price_10[1]) < max(price_8[0], price_10[0])):
    print(-1)
else:
    print(max(price_8[0], price_10[0]))

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

Solution (Python):
def solve(a, b):
    for x in range(3000):
        if 0 <= (x*0.08 - a) < 1 and 0 <= (x*0.1 - b) < 1:
            return x
    return -1

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

Solution (Python):
inp = input().split()
a = int(inp[0])
b = int(inp[1])

def check(a, b):
    for i in range(1,1001):
        if (a<=i*0.08) and (a+1>i*0.08):
            if (b<=i*0.1) and (b+1>i*0.1):
                return i
    return -1

print(check(a, b))

Solution (Python):
A,B = [int(i) for i in input().rstrip().split()]
Aa = A/0.08
Ba = B/0.1
round=lambda x:int((x*2+1)//2)
N = round(max(Aa,Ba))

def ch(n):
    global A,B
    
    if int(n * 0.08) == A and int(n * 0.1) == B:
        return True
    else:
        return False

if ch(N-1):
    print(N-1)
elif ch(N):
    print(N)
else:
    print(-1)

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

Solution (Python):
import math
A,B = list(map(int,input().split()))
def problem_gksn(A, B):
  x_min = math.ceil(A / (0.08))
  x_max = math.floor((A+1)/0.08)
  y_min = math.ceil(B / (0.10))
  y_max = math.floor((B+1) / (0.10))
  
  if max(x_min, y_min) < min(x_max, y_max):
    return max(x_min, y_min)
  else:
    return -1
print(problem_gksn(A,B))

Solution (Python):
import math
A,B = list(map(int,input().split()))
def problem_gksn(A, B):
  x_min = math.ceil(A / (0.08))
  x_max = math.floor((A+1)/0.08)
  y_min = math.ceil(B / (0.10))
  y_max = math.floor((B+1) / (0.10))
  if max(x_min, y_min) < min(x_max, y_max):
    return max(x_min, y_min)
  else:
    return -1
print(problem_gksn(A,B))

Solution (Python):
import math
A ,B = list(map(int,input().split()))
 
def problem_koganemaru(A,B):  
  for price in range(10000):
    if math.floor(price*0.08) == A and math.floor(price*0.1) == B:
      return price
  return -1
 
print(problem_koganemaru(A,B))

Solution (Python):
import math

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

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

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

Solution (Python):
A,B = map(int,input().split())
for ans in range(1,10**6+1):
    if ans * 0.8 //10 == A and  ans // 10 == B:
        print(ans)
        quit()
print(-1)

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

x = max((A*100+7)//8, B*100//10)
y = min((A+1)*100/8, (B+1)*100/10)

if x < y:
    ans = x
else:
    ans = -1

print(ans)

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

Solution (Python):
a, b = map(int, input().split())
flag = True
for i in range(1010):
    t1 = i*1.08
    t2 = i*1.10
    if int(t1-i) == a and int(t2-i) == b:
        print(i)
        flag = False
        break
if flag:
    print(-1)

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

print(-1)

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

ans = -1
for i in range(10000):
    if i * 8 // 100 == A:
        if i * 10 // 100 == B:
            ans = i
            break

print(ans)

Solution (Python):
a,b = map(int,input().split())
for i in range(1,1101):
    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(1,1009):
	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())
ans = -1

for price in range(1, 1009):
    if math.floor(price * 0.08) == a and math.floor(price * 0.1) == b:
        ans = price
        break

print(ans)

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

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

Solution (Python):
a, b = (int(x) for x in input().split())
aa = int(min(a/0.08, b/0.1))
bb = int(max(a/0.08, b/0.1))
ans = -1
for c in range(1500):
    if int(c*0.08) == a and int(c*0.1) == b:
        ans = c
        break
print(ans)

Solution (Python):
def mm(a, b):
    m, r = divmod( (a*(10/100)) ,  (8/100) )

    if (m != b): return -1
    else:
        p = a / (8/100)
        return p


def slow(a, b):
    for x in range(1, 1000000):
        ac = int(x*0.08)
        bc = int(x*0.1)
        if (a == ac and b == bc):
            return x
    return -1


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

print(slow(a, b))

Solution (Python):
tax_a, tax_b = map(int, input().split())
ans = tax_b * 10

for i in range(9):
    if int(ans * 0.08) == tax_a:
        print(ans)
        break
    else:
        ans += 1
else:
    print('-1')

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

Solution (Python):
import sys
A,B = map(int,input().split())
for i in range(1,1251):
  C_8 = int(i*0.08)
  C_10 = int(i*0.1)
  if C_8 == A and C_10 == B:
    print(i)
    sys.exit()

print(-1)

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

for n in range(10000):

    za = n*8//100
    zb = n*10//100

    if A == za and B == zb:
        print(n)
        exit(0)

print(-1)

Solution (Python):
a,b=map(int,input().split())
z,x,c,v=10*b,10*b+10-1,50*a//4,50*(a+1)//4-1
for i in range(max(z,c),min(x,v)+1):
  if i*8//100==a and i//10==b:print(i);exit()
else:print(-1)

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

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

Solution (Python):
import math
A,B=map(int,input().split())
for i in range(10**5):
    a=math.floor(i*0.08)
    b=math.floor(i*0.10)
    if a==A and b==B:
        print(i)
        exit()
    if a>A or b>B:
        print(-1)
        exit()

Solution (Python):
A, B =list(map(int, input().split()))
i=0
for N in range(1,1001):
    N_a=int(N*0.08)
    N_b=int(N*0.1)
    
    if A==N_a and B==N_b:
        print(N)
        i+=1
        break
if i==0:
    print(-1)

Solution (Python):
flag = False
a,b=(int(x) for x in input().split())
for i in range(1,1010):
    mul_1 = int(i*0.08)
    mul_2 = int(i*0.1)
    
    if a==mul_1 and b == mul_2:
        flag = True
        print(i)
        if flag == True:
            break
        

else:
    print(-1)

Solution (Python):
import math
from decimal import *
A,B = list(map(int, input().split()))
ans = -1
for x in range(1, 10001):
    a = math.floor(x * Decimal(0.08))
    b = math.floor(x * Decimal(0.1))
    if a == A and b == B:
        ans = x
        break
print(ans)

Solution (Python):
import sys

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

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

print(-1)

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

for i in range(1,1010):

	ia=int(i*0.08)
	ib=int(i*0.1)

	if ia==a and ib==b:
		print (i)
		exit()
else:
	print (-1)

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

Solution (Python):
tax = [int(n) for n in input().split()]

max_8tax = (tax[0]+1) / .08
min_8tax = tax[0] / .08
max_10tax = int((tax[1]+1) / .1) - 1
min_10tax = int(tax[1] / .1)

r = -1

for i in range(min_10tax, max_10tax):
    if min_8tax <= i and i < max_8tax:
        r = i
        break

print(r)

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

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

Alow = A*100//8
Ahi  = (A+1)*100//8

Blow = B*100//10
Bhi  = (B+1)*100//10



Aran = [i for i in range(Alow,Ahi+1) if int(i*0.08) == A]
Bran = [i for i in range(Blow,Bhi+1) if int(i*0.10) == B]


resRan = sorted(list(set(Aran) & set(Bran)))

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

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

for i in range(1010):
    s = math.floor(i*0.08)
    t = math.floor(i*0.10)
    if s == a and t == b:
            print(i)
            break
else:
    print(-1)

Solution (Python):
import math
s = input().split(" ")
A = int(s[0])
B = int(s[1])

for i in range(1001):
    e = math.floor(i * 0.08)
    t = math.floor(i * 0.1)

    if e == A and t == B:
        print(i)
        break
else:
    print(-1)

Solution (Python):
A,B=map(int,input().split())
Aans=0
for i in range(10000):
  if int(i*0.08)==A:
    Aans=i
    break
    
Bans=0
for i in range(10000):
  if int(i*0.1)==B:
    Bans=i
    break

if Aans > Bans:
  if (int(Aans*0.1))==B:
    print(Aans)
  else:
    print("-1")
elif Aans < Bans:
  if (int(Bans*0.08))==A:
    print(Bans)
  else:
    print("-1")
else:
  print(Aans)

Solution (Python):
A,B=map(int,input().split())
x=int(A/0.08)
y=int(B/0.1)
if int(x*0.08)!=A:
    x+=1
if int(y*0.1)!=B:
    y+=1
eight=[i for i in range(x,1251) if int(i*0.08)==A]
ten=[i for i in range(y,1001) if int(i*0.1)==B]
eight_set=set(eight)
ten_set=set(ten)
ans_set=eight_set&ten_set
ans=list(ans_set)
if len(ans)>0:
    print(min(ans))
else:
    print(-1)

Solution (Python):
import math

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

for i in range(0,10):

  if math.floor((b*10+i)*0.08)==a:
    print(b*10+i)
    exit()
print("-1")

Solution (Python):
import math
a,b = map(int, input().split())
flag=True
ans=0
for i in range(b * 10,b * 10+9):
    if math.floor(i * 0.08) == a:
        flag = False
        ans = i
        break
if flag:
    print(-1)
else:
    print(ans)

Solution (Python):
import math
a = list(map(int,input().split()))
ans = -1
n = a[0] * 12 - 1
for i in range(n,1001):
    a0 = i * 0.08
    a0 = math.floor(a0)
    a1 = i * 0.1
    a1 = math.floor(a1)
    if (a0 == a[0]) and (a1 == a[1]):
        ans = i
        break
print(ans)

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

m = B * 10
for i in range(m, m + 10):
    if i * 8 // 100 == A:
        print(i)
        break
else:
    print(-1)

Solution (Python):
import math


def main():
    A, B = map(int, input().split())
    la = []
    lb = []
    for i in range(2000):
        if math.floor(i * 0.08) == A:
            la.append(i)
        if math.floor(i * 0.1) == B:
            lb.append(i)
    for sla in la:
        if sla in lb:
            return sla
    return -1


print(main())

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

for i in range(13 , 1001):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        sys.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
import sys
a , b = map(int , input().split())

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

print(-1)

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

for i in range(2000):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        sys.exit()

print(-1)

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

for i in range(1, 1010):
    A = math.floor(0.08 * i)
    B = math.floor(0.1 * i)
    if a == A and b == B:
        print(i)
        break
    elif i == 1009:
        print(-1)

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

Solution (Python):
S = input().split()
A = int(S[0])
B = int(S[1])
R = -1
for i in range(1009):
  
  j = i + 1
  AMTA = int(j * 0.08)
  AMTB = int(j * 0.1)
  if AMTA == A and AMTB == B:
    R = j
    break
  if AMTA > A and AMTB > B:
    break
print(R)

Solution (Python):
a,b =input().split()
A = int(a)
B = int(b)
N = []
for i in range(1300):
  if int(i * (8/100)) == A and int(i*(10/100)) == B:
    N.append(i)
if len(N)==0:
    print(-1)
else:
    print(min(N))

Solution (Python):

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


import math
p = math.ceil(max(A/0.08, B/0.1))
q = math.floor(min((A+1)/0.08, (B+1)/0.1))

answer = 0
if p < q:
    answer = p
else:
    answer = -1

print(answer)

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

Solution (Python):
import numpy as np

A,B = map(int, input().split())
tmp1 = int(np.ceil(A/0.08))
tmp2 = int(B/0.1)

if tmp1>=tmp2:
    max=tmp1
    if int(np.floor(max*0.1))==B:
        print(max)
    else:
        print(-1)
else:
    max=tmp2
    if int(np.floor(max*0.08))==A:
        print(max)
    else:
        print(-1)

Solution (Python):
a,b =map(int,input().split())
ans = []
for i in range(1,10**4+1):
  if int(i * (8/100)) == a and int(i*(10/100)) == b:
    ans.append(i)
print('-1' if ans == [] else min(ans))

Solution (Python):
a,b =map(int, input().split())
ans = []
for i in range(1,10**4+1):
  if int(i * (8/100)) == a and int(i*(10/100)) == b:
    ans.append(i)
  if len(ans) >= 2:
    break
print('-1' if ans == [] else min(ans))

Solution (Python):
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    a, b = list(map(int, input().rstrip('\n').split()))
    for i in range(1, 1500):
        if int(i * 0.08) == a and int(i * 0.1) == b:
            print(i)
            exit()
    print(-1)


if __name__ == '__main__':
    solve()

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):
A, B = map(int, input().split())
ans = -1
for x in range(1, 2000):
  a = int(x * 0.08)
  b = int(x * 0.1)
  if a == A and b == B:
    ans = x
    break
print(ans)

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

amax = math.ceil((A + 1) / 8 * 100) - 1
amin = math.ceil(A / 8 * 100)
bmax = math.ceil((B + 1) * 10) - 1
bmin = math.ceil(B * 10)

if amin > bmax or bmin > amax:
    print(-1)
else:
    print(int(max(amin, bmin)))

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

price_A = math.ceil(A/0.08)
price_A_max = math.floor(price_A+12.5)
cnt = 0
for i in range(price_A, price_A_max):
	if math.floor(i*0.1)==B:
		cnt = 1
		print(i)
		break
if cnt == 0:
	print(-1)

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

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

for i in range(1,5000):
  if (i*8)//100==A and (i*10)//100==B:
    print(i)
    sys.exit()
print(-1)

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

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

Alist=[i for i in range(ceil(A/0.08),int((A+1)/0.08))]
Blist=[i for i in range(ceil(B/0.1),int((B+1)/0.1))]

if set(Alist)&set(Blist):
  print(min(set(Alist)&set(Blist)))
else:
  print("-1")

Solution (Python):


from sys import stdin, stderr

def main():
   A, B = map(int, stdin.readline().split())
   p = 1
   res = -1
   while True:
      a = (p * 8) / 100
      b = (p * 10) / 100
      if a > A or b > B:
         break
      if a == A and b == B:
         res = p
         break
      p += 1

   print(res)

   return 0

if __name__ == '__main__': main()

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

for i in range(1,1101):
    a1 = int( math.floor( i * 0.08 ) )
    if a1 == a:
        b1 = int( math.floor( i * 0.10 ) )
        if b1 == b:
            print(i)
            exit()
print(-1)

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

res = -1
for i in range(1000,0,-1):
    if (i*8)//100 == A and (i*10)//100 == B:
        res = i

print(res)

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

flg  = False
for i in range(1,1009):
    a_s = int(i * 0.08)
    b_s = int(i * 0.1)
    
    if (a_s == a) and (b_s == b):
        ans = i
        flg = True
        break
        
print(ans if flg else '-1')

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

Solution (Python):
a, b = map(int, input().split())
for i in range(1, 1008):
    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())
max = 1001 
for i in range(1, max):
    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())
ans = -1
for i in range(1,10001):
    aa = math.floor(i*0.08)
    bb = math.floor(i*0.1)
    if aa == a and bb == b:
        ans = i
        break
print(ans)

Solution (Python):
import math
A, B = map(int, input().split())
minV = math.ceil(A / 0.08)
maxV = int((A + 1) / 0.08)
for i in range(minV, maxV):
    if int(i * 0.1) == B:
        print(i)
        exit()
print(-1)

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

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

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

Solution (Python):
import math
A, B = map(int, input().split())
 
min_8 = math.ceil(A  * 12.5)
max_8 = math.ceil((A + 1) * 12.5) -1
min_10 = math.ceil(B * 10)
max_10 = math.ceil((B  + 1) * 10)  -1
 
if (max_10 < min_8 or max_8 < min_10):
    print(-1)
else:
    print(max(min_8,min_10))

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

for ans in range(10**5):
	ta = math.floor(ans * 0.08)
	tb = math.floor(ans * 0.1)

	if ta == A and tb == B:
		print(ans)
		sys.exit()

print(-1)

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

for x in range(1010):
    a = x * 8 // 100
    b = x * 10 // 100

    if a == A and b == B:
        print(x)
        quit()

print(-1)

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

while a >= (magic * 0.08) // 1 and b >= ( magic * 0.1) // 1:
    if a == (magic * 0.08) // 1 and b == ( magic * 0.1) // 1:
        ans = magic
        break
    magic += 1
print(ans)

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

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

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

for i in range(1009):
    a = math.floor((i+1)*0.08)
    b = math.floor((i+1)*0.1)
    if  a==A and b==B:
        print(i+1)
        break
    elif i == 1008:
        print("-1")

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

amax = math.ceil((A + 1) / 8 * 100) - 1
amin = math.ceil(A / 8 * 100)
bmax = math.ceil((B + 1) * 10) - 1
bmin = math.ceil(B * 10)

if amin > bmax or bmin > amax:
    print(-1)
else:
    print(int(max(amin, bmin)))

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

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

amax = math.ceil((A + 1) * 12.5) - 1
amin = math.ceil(A * 12.5)
bmax = math.ceil((B + 1) * 10) - 1
bmin = math.ceil(B * 10)

if amin > bmax or bmin > amax:
    print(-1)
else:
    print(int(max(amin, bmin)))

Solution (Python):
x,y=map(int, input().split())
import math
x1=math.ceil(x*12.5)
x2=math.ceil((x+1)*12.5)-1
y1=math.ceil(y*10)
y2=math.ceil((y+1)*10)-1
if x1>y2 or y1>x2:
	print (-1)
else:
	print (int(max(x1,y1)))

Solution (Python):
import math

A, B = map( int, input().split() )
m, M = B * 10 , A * 13

ans = -1
for x in range( m, M + 1 ):
  if ( math.floor( x * 0.08 ) == A ) and ( math.floor( x * 0.1 ) == B ):
    ans = x
    break
print(ans)

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

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

Solution (Python):

a,b = map(lambda x: int(x),input().split())
ans = -1
for i in reversed(range(1,1011)) :
    a_ans =int(i *0.08)
    b_ans =int(i *0.1)

    if a == a_ans and b == b_ans :
        ans = i
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines 
MOD = 10**9+7

a, b = map(int, inp().split())
ans = -1
for i in range(10, 1003):
  A = int(i*0.08)
  B = int(i*0.1)
  if A==a and B==b:
    print(i)
    exit()
print(ans)

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


out = '-1'

for N in range(1, 1100):
    if int(N * 0.08) == A and int(N * 0.1) == B:
        out = N
        break
print(out)

Solution (Python):
import math
import numpy as np

a,b=map(int, input().split())
j=-1
flag="No"
for i in range(1,1100):
    if int(i*0.08)==a and int(i*0.10)==b:
        j=i
        flag="Yes"
        break
print(j)

Solution (Python):
import sys
from math import floor

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

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

print(-1)

Solution (Python):
import math

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

A_min = math.ceil(A/0.08)
A_max = math.ceil((A+1)/0.08)-1
B_min = math.ceil(B/0.1)
B_max = math.ceil((B+1)/0.1)-1

MIN = max([A_min, B_min])
MAX = min([A_max, B_max])

if MIN > MAX:
    print(-1)
    print('\n')
else:
    print(MIN)
    print('\n')

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

Solution (Python):
a, b = map(int, input().split())
for n in range(1010):
    a1 = int(n * 8/100)
    b1 = int(n * 10/100)
    if a1 == a and b1 == b:
        n1 = n
        break
    else:
        n1 = "-1"
print(n1)

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

Solution (Python):


import math
def solve():
    [a, b] = map(int, input().split())
    
    for i in range(1, 1009):
        if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
            print(i)
            return

    print("-1")

solve()

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

ans =[]
for x in range(10*b+10):
	if a<=x*0.08<a+1 and b<=x*0.1<b+1:
		ans.append(x)
if len(ans) != 0:
	print(min(ans))
else:
	print(-1)

Solution (Python):

from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    a,b = mi()
    for i in range(2000):
        if floor(i*0.08) == a:
            if floor(i*0.1) == b:
                print(i)
                exit()
    print(-1)




main()

Solution (Python):
a, b = map(int, input().split())
for i in range(1100):
    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(1009):
  if A==int(i*0.08):
    if B==int(i*0.1):
      print(i)
      exit()
print(-1)

Solution (Python):
a,b=map(int,input().split())
def ceil(x):
  if x%1==0:
    return x//1
  else:
    return x//1+1
a1=int(ceil(a*100/8))
a2=int(ceil((a+1)*100/8)-1)
b1=int(ceil(b*100/10))
b2=int(ceil((b+1)*100/10)-1)
count=0
for i in range(a1,a2+1):
  if b1<=i<=b2:
    print(i)
    count=0
    break
  else:
    count+=1
if count!=0:
  print(-1)