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

output = -1
for i in range(1, 1001):
    hachi = i * 8 // 100
    juu =  i * 10 // 100
    if hachi == A and juu == B:
        output = i
        break
        
print(output)

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

x_b = b * 10

min_a = (25/2) * a
max_a = (25/2) * (a + 1)

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

min_ = max(min_a, min_b)
max_ = min(max_a, max_b)

_min = int(min_ + 0.5)
_max = int(max_)

if _min >= _max:
    print(-1)

else:
    print(_min)

Solution (Python):
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    a,b = map(int, input().split())
    
    def check(k):
        if floor(k*0.08) == a and floor(k*0.1) == b:
            return True
        else:
            return False
    
    
    
    

    m,n = a / 0.08, b/0.1
    
    for i in range(1300):
        if check(i):
            print(i)
            return
    print('-1')
    return

if __name__ == '__main__':
    main()

Solution (Python):
import math

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

for i in range(1230):
    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

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

print(ans)

Solution (Python):
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)
if a_min>=a_max:
    print(-1)
elif b_min>=b_max:
    print(-1)
else:
    if a_min<b_min:
        if b_min<a_max:
            print(b_min)
        else:
            print(-1)
    if b_min<a_min:
        if a_min<b_max:
            print(a_min)
        else:
            print(-1)  
    if a_min==b_min:
        print(a_min)

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())
import math
for i in range(1,10000):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        break
else:
    print("-1")

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

for i in range(10001):
    A_cal = int(i * 0.08)
    B_cal = int(i * 0.10)

    if A_cal == A and B_cal == B:
        print(i)
        is_found = True
        break
    
if not is_found:
    print(-1)

Solution (Python):
def minmax(v, rate):
    min_v = v / rate * 100
    max_v = (v + 1) / rate * 100
    return (min_v, max_v)


def valid(v, a, b):
    
    return int(v * 0.08) == a and int(v * 0.1) == b


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

    a = minmax(A, 8)
    b = minmax(B, 10)

    
    i = max(int(a[0]), int(b[0]))
    j = min(int(a[1]), int(b[1]))
    for i in range(i, j + 1):
        if valid(i, A, B):
            print(i)
            exit()
    print(-1)


main()

Solution (Python):
import math

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

for i in range(2000,2,-1):
    if (math.floor(i*0.08) == a) and (math.floor(i*0.1) == b):
        s = i

if s != 0:
    print(s)
else:
    print('-1')

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

a_before = a / 0.08

if int(a/0.08) == a/0.08:
    a_min = int(a/0.08)
    a_max = int((a+1)/0.08)
elif int((a+1)/0.08) == (a+1)/0.08:
    a_max = int((1+a)/0.08 - 1)
    a_min = int(a/0.08 + 1)
else:
    a_min = int(a/0.08 + 1)
    a_max = int((a+1) / 0.08)

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

if a_min >= b_min:
    if a_min <= b_max:
        print(a_min)
    else:
        print(-1)
elif b_min > a_min:
    if b_min <= a_max:
        print(b_min)
    else:
        print(-1)

Solution (Python):
import math

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

ans = '-1'

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

if ans == '-1':
    print(ans)
else:
    print(int(ans))

Solution (Python):

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

import math
bool = False
for x in range(10**5):
    if math.floor(x*0.08) == a and math.floor(x*0.10) == b:
        bool = True
        print(x)
        break
        
if bool == False:
    print(-1)

Solution (Python):
import math

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

cost_list = []
state = 0

for i in range(0,1001):
    if math.floor(i/10) == b:
        cost_list.append(i)
    if math.floor(i/10) > b:
        break

for c in cost_list:
    if math.floor(c*0.08) == a:
        print(c)
        state = 1
        break

if state == 0:
    print(-1)

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

def main(A, B):
    
    underN = min(int(A // 0.08), int(B // 0.1))
    upperN = max(int(ceil(A / 0.08)), int(ceil(B / 0.1)))

    for i in range(underN, upperN+1):

        if int(floor(i*0.08)) == A and int(floor(i*0.1)) == B:
            return i
    
    else: return -1
    

if __name__ == "__main__":

    answer = main(A, B)
    print(answer)

Solution (Python):
A,B = map(int,input().split())
a_min = int((A//0.08)+1)
b_min = int((B//0.1)+1)
a_max = int(((A+1)//0.08)+1)
b_max = int(((B+1)//0.1)+1)
lisa = []
lisb = []
ans = []
for i in range(a_min,a_max):
    lisa.append(i)
for j in range(b_min,b_max):
    lisb.append(j)
for k in lisa:
    for g in lisb:
        if k == g:
            ans.append(k)
if ans != []:
    print(ans[0])
else:
    print("-1")

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

ansA=A*(100/8)
if ansA==int(ansA):
    ansA=int(ansA)
else:
    ansA=int(ansA)+1


ansB=B*10

if ansA>=ansB:
    ans=ansA
else:
    ans=ansB

if int(ans*(8/100))==A and int(ans*(10/100))==B:
    print(ans)
else:
    print(-1)

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

n=int(-(-A*25//2))
n0=int(-(-(A+1)*25//2))

d=[-1]

for i in range(n,n0):
    if i//10==B:
        d.append(i)

if d[-1]==-1:
    print(-1)
else:
    print(d[1])

Solution (Python):
import math

import numpy as np

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


try:
    print(min(np.intersect1d(np.arange(math.ceil(a/0.08), (a+1) //0.08+ 1).astype(int), np.arange(math.ceil(b/0.1), (b+1)//0.1 + 1).astype(int))))

except:
    print(-1)

Solution (Python):
import sys
import math

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

if A * (100/8) - int(A * (100/8)) >=0.5:
    target_8  = math.floor(A * (100/8)) + 1
else:
    target_8  = math.floor(A * (100/8))


if A * (100/10) - int(A * (100/10)) >=0.5:
    target_10 = math.floor(B * (100/10)) + 1
else:
    target_10 = math.floor(B * (100/10))

if math.floor(target_8*0.1) == B :
    print(target_8)
    sys.exit()
elif math.floor(target_10*0.08) == A :
    print(target_10)
    sys.exit()
else:
    print('-1')
    sys.exit()

Solution (Python):

''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 \
   /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/g.inp"
exit $?
'''
import sys
import math


def _ia(): return [int(x) for x in sys.stdin.readline().strip().split()]


def main():
    a, b = _ia()
    for i in range(1010):
        xa = math.floor(i * 0.08)
        xb = math.floor(i * .1)
        if xa == a and xb == b:
            return i
    return -1


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

Solution (Python):
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
from functools import lru_cache
INF = 1 << 60


a, b = map(int, input().split())
ans1 = 0
while True:
    if int(ans1 * 8 / 100) == a and int(ans1 / 10) == b:
        break
    if int(ans1 * 8 / 100) > a or int(ans1 / 10) > b:
        ans1 = -1
        break
    ans1 += 1
print(ans1)

Solution (Python):

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

for i in range(1250):
    if int(0.08*i) == a and int(0.1*i) == b:
        print(i)
        break
    else:
        if i == 1249:
            print(-1)
        i += 1

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

for x in range(1, int(10001)):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        exit()
print(-1)

Solution (Python):
import math

A, B = map(int, input().split())
mi = math.floor(min(A/8*100, B*10))
ma = math.ceil(max(A/8*100, B*10))

result = -1

for i in range(mi,ma+1):
    if i*8//100 == A and i//10 == B:
        result = i
        break

print(result)

Solution (Python):
import math

X, Y = map(int, input().split())

a = X / 0.08
b = Y / 0.1

ans = min(a, b)

while math.floor(ans * 0.08) != X or math.floor(ans * 0.1) != Y:
	ans += 1
	if math.floor(ans * 0.08) > a or math.floor(ans * 0.1) > b:
		ans = -1
		break

print(int(ans))

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

ans = 1
exist = True

while True:
  if int(ans*0.08)==a and int(ans*0.1)==b:
    break
  elif int(ans*0.08)>a or int(ans*0.1)>b:
    exist = False
    break
  
  ans += 1
  
print(ans if exist else -1)

Solution (Python):
import math
a, b = map(int, input().split())
a1 = a+1
b1 = b+1
A = a/0.08
A1=a1/0.08
B = b/0.1
B1 = b1/0.1

ans1 = set(i for i in range(math.ceil(A), math.floor(A1)))
ans2 = set(j for j in range(math.ceil(B), math.floor(B1)))

if ans1 & ans2 == set():
    print(-1)
else:
    ans = ans1&ans2
    print(min(list(ans)))

Solution (Python):
import sys
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):
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())
flag = 0
for i in range(1, 10000):
	if int(i*0.08) == a and int(i*0.1) == b:
		print(i)
		flag = 1
		break

if flag == 0:
	print(-1)

Solution (Python):
import math

A, B = list(map(int, input().strip().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 sys
import math
input = sys.stdin.readline

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

Solution (Python):
"""
A<=0.08x<A+1
C<=0.1x<C+1
"""

A,C = (input()).split(" ")
A = (int)(A)
C = (int)(C)

leftA = A/0.08
rightA = (A+1)/0.08

leftC = C/0.1
rightC = (C+1)/0.1



if rightC<=leftA or rightA<=leftC:
    print(-1)
else:
    max_line = max(leftA,leftC)
    if max_line == (int)(max_line):
        print((int)(max_line))
    else:
        print((int)(max_line)+1)

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

Y = B*10  
ans = -1

if A == math.floor(Y*0.08):
    ans = Y
elif A == math.floor((Y+1)*0.08):
    ans = Y+1
elif A == math.floor((Y+2)*0.08):
    ans = Y+2
elif A == math.floor((Y+3)*0.08):
    ans = Y+3
elif A == math.floor((Y+4)*0.08):
    ans = Y+4
elif A == math.floor((Y+5)*0.08):
    ans = Y+5
elif A == math.floor((Y+6)*0.08):
    ans = Y+6
elif A == math.floor((Y+7)*0.08):
    ans = Y+7
elif A == math.floor((Y+8)*0.08):
    ans = Y+8
elif A == math.floor((Y+9)*0.08):
    ans = Y+9

print(ans)

Solution (Python):
import math

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

a_low = math.ceil(a/0.08)
b_low = math.ceil(b/0.1)

a_high = math.floor(a/0.08+int(1/0.08)-1e-8)
b_high = math.floor(b/0.1+int(1/0.1)-1e-8)

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

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


A1 = A / 0.08
A2 = (A+1)/0.08
B1 = B / 0.1
B2 = (B+1) / 0.1

Flag = True
for i in range(1,1251):
    if (A1 <= i) and (i < A2) and (B1 <= i) and (i < B2):
        print(i)
        break
    if i == 1250:
        Flag = False

if (not Flag):
    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())

minA = math.ceil(A / 0.08)
minB = math.ceil(B / 0.1)
small = min(minA, minB)
large = max(minA, minB)



for i in range(small, large+1):
    if (math.floor(i * 0.08) == A and math.floor(i * 0.1) == B):
        print (i)
        exit(0)
print ("-1")

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

a1 = float(A)/0.08
a2 = float(A+1)/0.08
b1 = float(B)/0.1
b2 = float(B+1)/0.1
if (a1 - int(a1)) == 0:
  a1 = int(a1)
else:
  a1 = int(a1+1)
if (b1 - int(b1)) == 0:
  b1 = int(b1)
else:
  b1 = int(b1+1)
if a2 - int(a2) == 0:
  a2 = int(a2-1)
else:
  a2 = int(a2)
if b2 - int(b2) ==0:
  b2 = int(b2-1)
else:
  b2 = int(b2)

if a1>b1:
  a1,a2,b1,b2 = b1,b2,a1,a2
if b1<=a2:
  print(b1)
else:
  print(-1)

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

hoge = list(range(B*10,(B*10)+10))

ans = []
for i in hoge:
    if (i * 0.08) // 1 == A:
        ans.append(i)

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

Solution (Python):
from math import floor
a = list(map(int, input().split()))
A = a[0]
B = a[1]
o = -1
for i in range(1,1001):
    if floor(i*0.08)==A and floor(i*0.1)==B:
        o = i
        break
print(o)

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

A_list = []
for i in range(1500):
  if math.floor(i * 0.08) == A:
    A_list.append(i)

B_list = []
for i in range(1500):
  if math.floor(i * 0.10) == B:
    B_list.append(i)   
    
common = set(A_list) & set(B_list)

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

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

price = math.ceil(a * 100 / 8)
if math.floor(price * 0.1) == b:
  print(price)
else:
  price = int(b * 100 / 10)
  if math.floor(price * 0.08) == a:
    print(price)
  else:
    print(-1)

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

setA=set(list(range(int(A//0.08+1),int((A+1)//0.08+1))))
setB=set(list(range(int(B//0.1+1),int((B+1)//0.1+1))))
ans=setA & setB

if len(ans)==0:
    print(-1)
    exit()

print(min(ans))

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

uA=A/0.08
tA=(A+1)/0.08
uB=B/0.1
tB=(B+1)/0.1

if uA>=tB or uB>=tA:
    print(-1)
else:
    print(math.ceil(max(uA,uB)))

Solution (Python):
import numpy as np
A, B = map(int,input().split())
A,B=int(A),int(B)
c=0
d=True
while(d):
    a=int(c*0.08)
    b=int(c*0.1)
    if a==A and b==B:
        print(c)
        d=False
    elif a>A or b>B:
        print('-1')
        d=False
    else:
        c+=1 
        continue

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

for i in range(1, 1250):
  if int(i*0.08) == a and int(i*0.1) ==b:
    print(i)
    quit()
print(-1)

Solution (Python):
A, B = map(int, input().split())
a = int(A // 0.08)
ans_lst = []
for i in range(20):
    
    if int(a * 0.08) == A:
        ans_lst.append(a)
    a += 1
for i in ans_lst:
    if int(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)

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

if 25*(A+1)/2 <= 10*B or 10*(B+1) <= 25*A/2:
    print(-1)
else:
    for i in range(10*B,10*(B+1)):
        if 25*A <= 2*i < 25*(A+1):
            print(i)
            break

Solution (Python):
import math

A, B = map(lambda x: int(x), input().split(" "))













result = -1
for i in range(1, 1263):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        result = int(i)
        break

print(result)

Solution (Python):
import math

A,B = map(int,input().split())
tmp_Bx = B * 10

f = False
for i in range(tmp_Bx,tmp_Bx+10):
    Ax = math.floor(0.08 * i)
    if Ax == A:
        print(i)
        f = True
        break
if f == False:
    print(-1)

Solution (Python):
import math

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

mina, maxa = math.ceil(a / 0.08), math.ceil((a+1) / 0.08)-1
minb, maxb = b * 10, (b+1) * 10 -1

if minb <= maxa and minb >= mina:
    print(minb)
elif mina <= maxb and mina >= minb:
    print(mina)
else:
    print(-1)

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

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

Solution (Python):
import sys
import math
sys.setrecursionlimit(int(1e6))

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

pa = A / 0.08
d = 100 / 8

ans = -1
for p in range(int(pa), int(pa + d)+1):
    if (A == int(p * 0.08)) and (B == int(p * 0.10)):
        ans = p
        break

print(ans)

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

for i in range(1000):
  if int((i+1)*0.080) == A and int((i+1)*0.10) == B:
    print(i+1)
    exit()
print(-1)

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

Solution (Python):
def main():
    n,m = map(int, input().split())
    ans = 100000
    for i in range(5*m, 15*m):
        if int(i * 0.08) == n and int(i * 0.1) == m:
          ans = min(ans,i)
    print(-1) if ans == 100000 else print(ans)

if __name__ == '__main__':
    main()

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

for i in range(1, 10000):
    p = (i * 108) // 100
    q = (i * 11) // 10
    if p - i == a and b == q - i:
        print(i)
        exit()

print(-1)

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

a_sita = A/0.08 
a_ue = (A+1)/0.08 

b_sita = B/0.10
b_ue = (B+1)/0.10

if a_ue <= b_sita or b_ue <= a_sita:
  print(-1)

else:
  ans = max(a_sita,b_sita)
  ans = math.ceil(ans)
  print(int(ans))

Solution (Python):
a,b=list(map(int,input().split(' ')))
for i in range(0,10000):
    if (i*(0.08))//1==a and (i*(0.10))//1==b:
        print(i)
        exit()
print(-1)

Solution (Python):
import math

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



start = math.floor(A*100/8)
end = (B+1)*10

ans = -1

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

print(ans)

Solution (Python):
import math

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

ans = -1
for i in range(1, 1265):
  A_calc = math.floor(i*0.08)
  B_calc = math.floor(i*0.10)
  if A_calc == A and B_calc == B:
    ans = i
    break
print(ans)

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

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

for i in range(10**5+1):
    tmp_8 = floor(i*0.08)
    tmp_10 = floor(i*0.1)
    if tmp_8==A and tmp_10==B:
        print(i)
        exit()
print(-1)

Solution (Python):
from math import floor
A,B = map(int,input().split(" "))
s = 10*B
t = 10*(B+1)
ans = 2**60
for tmp in range(s,t):
    if floor(tmp*0.08) == A:
        ans = tmp
        break
s = 125*A
t = 125*(A+1)
for tmp in range(s,t):
    if floor(tmp/10) == B:
        ans = min(ans,tmp)
        break
if ans == 2**60:
    ans = -1
print(ans)

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

late_1 = 0.08
late_2 = 0.1

i = 1

while (i <= (100 / 0.08)):
  if int(i * late_1) == a and int(i * late_2) == b:
    print(i)
    break
  i += 1

if (i == (100 / 0.08) + 1):
  print(-1)

Solution (Python):

A, B = map(int, input().split())
ansA = set()
for i in range(10*B, 10*(B+1)):
  ansA.add(i)

st = int(25*A/2)
if(25*A % 2 != 0):
  st += 1

ed = int(25*(A+1)/2)
if(25*(A+1) % 2 != 0):
  ed += 1

ansB = set()
for i in range(st, ed):
  ansB.add(i)

ans = ansA & ansB
if(len(ans) == 0):
  print('-1')
else:
  print(min(ans))

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

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

Solution (Python):

import sys
import math

def solve(A: int, B: int):
    ten = B * 10
    ans = int(ten)

    while True:
        if ans // 10 != B :
            print(-1)
            return
        elif math.floor(ans * 0.08) == A:
            print(ans)
            return
        ans += 1

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

if __name__ == '__main__':
    main()

Solution (Python):
import math

AB = input().split()
A = int(AB[0])
B = int(AB[1])










x_lower1 = A/0.08
x_lower2 = B/0.1
x_upper1 = (A+1)/0.08
x_upper2 = (B+1)/0.1

x_lower = max(x_lower1, x_lower2)
x_upper = min(x_upper1, x_upper2)

x_candidate = math.ceil(x_lower)
if x_candidate < x_upper:
  print(int(x_candidate))
else:
  print(-1)

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

if 12.5 * (a + 1) <= b * 10:
  print("-1")
elif b * 10 + 9 < 12.5 * a:
  print("-1")
else:
  print(max(math.ceil(12.5 * a), 10 * b))

Solution (Python):
A, B = map(int, input().split())
f = False
for x in range(13, 1251):
    if (int(x*0.08) == A) and (int(x*0.1) == B):
        f = True
        print(x)
        break
if not f:
    print(-1)

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

result = -1

for x in range(0,10001):
  if int(x*0.08) == A and int(x*0.10) == B:
    result = x
    break
    
print(result)

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

beforeA = range(math.ceil(a * (100 / 8)), math.ceil((a+1) * (100 / 8)))
beforeB = range(b * 10, (b+1) * 10)
ans = 990990990
flag = False
for i in beforeA :
    for j in beforeB :
        
        if i == j :
            flag = True
            ans = min(ans, i)
if flag :
    print(ans)
else :
    print(-1)

Solution (Python):
import math

S = input().split(" ")
A = int(S[0])
B = int(S[1])

def calculate(a,b):
    theta = 1 - 1e-9

    s1 = a/0.08
    s2 = (a + theta)/0.08


    s3 = b/0.10
    s4 = (b + theta) / 0.10

    m1 = math.ceil(s1)
    m2 = math.floor(s2)

    m3 = math.ceil(s3)
    m4 = math.floor(s4)

    arr1 = [i for i in range(m1,m2+1)]
    arr2 = [i for i in range(m3,m4+1)]

    result = list(set(arr1).intersection(set(arr2)))


    if len(result) == 0:
        return -1
    else:
        return min(result)



result = calculate(A,B)
print(result)

Solution (Python):
import math
A, B = map(int, input().split())
XA=list(i for i in range (math.ceil(A/0.08), math.floor((A+1)/0.08)) )
XB=list(i for i in range (math.ceil(B/0.1), math.floor((B+1)/0.1)) )
X=list( set(XA) & set(XB)  )
if(len(X)>0):
    print(min(X))
else:
    print("-1")

Solution (Python):
def main():
    
    
    
    
    
    
    
    
    
    
    
    
    
    from math import floor
    a, b = map(int, input().split())
    ax = 0
    bx = 0
    for i in range(1,1500):
        ax = floor(i * 0.08)
        bx = floor(i * 0.1)
        if ax == a and bx == b:
            print(i)
            return 0
    print(-1)

if __name__ == '__main__':
    main()

Solution (Python):
import math

input_line = [int(i) for i in input().split()]
a = input_line[0]
b = input_line[1]

price_a_min = math.ceil(a / 0.08)
price_a_max = math.ceil((a + 1) / 0.08)
price_b_min = math.ceil(b / 0.1)
price_b_max = math.ceil((b + 1) / 0.1)

a_range = {i for i in range(price_a_min, price_a_max)}
b_range = {i for i in range(price_b_min, price_b_max)}

both_range = a_range & b_range

ans = -1
for i in sorted(both_range):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans = i
        break
    else:
        continue
print(ans)

Solution (Python):
import math
A,B=map(int,input().split())
sup=min((A+1)/0.08,(B+1)/0.1)
inf=max(A/0.08,B/0.1)
inf2=math.ceil(inf)
if inf2<sup:
  print(inf2)
else:
  print(-1)

Solution (Python):
import math

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

def rangeOfPriceWithoutTax(price, rate):
    min_ = math.ceil(price / rate)
    max_ = int((price + 1) // rate)
    return set(range(min_, max_ + 1))

range_ = (rangeOfPriceWithoutTax(A, 0.08) & rangeOfPriceWithoutTax(B, 0.1)) - {0}

try:
    print(min(range_))
except ValueError:
    print(-1)

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

x = b * 100

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

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


eight2 = math.ceil((A+1)/0.08 - 0.0001)
ten2 = math.ceil((B+1)/0.1 - 0.01)

eight_range = set(range(eight, eight2, 1))
ten_range = set(range(ten, ten2, 1))


if eight_range.isdisjoint(ten_range):
    out = -1
else:
    out = min(eight_range & ten_range)

print(out)

Solution (Python):
A,B=map(int,input().split())
ansA=A//(0.08)
ansB=B//(0.1)
a=[]
b=[]
while True:
    if int(ansA*1.08-ansA)==A:
        a.append(int(ansA))
        ansA+=1
    elif int(ansA*1.08-ansA)>A:
        break
    else:
        ansA+=1

while True:
    if int(ansB*1.1-ansB)==B:
        b.append(int(ansB))
        ansB+=1
    elif int(ansB*1.1-ansB)>B:
        break
    else:
        ansB+=1
c=[]
c+=set(a)&set(b)


if c==[]:
    print("-1")
else:
    print(int(min(c)))

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

print(ans)

Solution (Python):

A,B=map(int,input().split())
flg=True
for i in range(2*10**4):
    if int(i*0.08)==A and int(i*0.1)==B:
        flg=False
        print(i)
        break

if flg:
    print(-1)

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

ans = -1
for x in range(1, 1250+1):
  _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 = map(int, input().split())
for i in range(1500):
    if math.floor(i*0.08) == math.floor(a) and  math.floor(i*0.1) == math.floor(b):
        print(i)
        break
else:
    print("-1")

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

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





smaller = 0
larger = 0

if a < b:
    smaller = a
    larger = b
else:
    smaller = b
    larger = a


start = smaller * 10


for i in range(start,1500):
    
    if int(i * 0.08) == smaller and int(i * 0.1) == larger:
        print(i)
        exit(0)

print(-1)

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

a,b = -a,-b
minA,minB = a // 0.08, b // 0.1
minA,minB = -minA,-minB

maxA,maxB = (a-1) // 0.08, (b-1) // 0.1
maxA,maxB = -maxA-1,-maxB-1

if minA > maxB or minB > maxA:
    print(-1)
else:
    if minA >= minB:
        print(int(minA))
    else:
        print(int(minB))

Solution (Python):
import math

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

Xb = [i for i in range(10*B, 10*(B+1))]
Xa = [i for i in range(math.ceil(A/0.08), math.ceil((A+1)/0.08))]

S  = set(Xb) & set(Xa)

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

Solution (Python):
a, b = map(int,input().split())
start = -(-b//0.1)
ans = 0
for i in range(int(start),int(start+10)):
    
    if int(i * 0.08) == a:
        ans = i
        break
if ans ==0:
    ans = -1
        
print(ans)

Solution (Python):

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











for i in range(200000):
    x,y=0.0,0.0
    x=i*0.08
    y=i*0.10
    if a==int(x) and b==int(y):
        print(i)
        exit()
print(-1)

Solution (Python):
a, b = map(int, input().split())
i = 1
while i < 100000:
    x = i * 108 // 100 - i
    y = i * 110 // 100 - i
    if x == a and y == b:
        print(i)
        exit(0)
    i += 1

print(-1)

Solution (Python):
a,b=map(int,input().split())
x=max(a/0.08,b/0.1)
y=min((a+1)/0.08,(b+1)/0.1)

if x<y:
    if x%1 != 0:
        print(int(x)+1)
    else:
        print(int(x))
else:
    print(-1)

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

print(ans)

Solution (Python):
import math

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


low_A = int(math.floor(A / 0.08))
up_A = int(math.floor((A + 1) / 0.08)) - 1


low_B = int(math.floor(B / 0.1))
up_B = int(math.floor((B + 1) / 0.1)) - 1


for i in range(low_B, up_A + 1):
    x = int(i * 0.08)
    y = int(i * 0.1)

    if x == A and y == B:
        print(i)
        exit()

print(-1)

Solution (Python):
a,b = map(int,input().split())
pre = [10*b + i for i in range(10)]
import math
re = 0
for i in reversed(pre):
  if math.floor(i*0.08) == a:
    re = i
if re == 0:
  print(-1)
else:
  print(re)

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

if 12.5 * (a + 1) <= b * 10:
  print("-1")
elif b * 10 + 9 < 12.5 * a:
  print("-1")
else:
  print(max(math.ceil(12.5 * a), 10 * b))

Solution (Python):
import math

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

min_A = math.ceil(A * 100 / 8)
max_A = (A + 1) * 100 / 8
min_B = math.ceil(B * 100 / 10)
max_B = (B + 1) * 100 / 10

if (min_A <= min_B and min_B < max_A):
    ans = min_B
elif (min_B <= min_A and min_A < max_B):
    ans = min_A
else:
    ans = -1

print(ans)