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 ceil as c
a,b=map(int,input().split())
amin=c(a/0.08)
amax=c((a+1)/0.08)-1
bmin=b*10
if amax<bmin or bmin+9<amin:
    print(-1)
elif bmin<amin:
    print(amin)
else:
    print(bmin)

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

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

index = 0
val_list = list(range(0, 1263))

is_exist = False
while len(val_list) > 0:
    mid = len(val_list) // 2
    av = int(val_list[mid] * 0.08)
    bv = int(val_list[mid] * 0.1)
    if av == A and bv == B:
        index = mid
        is_exist = True
        break
    else:
        if av > A or bv > B:
            val_list = val_list[:mid]
        else:
            val_list = val_list[mid+1:]

if is_exist:
    ans = 0
    for i in range(0, index+1):
        if int(val_list[i] * 0.08) == A and int(val_list[i] * 0.1) == B:
            ans = val_list[i]
            break
    print(ans)
else:
    print(-1)

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

number1 = A*100/8
number2 = B*100/10
if number1 != number1//1:
    number1 = number1//1 + 1
if number2 != number2//1:
    number2 = number2//1 + 1
number1 = int(number1)
number2 = int(number2)

if number1//10 == B:
    if number2*8//100 == A:
        if number1 <= number2:
            print(number1)
        else:
            print(number2)
    else:
        print(number1)
else:
    if number2*8//100 == A:
        print(number2)
    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, input().split())
x = int(100 * a / 8)
y = int(100 * b / 10)
ans = min(x, y)
count = 0
ansi = 0
for i in range(30):
    ansi = ans + i
    if int(ansi * 8 / 100) == a and int(ansi * 10 / 100) == b:
        break
    count += 1
if count == 30:
    print("-1")
else:
    print(ansi)

Solution (Python):




def main():
    A, B = map(int, input().split())
    range_min = int(max((A) / 0.08, (B) / 0.1))
    range_max = int(min((A + 1) / 0.08, (B + 1) / 0.1))

    for i in range(range_min, range_max + 1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            print(i)
            exit(0)
    print(-1)


if __name__ == "__main__":
    main()

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





def getS(A, B):
    if A / 0.08 <= B / 0.10:
        start = int(A / 0.08)
        end = int((B + 1) // 0.10 + 1)
        for S in range(start, end):
            if int(S * 0.08) == A and int(S * 0.10) == B:
                return S
        return -1
    elif B / 0.10 < A / 0.08:
        start = int(B / 0.10)
        end = int((A + 1) // 0.08 + 1)
        for S in range(start, end):
            if int(S * 0.08) == A and int(S * 0.10) == B:
                return S
        return -1
    
print(getS(A, B))

Solution (Python):
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)
    break
  
  if i == 1250:
    print(-1)

Solution (Python):
import math
x = input().split()

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

T = "n"
for i in range(1500):
  if math.floor(0.08*i) == A and math.floor(0.1*i) == B:
    print(i)
    T = "y"
    break
if T == "n":
  print(-1)

Solution (Python):
import math

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

a_1 = math.ceil(a/0.08)
a_2 = math.ceil((a+1)/0.08)
b_1 = b * 10
b_2 = (b+1) * 10

if a_1 >=b_2 or b_1 >= a_2:
    print(-1)
else:
    print(max(a_1,b_1))

Solution (Python):
import math

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

print(-1)

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

ans = -1
x = b * 10
for i in range(10):
    if math.floor((x + i) * 0.08) == a:
        ans = x + i
        break
print(ans)

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

Solution (Python):
from math import floor
def main():
    A, B = map(int, input().split())
    minX = -1
    fB = (B*10 // 10) * 10
    bXCands = [fB+i for i  in range(10)]
    for aXcand in bXCands:
        if int(aXcand * 0.08) == A:
            minX = aXcand
            break
    print(minX)



    
    
    
    

    
    
    
    
    
    
    
    

main()

Solution (Python):

import math
a, b = map(float, input().split())
i = math.ceil(a/0.08)
while i*0.08 < a+1:
    
    if math.floor(i*0.1) == b:
        print(i)
        break
    else:
        i += 1
else:
    print('-1')

Solution (Python):


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]
    
    (a, b) = [int(e) for e in lines[0].split(" ")]

    return (a, b)


def solve(a, b):

   
    x1f = math.floor(a / 0.08)
    x1c = math.ceil(a / 0.08)
    x2f = math.floor(b / 0.1)
    x2c = math.ceil(b / 0.1)

    both = []
    if math.floor(x1f * 0.08) == a and math.floor(x1f * 0.1) == b:
        both.append(x1f)

    if math.floor(x1c * 0.08) == a and math.floor(x1c * 0.1) == b:
        both.append(x1c)

    if math.floor(x2f * 0.08) == a and math.floor(x2f * 0.1) == b:
        both.append(x2f)

    if math.floor(x2c * 0.08) == a and math.floor(x2c * 0.1) == b:
        both.append(x2c)


    result = -1
    if len(both):
        result = min(both)
    

    return  result


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

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

Solution (Python):
def resolve():
    inf = 2000

    a,b =map(int, input().split())
    ax = [int(x*0.08) for x in range(inf)]
    bx = [int(y*0.1) for y in range(inf)]
    aans = []
    bans = []
    for i,j in enumerate(ax):
        if j == a:
            aans.append(i)
    for i,j in enumerate(bx):
        if j == b:
            bans.append(i)
    ans_set = set(aans) & set(bans)
    if len(ans_set)!=0:
        print(min(ans_set))
    else:
        print("-1")
    
if __name__ == "__main__":
    resolve()

Solution (Python):



def main():
    tax8, tax10 = map(int, input().split())

    rate8 = 0.08
    rate10 = 0.1
    value8 = tax8 / rate8
    value10 = tax10 / rate10

    price_min = int(min(value8, value10))
    price_max = int(max(value8, value10)) + 1

    

    for price in range(price_min, price_max + 1):
        
        if int(price * rate8) == tax8 and int(price * rate10) == tax10:
            print(price)
            return 0
    
    print('-1')

    return 0


if __name__ == '__main__':
    main()

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

num = math.ceil(25 / 2 * A)
A_list = []

if A % 2 == 0:
  while num <= math.floor(25 / 2 * (A + 1)):
    A_list.append(num)
    num += 1
else:
  while num < 25 / 2 * (A + 1):
    A_list.append(num)
    num += 1

res = -1
A_list.sort(reverse=True)
for item in A_list:
  if item >= 10 * B and item < 10 * (B + 1):
    res = item

print(res)

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

p = int(a // 0.08)
q = int(b // 0.1)
s = 13 if p < 24 else p - 12
e = 999 if q > 999 else q + 10
for i in range(s, e+1):
    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())

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

print(ans)

Solution (Python):
import math

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

X = 13

while math.floor(X * 0.08) != A or math.floor(X * 0.10) != B:
    X += 1
    if math.floor(X * 0.08) > A:
        X = -1
        break

print(X)

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**9)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a,b = na()

c = int(min(a//0.08,b//0.1))

while True:
	d = int(c*0.08)
	e = int(c*0.1)
	if d == a and e == b:
		print(c)
		exit()
	if d > a or e > b:
		print(-1)
		exit()
	c+=1

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

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

minA = float(A) / 0.08
maxA = (float(A)+0.9) / 0.08
minB = float(B) / 0.1
maxB = (float(B)+0.9) / 0.1

if (minA >= minB)&(minA <= maxB):
	if (ceil(minA) < maxA) & (ceil(minA)< maxB):
		print(ceil(minA))
	else:
		print(-1)
elif(minB > minA)&(minB <= maxA):
	if (ceil(minB) < maxA) & (ceil(minB)< maxB):
		print(ceil(minB))
	else:
		print(-1)
else:
	print(-1)

Solution (Python):
from math import ceil

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

a_min = a * 100 / 8
a_max = (a + 1) * 100 / 8

b_min = b * 100 / 10
b_max = (b + 1) * 100 / 10

out = max(a_min, b_min)
print(ceil(out) if (out < a_max) & (out < b_max) else -1)

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

lsta = list(range(math.ceil(12.5*A), math.ceil((A+1)*12.5)))

ans = -1

for i in lsta:
    if int(i*0.1)==B:
        ans=i
        break
print(ans)

Solution (Python):
if __name__ == '__main__':
    a,b = [int(a.strip()) for a in input().strip().split(' ')]
    min_a = int(12.5*a+0.5)
    max_a = int(12.5*(a+1)+0.5)
    
    
    

    min_b = 10*b
    max_b = 10*(b+1)

    flg = 0
    for i in range(min_a,max_a):
        if i in range(min_b,max_b):
            print(i)
            flg = 1
            break

    if flg == 0:
        print('-1')

Solution (Python):


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

price = "-1"
for x in range(1, 100000+1):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        price = x
        break

print(price)

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

tax1 = 0.08
tax2 = 0.1
ans = -1
for i in range(1, 1001):
    if A <= i * tax1 and i * tax1 < A + 1:
        if B <= i * tax2 and i * tax2 < B + 1:
            ans = i
            break

print(ans)

Solution (Python):
import sys
nums=input().rstrip().split(" ")
A=int(nums[0])
B=int(nums[1])
answer=0
for i in range(1,1500):
    
    
    if int(i*0.1)==B and int(i*0.08)==A:
        answer=i
        print(answer)
        sys.exit()
if answer==0:
    answer=-1
print(answer)

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

flag = False

X = min([(A*100)//8, B*10])

while  X*8 < A*100 + 100 and X*10 < B*100 + 100:
    if A*100 <= X*8 and B*100 <= X*10:
        flag = True
        break
    
    X += 1
    
if flag:
    print(X)
else:
    print(-1)

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

import math
A_under = math.ceil(A / 0.08)
A_over = math.ceil(((A+1) / 0.08) - 1)


for i in range(A_under, A_over+1):
  if math.floor(i * 0.1) == B:
    print(i)
    break
  elif i == A_over:
    print("-1")

Solution (Python):
from math import floor
def Main(A, B):
    a = A * 12.5
    b = B * 10
    st = floor(min(a, b))
    for i in range(st, 1251):
        if floor(i * 0.08) == A and floor(i * 0.1) == B:
            return i
    return -1 
                     

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

if __name__ == '__main__':
    main()

Solution (Python):

import math

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

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

B_min = math.ceil(B / 0.1)
B_max = (B + 1) / 0.1

ans = max(A_min, B_min)
if ans < A_max and ans < B_max:
    print(ans)
else:
    print(-1)

Solution (Python):
import math

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

flag = -1
for i in range(10*B, (10*B)+9):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        flag = i
        break
print(flag)

Solution (Python):
import math
ab=list(map(int, input().split()))
a=ab[0]
b=ab[1]
a0=12.5*a
a1=12.5*(a+1)
b0=10*b
b1=10*(b+1)
answer=0
if(a0>=b1):
    answer=-1
elif(a1<=b0):
    answer=-1
else:
    if(a0<b0):
        answer=math.ceil(b0)
    else:
        answer=math.ceil(a0)
print(int(answer))

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


answer = -1

for i in range(1020):
    if int(i*0.08) == a and int(i*0.1) == b:
        answer = i
        break

print(int(answer))

Solution (Python):
import sys

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

l = int(A / 0.08 + 1 - 1e-8)
r = int((A + 1) / 0.08 + 1 - 1e-8)

x = -1
for i in range(l, r):
    if int(i * 0.1) == B:
        x = i
        break

print(x)

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

Solution (Python):
A,B=map(int,input().split())
miA=-(-A//0.08)
maA=-(-(A+1)//0.08)-1
miB=-(-B//0.1)
maB=-(-(B+1)//0.1)-1
if max(miA,miB)<=maA and max(miA,miB)<=maB:
  print(int(max(miA,miB)))
else:
  print(-1)

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

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

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_min <= b_min:
    if b_min < a_max:
        if int(b_min) == b_min:
            print(int(b_min))
        else:
            print(int(b_min+1))
    else:
        print('-1')
else:
    if a_min < b_max:
        if int(a_min) == a_min:
            print(int(a_min))
        else:
            print(int(a_min+1))
    else:
        print('-1')

Solution (Python):
a,b=map(int,input().split())
n=int(100*100/8)+1
ans=0
x=0
for i in range(1,n+1):
  x=i
  if int(i*0.08)==a and int(i*0.1)==b:
    ans=i
    break
if x==n:
  print(-1)
else:
  print(ans)

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

ans = 0
while ans <= 10000:
    ans += 1
    if math.floor(ans * 0.08) == a and  math.floor(ans * 0.1) == b:
        print(ans)
        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 = [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):
L = input().split()
A = int(L[0])
B = int(L[1])
if A % 2 == 0:
    Amin = A / 0.08
    Aout = (A + 1) / 0.08
else:
    Amin = A / 0.08 + 0.5
    Aout = (A + 1) / 0.08
Bmin = 10*B
Bout = 10*(B + 1)
if Amin < Bout and Bmin < Aout:
    if Amin <= Bmin:
        print(int(Bmin))
    else:
        print(int(Amin))
else:
    print(-1)

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

for i in range(int(-(-a//0.08)),int(-(-(a+1)//0.08))):
    for j in range(int(-(-b//0.1)),int(-(-(b+1)//0.1))):
        if(i == j):
            print(i)
            exit()
print(-1)

Solution (Python):
import numpy as np

a, b = list(map(int, input().split()))
minXa = int(np.ceil(a / 0.08))
minXb = b * 10
maxXa = int(np.ceil((a+1) / 0.08))
maxXb = (b+1) * 10

ansX = 9999
ansY = 9999
for x in range(minXa, maxXa):
    if(int(x*0.1) == b):
        ansX = x
        break

for y in range(minXb, maxXb):
    if(int(y*0.08) == a):
        ansY = y
        break

        
if(ansX == 9999 and ansY == 9999):
    print(-1)
else:
    print(min(ansX, ansY))

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

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

print(-1)

Solution (Python):
a,b=map(int,input().split())
x1=int(a//0.08)+1
x2=int((a+1)//0.08)

y1=int(b//0.1)+1
y2=int((b+1)//0.1)

xx=[i for i in range(x1,x2)]
for z in xx:
    if z>=y1 and z<=y2:
        print(z)
        exit()
    
print(-1)

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

for n in range(10000):
    if math.floor(n * 0.08) == A and  math.floor(n * 0.1) == B:
        print(n)
        exit()
print('-1')

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

an = [math.ceil(a*(100/8)) , math.floor((a+1)*(100/8))-1]
bn = [math.ceil(b*(100/10)) , math.floor((b+1)*(100/10))-1]
    
ax = []
bx = []
    
for i in range(an[0],an[1]+1):
    ax.append(i)
    
for i in range(bn[0],bn[1]+1):
    bx.append(i)
    
for i in range(len(ax)):
    for j in range(len(bx)):
        if ax[i] == bx[j]:
            ans = min(ans,ax[i])
    
if ans != inf:
    print(ans)
else:
    print("-1")

Solution (Python):
if __name__ == '__main__':
	A, B = map(int, input().split())
	MAX = B * 20
	c = 0
	for i in range(MAX):
		a = int(i * 0.08)
		b = int(i * 0.1)
		if a == A and b == B:
			print(i)
			c = 1
			break
	if c == 0:
		print(-1)

Solution (Python):
A, B = list(map(int, input().split()))
x = 10*B
cnt = 0
while cnt < 9:
    if int(x*0.08) == A:
        print(x)
        break
    x+=1
    cnt+=1

if cnt == 9:
    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
import numpy as np
a, b = map(int, input().split())

MAX = 1000 + 1
xa = np.zeros((MAX))
xb = np.zeros((MAX))

for i in range(MAX):
    xa_tmp = math.floor(0.08 * i)
    if xa_tmp == a:
        xa[i] = 1

for i in range(MAX):
    xb_tmp = math.floor(0.1 * i)
    if xb_tmp == b:
        xb[i] = 1



x = xa + xb

ans = -1
for i in range(MAX):
    if x[i] == 2:
        ans = i
        break

print(ans)

Solution (Python):
import math
import sys

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

A = math.floor(a / 0.08)
B = math.floor(b / 0.10)

for i in range(1,1251):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10) == 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

Solution (Python):
import math
a,b=map(int,input().split())
a1=math.ceil(a/0.08)
a2=math.floor((a+1)/0.08)
A=set([i for i in range(a1,a2)])
b1=math.ceil(b/0.1)
b2=math.floor((b+1)/0.1)
B=set([i for  i in range(b1,b2)])

if A&B==set(): 
    print(-1)
    exit()

print(min(A & B))

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

    for i in range(1001):
        a = int(0.08*i)
        b = int(0.1*i)
        
        if (a == A) and (b == B):
            print(i)
            return 0
    print(-1)
    return 0
if __name__ == '__main__':
    main()

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

x = ceil(a / 0.08)
y = ceil(b / 0.1)

x, y = min(x, y), max(x, y)
for i in range(x, y + 1):
    if floor(i * 0.08) == a and 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(1251):
  if math.floor(i*2/25) == A and math.floor(i/10) ==B:
    print(i)
    exit()
print('-1')

Solution (Python):
import math

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

a = set(range(math.ceil(A/0.08), math.ceil((A+1)/0.08)))
b = set(range(math.ceil(B/0.1), math.ceil((B+1)/0.1)))

c = a & b

if c:
    print(min(c))
else:
    print(-1)

Solution (Python):
import math
A,B = map(int,input().split())
ans = -1
start =math.floor(A / 0.1)
end = math.ceil(B /0.08)

for i in range (start,end+10):
    if  math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        ans = i
        break

print(ans)

Solution (Python):
import math

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

p_A = math.floor((A+1) * 100 / 8)
n_A = math.ceil(A * 100 / 8)
p_B = math.floor((B+1) * 100 / 10)
n_B = math.ceil(B * 100 / 10)

if n_A > p_B or n_B > p_A:
    print('-1')
else:
    ans = max(n_A, n_B)
    if math.floor(ans * 0.08) == A and math.floor(ans * 0.1) == B:
        print(ans)
    else:
        print('-1')

Solution (Python):
import math

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

na = [a / 0.08, (a+1) / 0.08]
nb = [b / 0.1,  (b+1) / 0.1 ]

def adjust_float(l):
    mn, mx = l
    return [
        math.ceil(mn),
        math.floor(mx) if mx % 1 != 0 else int(mx - 1),
    ]

na = adjust_float(na)
nb = adjust_float(nb)

if nb[1] < na[0] or na[1] < nb[0]:
    print(-1)
elif na[0] <= nb[0] and nb[0] <= na[1]:
    print(int(nb[0]))
elif nb[0] <= na[0] and na[0] <= nb[1]:
    print(int(na[0]))

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

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

amin = (a/0.08)*-1//1*-1
amax = ((a+1)/0.08)//1
if ((a+1)/0.08)%1 == 0:
    amax -= 1

bmin = (b/0.1)*-1//1*-1
bmax = ((b+1)/0.1)//1
if ((b+1)/0.1)%1 == 0:
    bmax -= 1

ans = float("inf")
if amin <= bmax and amin >= bmin:
    ans = min(ans, amin)
elif bmin <= amax and bmin >= amin:
    ans = min(ans, bmin)
else:
    ans = -1

print(int(ans))

Solution (Python):
a, b = map(int, input().split())
from math import floor
for i in range(1, 5001):
    if floor(i * 0.08) == a and floor(i * 0.1) == b:
        print(i)
        break
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, input().split())


def tax8(p):
    return (p * 0.08 // 1)


def tax10(p):
    return (p * 0.1 // 1)


for p in range(1, 2000):
    tmp8 = tax8(p)
    tmp10 = tax10(p)
    if tmp8 == a and tmp10 == b:
        print(p)
        exit(0)

print('-1')

Solution (Python):
a,b= list(map(int, input().split()))
s=-1
n=int(a/0.08)
while a>=int(n*0.08):
    if int(n*0.08)==a and int(n*0.1)==b:
        s=n
        break
    n+=1
print(s)

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

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

start = int(((a * 100)/8) + 0.5)
if a % 2 == 0:
    candidate1 = list(range(start, start + 13))
else:
    candidate1 = list(range(start, start + 12))
start = (b * 10)
candidate2 = list(range(start, start + 10))

ans = -1
for i in candidate2:
    if i in candidate1:
        ans = i
        break
print(ans)

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


flag = 1
for i in range(1,100000):
    if (i*0.08)//1==A and (i*0.1)//1==B:
        flag = 0
        print(i)
        break

if flag:
    print("-1")

Solution (Python):
import math

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

ans_A = A * (100 / 8)
ans_B = B * 10

for x in range(1251):
    if math.floor(x * 0.08) == A and math.floor(x * 0.1) == B:
        print(x)
        exit()

print(-1)

Solution (Python):
import math

a,b = map(int,input().split())
alow = math.ceil((a)/0.08)
ahigh = math.floor((a+1)//0.08)

blow = math.ceil((b)/0.1)
bhigh = math.floor((b+1)//0.1)

if alow < blow:
    if blow <= ahigh <= bhigh:
        print(blow)
    else:
        print(-1)

elif blow < alow:
    if alow  <= bhigh <= ahigh:
        print(alow)
    else:
        print(-1)

elif alow == blow:
    print(alow)

Solution (Python):
def main():
    A, B = [int(x) for x in input().split()]
    for num in range(1, 10001):
        if int(num * 0.08) == A and int(num * 0.1) == B:
            print(num)
            return
        elif int(num * 0.08) > A and int(num * 0.1) > B:
            break
    
    print(-1)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
f=0
list = list(map(int, input().split()))
for i in range(1001):
    if int(i*0.08)==list[0] and int(i*0.1)==list[1]:
        print(i)
        f=1
        break
if f==0:
    print(-1)

Solution (Python):
def main():
    a,b = map(int,input().split())
    lst = calc_task(a,b)
    answer = 0
    if len(lst) == 0:
        answer = -1
    else:
        answer = lst[0]
    print(answer)

def calc_task(a,b):
    return [n for n in range(1,2000) if ((n * 8 // 100)==a and (n * 10 // 100)==b)]



if __name__ == '__main__':
    main()

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

a1 = 0
a2 = 0
if a*100 % 8 == 0:
    a1 = a/0.08
else:
    a1 = a//0.08 + 1

a2 = (a+1)//0.08

b1 = b / 0.1
b2 = (b+1) / 0.1

a1 = int(a1)
a2 = int(a2)
b1 = int(b1)
b2 = int(b2)

al = []
bl = []

for i in range(a1, a2+1):
    al.append(i)
for i in range(b1, b2):
    bl.append(i)

ans = set(al) & set(bl)
if len(ans) == 0:
    print(-1)
else:
    print(min(ans))

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()]
 
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()]
 
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 =  [float(i) for i in input().split(' ')]

B1 = int(B /0.1)
B2 = int((B+1) / 0.1)
flag = 0
for i in range(B1, B2):
    if int(i * 0.08) == A :
        print(i)
        flag = 1
        break
if flag == 0:
    print(-1)

Solution (Python):
import math

a, b = map(int, input().split())
a_origin = math.ceil(a*100/8)
b_origin = b*10

while True:
    if a_origin == b_origin:
        result = a_origin
        break;
    if a_origin < b_origin:
        a_origin += 1
    else:
        b_origin += 1

    if a_origin >= (a+1) * 100/8 or b_origin >= (b+1) * 10:
        result = -1
        break

print(result)

Solution (Python):
A, B = map(int, input().split(" "))
_min = int(A / 0.10)
_max = int(B / 0.08)
flg = True
for i in range(_min-3, _max+3):
  if int(i *  0.08) == A and int(i * 0.10) == B:
    print(i)
    flg = False
    break
if flg:
  print(-1)

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

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

print(-1)

Solution (Python):
from math import ceil, floor
 
a, b = [int(c) for c in input().split(" ")]
A = ceil(a / 0.08)
B = ceil(b/ 0.1)
 
if (A < B):
  if (floor(B * 0.08) == a):
    print(B)
  else:
    print(-1)
elif (B < A):
  if (floor(A*0.1) == b):
    print(A)
  else:
    print(-1)
else:
  print(A);

Solution (Python):
from math import floor
A, B = map(int, input().split())
tax_A = 0.08
tax_B = 0.1
i = 1
A_list = []
while(floor(i*tax_A)<=A):
    if floor(i*tax_A)==A:
        A_list.append(i)
    i += 1
i = 1
B_list = []
while(floor(i*tax_B)<=B):
    if floor(i*tax_B)==B:
        B_list.append(i)
    i += 1
if max(min(A_list), min(B_list)) in A_list and max(min(A_list), min(B_list)) in B_list:
    print(max(min(A_list), min(B_list)))
else:
    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)

b_min = math.ceil(b / 0.10)
b_max = math.ceil((b + 1) / 0.10)

ans = -1

for i in range(a_min,a_max):
  if i >= b_min and i < b_max:
    ans = i
    break

print(ans)

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

for i in range(int((b+1)/0.1)):
  if math.floor(i *0.08) == a and math.floor(i *0.1) == 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