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-----
2 2

-----Sample Output-----
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.

Difficulty: introductory

Starter code:

Solutions:
a,b = map(int,input().split())
for i in range(1,100000):
    if i*8//100==a and i*10//100==b:
        print(i)
        break
else:
    print(-1)

import os, sys, re, math

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

answer = -1
for i in range(10001):
    a = i * 8 // 100
    b = i * 10 // 100
    if a == A and b == B:
        answer = i
        break

print(answer)


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

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


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

print(-1)

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

from math import ceil

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

min8 = ceil(A*12.5)
max8 = int((A+1)*12.5-0.001)
min10 = ceil(B*10)
max10 = int((B+1)*10-0.001)
#print(min8,max8,min10,max10)

if max8<min10 or max10<min8:
    print(-1)
else:
    print(max(min8,min10))

import math
import sys

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)
            return
            
print('-1')

A,B=map(int,input().split())
print([-1,c:=-min(-A*50//4,-B*10)][c<min((A+1)*50//4,B*10+10)])

A,B=map(int,input().split());p=0.08;q=0.1;a=0--A//p;b=(A+1)//p;c=0--B//q;d=(B+1)//q;print([int(max(a,c)),-1][(d<=a)|(b<=c)])

A,B=map(int,input().split())
for i in range(1500):
	if(i*2//25==A)*(i//10==B):print(i);return
print(-1)

A,B = list(map(int,input().split()))
ans = -1
for i in range(10**3 + 1):
    if (i*8)//100 == A and (i*10)//100 == B:
        ans = i
        break

print(ans)


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

for i in range(1001):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        return

print(-1)

A,B=map(int,input().split())
c=max(-(-A*100//8),B*10)
print([-1,c][c<min((A+1)*100//8,B*10+10)])

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

for x in range(max(a, b), 2000):
    if x * 8 // 100 == a and x // 10 == b:
        print(x)
        return
print((-1))



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

if A % 2 == 0:
	A_min = int(A * 12.5)
	A_max = A_min + 12
else:
	A_min = int(A * 12.5 + 0.5)
	A_max = A_min + 11

B_min = B * 10
B_max = B_min + 9

A_range = [n for n in range(A_min, A_max + 1)]
B_range = [n for n in range(B_min, B_max + 1)]

ans = -1

for n in A_range[::-1]:
	if n in B_range:
		ans = n
print(ans)


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

result = -1
for i in range(10 ** 3 + 1):
    if int(i * 0.08) == A:
        if int(i * 0.1) == B:
            result = i
            break

print(result)

a, b = [int(i) for i in input().split()]
idx = 0
rangein = False
while(True):
	aa = int(idx * 0.08)
	bb = int(idx * 0.1)
	if aa == a and bb == b:
		print(idx)
		return
	elif aa == a or bb == b:
		rangein = True
	elif rangein and aa != a and bb != b:
		print(-1)
		return
	idx += 1

A,B=map(int,input().split());a=0--A*25//2;b=(A+1)*25//2;c=B*10;d=c+10;print([int(max(a,c)),-1][(d<=a)|(b<=c)])

A,B=map(int,input().split())
for i in range(4**6):
    if int(i*.08)==A and int(i*.1)==B:
        print(i)
        break
else:print(-1)

A,B=map(int,input().split());a=0--A*25//2;c=B*10;print([max(a,c),-1][c+10<=a or (A+1)*25//2<=c])

import math

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

A, B = map(int, input().split())
b = 10*B
if b*2//25 == A:
    print(b)
elif (b+9)*2//25 == A:
    if A%2 ==0:
        print(A*25//2)
    else:
        print((A*25+1)//2)
else:
    print(-1)

import math
A,B=map(int,input().split())
c=max(math.ceil(A/0.08),B*10)
d=min(int((A+1)/0.08),B*10+10)
print([-1,c][c<d])

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

ans = -1

for price in range(10000):
    tax_a = int(price * 0.08)
    tax_b = int(price * 0.1)
    
    if tax_a == a and tax_b == b:
        ans = price
        break
        
print(ans)

import math
A, B = map(int, input().split())
b1 = B*10
b2 = b1 + 10

for i in range(b1, b2):
    if math.floor(i*0.08) == A:
        print(i)
        break

    if i == b2-1:
        print(-1)

A,B=map(int,input().split())
ans=-1
for i in range(1,10*B+10):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans=i
        break
print(ans)

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

ans = -1

for i in range(0, 10000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        ans = i
        break

print(ans)

import math

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

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

print(-1)

A,B=map(int,input().split());p=0.08;a=0--A//p;b=(A+1)//p;c=B*10;d=(B+1)*10;print([int(max(a,c)),-1][(d<=a)|(b<=c)])

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

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

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

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

A, B = map(int, input().split())
l = []
for i in range(1, 10000):
  a = i * 0.08
  b = i * 0.1
  if a > A+1 and b > B+1:
    break
  elif A <= a < A+1 and B <= b < B+1:
    l.append(i)

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

import math
A,B=map(int,input().split())
mini=max(math.ceil(A/0.08),B*10)
maxi=min(int((A+1)/0.08),(B+1)*10)
if mini>=maxi:
    print(-1)
else:
    print(mini)

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

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

list1=list(range(1,1001,1))

s=0
for i in list1:
    x=i//12.5
    y=i//10
    if x==A and y==B:
        print((str(i)))
        s=s+1
        return

print('-1')


a, b = map(int, input().split( ))
if 25*(a+1) <= 20*b or 20*(b+1) <= 25*a:
    print(-1)
else:
    print(max(10*b, int((25*a+1)/2)))

a,b=map(int,input().split())
for i in range(20000):
    if (int((i*8)/100)==a and int((i*10)/100)==b):
        print(i)
        break
else: print(-1)

A, B = [int(s) for s in input().split(' ')]
for p in range(10000):
    if int(p * 0.08) == A and int(p * 0.10) == B: 
        print(p)
        return
print((-1))


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

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

A,B=map(int,input().split());p=0.08;a=0--A//p;b=(A+1)//p;c=B*10;d=c+10;print([int(max(a,c)),-1][(d<=a)|(b<=c)])

A,B=map(int,input().split());a=0--A*25//2;c=B*10;print([max(a,c),-1][(c+10<=a)|((A+1)*25//2<=c)])

import math
A,B=map(int,input().split())
mini=max(math.ceil(A/0.08),B*10)
maxi=min(int((A+1)/0.08),B*10+10)
print([-1,mini][mini<maxi])

import math,sys

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

for price in range(1,100000):
    if math.floor(price*0.08) == A and math.floor(price*0.1) == B:
        print(price)
        return

print(-1)

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

for i in range(int(100 / 0.08)):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        return
print((-1))


import math
a,b=map(int,input().split())
ast=math.ceil(a*12.5)
aend=math.ceil((a+1)*12.5)-1
bst=b*10
bend=(b+1)*10-1
flag=0
for i in range(bst,bend+1):
    if ast<=i<=aend:
        print(i)
        flag=1
        break
if flag==0:
    print(-1)

A,B=map(int,input().split())
print([-1,c:=-min(-A*25//2,-B*10)][(A+1)*25>c*2<B*20+20])

a,b = map(int,input().split())
i = 0
x = int(a/0.08)
while True:
    if int((x+i)*0.1) == b and int((x+i)*0.08) == a:
        ans = int(x+i)
        break
    elif int((x+i)*0.1) > b:
        ans = '-1'
        break
    else:
        i += 1
print(ans)

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

for x in range(1, 10**5):
    if 8*x//100 == A and 10*x//100 == B:
        print(x)
        break
else:
    print((-1))


A,B=map(int,input().split())
c=max(-(-A*100//8),B*10)
d=min((A+1)*100//8,B*10+10)
print([-1,c][c<d])

A=[0]*1010;B=[0]*1010
for i in range(1,1010):
  A[i]=int(i*0.08)
  B[i]=int(i*0.1)
x,y=map(int,input().split())
X=[s for s,t in enumerate(A) if t == x]
Y=[s for s,t in enumerate(B) if t == y]

for i in X:
  if i in Y:print(i);return
print(-1)

#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    a,b = map(int,input().split())
    
    tmp1=int(a/0.08)
    tmp2=int(b/0.10)

    ans=[]

    for i in range(min(tmp1,tmp2),max(tmp1,tmp2)+2):
        if int(i*0.08) == a and int(i*0.10) == b:
            ans.append(i)

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


def __starting_point():
    main()
__starting_point()

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

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

A,B=map(int,input().split());print((max(a:=0--A*25//2,c:=B*10)+1)*(a-10<c<(A+1)*25//2)-1)

import math
a, b = list(map(int, input().split()))
ans = -1

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

print(ans)


def main():
    A, B = tuple([int(_x) for _x in input().split()])
    for m in range(2000):
        if (m*108//100 - m) == A and (m*110//100 - m) == B:
            print(m)
            return
    print((-1))
    # N = int(input())


main()



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

ans = 0
for i in range(10,1001):
    if int(i*0.08) == A and int(i*0.1) == B:
        ans = i
        break

if ans == 0:
    print(-1)
else:
    print(i)

import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    A, B = MI()
    B1 = B * 10
    
    while True:
        if B1 * 0.1 >= B+1:
            break
        elif B1 * 0.08 >= A+1:
            break
        elif math.floor(B1 * 0.08) == A:
            print(B1)
            return
            
        
        
        
        B1 += 1

        
    
    print(-1)
    
def __starting_point():
    main()
__starting_point()

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

for i in range(13, 1250):
    if i//12.5==a and i//10==b:
        print(i)
        return
print((-1))


A,B=map(float,input().split())
from math import ceil
c = ceil(A/0.08)
d=ceil(B/0.1)
if c==d:
    print(c)
elif c<d and d < ceil((A+1)/0.08):
    print(d)
elif d<c and c < ceil((B+1)/0.1):
    print(c)
else:
    print(-1)

# coding=utf-8

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

    ans = -1
    while(ans*0.08 < A or ans*0.1 < B):
        ans += 1


    if int(ans * 0.08) == A and int(ans * 0.1) == B:
        print(ans)

    else:
        print('-1')

    #print(ans, ans*0.08, ans*0.1)

__starting_point()

A,B=map(int,input().split())
print([-1,c:=-min(-A*100//8,-B*10)][c<min((A+1)*100//8,B*10+10)])

A,B=map(int,input().split())
print((sorted(list({((int(i*0.08)==A)&(int(i*0.1)==B))*i for i in range(0,10*B+10)}))+[-1])[1])

A,B=map(int,input().split());a=0--A*25//2;c=B*10;print([int(max(a,c)),-1][(c+10<=a)|((A+1)*25//2<=c)])

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

ans = -1
for v in range((100*10)+100):
  t8 = int(v * 0.08)
  t10 = int(v * 0.1)

  if t8 > a or t10 > b:
    break

  if t8 == a and t10 == b:
    ans = v
    break

print(ans)


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

ma_min, ma_max = math.ceil(a / 0.08), math.ceil((a + 1) / 0.08 - 1)
mb_min, mb_max = math.ceil(b / 0.1), math.ceil((b + 1) / 0.1 - 1)

tmp_ans = max(ma_min, mb_min)
if ma_min <= tmp_ans <= ma_max and mb_min <= tmp_ans <= mb_max:
    ans = tmp_ans
else:
    ans = -1
print(ans)

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

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

print(-1)

a,b=list(map(int,input().split()))
ans=-1
for i in range(1,10000):
    if i*8//100==a and i*10//100==b:
        ans=i
        break
print(ans)


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)
        return
print('-1')

A,B=map(int,input().split())
print([-1,c:=-min(-A*50//4,-B*10)][(A+1)*50//4>c<B*10+10])

from math import floor

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

d = False

for p in range(1009):
    if floor(p * 0.08) == a and floor(p * 0.1) == b:
        print(p)
        d = True
        break

if not d:
    print(-1)

A=[0]*1301;B=[0]*1301
for i in range(1,1301):
  A[i]=int(i*0.08)
  B[i]=int(i*0.1)
x,y=map(int,input().split())
X=[s for s,t in enumerate(A) if t == x]
Y=[s for s,t in enumerate(B) if t == y]

for i in X:
  if i in Y:print(i);return
print(-1)

import math
a, b = map(int,input().split())
ans = -1
for i in range(1, 1011):
  if math.floor(i*0.08) == a and math.floor(i * 0.1) == b:
    print(i)
    return
print(ans)

a,b = map(int,input().split())
ans = -1
for i in range(11000):
    if int(i *1.08) == i + a and int(i * 1.1) == i + b:
        ans = i
        break
print(ans)

import math

A, B = list(map(int, input().split()))
A_1 = math.ceil(A * 12.5)
A_2 = math.ceil((A + 1) * 12.5)

for i in range(A_1, A_2 + 1):
    if i == A_2:
        print(-1)
    elif math.floor(i * 0.1) != B:
        continue
    elif math.floor(i * 0.1) == B:
        print(i)
        break


def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(map(int, input().split()))
def i_row(N): return [int(input()) for _ in range(N)]
def i_row_list(N): return [list(map(int,input().split())) for _ in range(N)]

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

A,B = map(int,input().split())
left2 = B*10
right2 = (B+1)*10
if((A*100)/8 != int((A*100)/8)):
    left1 = int((A*100)/8)+1
else:
    left1 = (A*100)//8
if((A+1)*100/8 != int((A+1)*100/8)):
    right1 = (A+1)*100/8
else:
    right1 = ((A+1)*100//8) - 1
if(left1 >= left2 and right2 > left1):
    print(left1)
    return
if(left1 <= left2 and right1 > left2):
    print(left2)
    return
print(-1)

def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7

#import numpy as np
import sys
import math
import collections

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

a,b=map(int,input().split())
x=min([n if (n*0.08//1-a,n*0.1//1-b)==(0,0)else 1e5for n in range(1500)])
print(x if x<1e5else-1)

a, b = map(int, input().split())
i = 1
f = 0
while True:
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        f = 1
        break
    if int(i*0.08)>a:
        break
    i += 1
if not f:
    print(-1)

# coding: utf-8


def main():
    A, B = list(map(int, input().split()))
    ans = -1
    for i in range(10001):
        if i * 8 // 100 == A and i // 10 == B:
            ans = i
            break

    print(ans)

def __starting_point():
    main()

__starting_point()

import math
a, b = map(int, input().split())
ans = float('inf')
for x in range(1001):
    if int(math.floor(x*1.08))-x==a and int(math.floor(x*1.1))-x==b:
        ans = min(ans, x)
if ans == float('inf'):
    print(-1)
else:
    print(ans)

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

ans=-1
for n in range(10*b,10*(b+1)):
    if int(n*1.1)-b == int(n*1.08)-a:
        ans=n
        break
print(ans)


A,B=map(int,input().split())
for i in range(1500):
    if(i*2//25==A and i//10==B):
        print(i)
        return
else:
    print(-1)

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

from decimal import Decimal
a,b=map(int,input().split())

x=[]

s=a/(Decimal('0.08'))
t=(a+1)/(Decimal('0.08'))
u=b/(Decimal('0.1'))
v=(b+1)/(Decimal('0.1'))

x.append(s)
x.append(t)
x.append(u)
x.append(v)

ans=[]

for i in range(int(min(x)),int(max(x))+1):
    if a/(Decimal('0.08'))<=i<(a+1)/(Decimal('0.08')) and b/(Decimal('0.1'))<=i<(b+1)/(Decimal('0.1')):
        ans.append(i)

if not ans:
    print('-1')
else:
    print(min(ans))

A,B=map(int,input().split());p=0.08;q=0.1;a=0--A//p;b=(A+1)//p;c=0--B//q;d=(B+1)//q;print([int(max(a,c)),-1][d<=a or b<=c])

a,b=map(int,input().split())
c=0
if (100*a)%8==0:
    w=(100*a)//8
else:
    w=((100*a)//8)+1
if (100*(a+1))%8==0:
    s=((100*(a+1))//8)-1
else:
    s=(100*(a+1))//8
for i in range(w,s+1):
    if i//10==b:
        print(i)
        c+=1
        break
    else:
        pass
if c==0:
    print(-1)
else:
    pass

A,B=map(int,input().split());print([max(a:=0--A*25//2,c:=B*10),-1][~(a-10<c<(A+1)*25//2)])

def main():
    a,b = map(int, input().split())
    ans = -1
    import math
    i = 1
    f= False
    while True:
        if math.floor( i * 0.08) == a and math.floor(i * 0.1) == b:
            ans = i
            f = True
            break
        elif math.floor( i * 0.08)>a or math.floor(i * 0.1) > b:
            f= False
            break
        i +=1
    return ans 
    
def __starting_point():
    print(main())
__starting_point()

A,B=map(int,input().split())
print((sorted(({((int(i*0.08)==A)&(int(i*0.1)==B))*i for i in range(10*B+10)}))+[-1])[1])

import math

A,B=map(int,input().split())
p1=0.08
p2=0.1

a_l=math.ceil(A/p1)
a_r=math.floor((A+1)/p1)
b_l=math.ceil(B/p2)
b_r=math.floor((B+1)/p2)

if b_r <= a_l or a_r <= b_l:
    print(-1)
else:
    print(max(a_l,b_l))

import math

a, b = list(map(int, input().split()))
ans = -1
for i in range(math.ceil(a / 0.08), math.floor((a + 1) / 0.08) + 1):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans = i
        break
print(ans)


def resolve():
    a,b = map(int,input().split())
    for i in range(20100):
        ans = '-1'
        if (i * 0.08)//1 == a and (i*0.1)//1==b:
            ans = i
            break
    print(ans)
resolve()

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

a_min = int(a/0.08)
b_min = int(b/0.1)
a_list = [i for i in range(a_min, a_min+100, 1) if int(i*0.08) == a]
b_list = [j for j in range(b_min, b_min+100, 1) if int(j*0.1) == b]

ans = -1
for k in a_list:
    if k in b_list:
        ans = k
        break

print(ans)

A,B=map(int,input().split());print([max(a:=0--A*25//2,c:=B*10),-1][c+10<=a or (A+1)*25//2<=c])

A,B=map(int,input().split());p=0.08;q=0.1;a=0--A//p;b=(A+1)//p;c=0--B//q;d=(B+1)//q;print([int(max(a,c)),-1][d<=a or b<=c])

A,B=map(int,input().split());print([-1,max(a:=0--A*25//2,c:=B*10)][a-10<c<(A+1)*25//2])