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.



Sample input:
2 2


Sample output:
25

Submission status: Accepted

Solution code:
def resolve():
  a, b = map(int, input().split())
  for i in range(1, 10001):
    if int(i * 0.08) == a and int(i * 0.1) == b:
      print(i)
      return
  print('-1')

  return

if __name__ == "__main__":
  resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
sup = math.floor((a+1)/0.08)

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

Submission status: Accepted

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

ans = []
for ans in range(1,1251):
    if math.floor(ans*0.08) == A and math.floor(ans*0.1) == B:
        print(ans)
        exit()

print(-1)

Submission status: Accepted

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

flag = True
for i in range(1,1010):
    if (i * 8 // 100) == A and (i * 10 // 100) == B:
        print(i)
        flag = False
        break

if flag:
    print(-1)

Submission status: Accepted

Solution code:

A, B = map(int, input().split())
for ans in range(1, 100000):
    if ans * 8 // 100 == A and ans * 10 // 100 == B:
        print(ans)
        exit()

print(-1)

Submission status: Accepted

Solution code:
A ,B = map(int,input().split())
c = -1
#int(0.08N) = A で int(0.1N) = B である
i = 10*B
Flag = True
while i < 10*(B+1) and Flag == True:
  if (i*8/100)//1 == A:
    c = i
    Flag = False
  i += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
a1 = A/0.08
if a1!=int(A/0.08):
    a1 = int(A/0.08)+1
else:
    a1 = int(A/0.08)
a2 = (A+1)/0.08
if a2!=int((A+1)/0.08):
    a2 = int((A+1)/0.08)+1
else:
    a2 = int((A+1)/0.08)
b1 = B/0.1
if b1!=int(B/0.1):
    b1 = int(B/0.1)+1
else:
    b1 = int(B/0.1)
b2 = (B+1)/0.1
if b2!=int((B+1)/0.1):
    b2 = int((B+1)/0.1)+1
else:
    b2 = int((B+1)/0.1)
X = range(a1,a2)
Y = range(b1,b2)
x = -1
for i in X:
    if i in Y:
        x = i
        break
print(x)

Submission status: Accepted

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

for i in range(1,2000):
    tax8 = math.floor(i*0.08)
    tax1 = math.floor(i*0.1)
    if a == tax8 and b == tax1:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
#import numpy as np
import math
from fractions import Fraction
import itertools

input=sys.stdin.readline

a,b=map(int,input().split())
if (a+1)/0.08<=b/0.1 or (b+1)/0.1<=(a/0.08):
    print(-1)
    exit()
print(int(math.ceil(max(a/0.08,b/0.1))))

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1, 1250):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        exit()
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = -1
for x in range(13, 1250):
    if int(x * 0.08) == a and int(x * 0.1) == b:
        ans = x
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
for i in range(1,10001):
  tax_a=int(i*0.08)
  tax_b=int(i*0.10)
  if tax_a==a and tax_b==b:
    print(i)
    exit(0)
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, 10001):
    if int(i * 1.08) - i == A and int(i * 1.1) - i == B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

Solution code:
import sys
import math
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b = map(int, input().split())

    for i in range(1, 10 ** 4):
        if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
            print(i)
            break
    else:
        print(-1)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
def main():
    a,b = map(int,input().split())

    ax,bx = 0,0
    from math import floor
    # 100/0.08 = 1250
    for i in range(1,1251):
        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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

a,b = inpl()
res = -1
for i in range(10**6):
    if int(i*0.08) == a and int(i*0.1) == b:
        res = i
        break
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
for n in range(1,20000):
    a = int(n*0.08)
    b = int(n*0.1)
    if a==A and b==B:
        print(n)
        exit()
print(-1)

Submission status: Accepted

Solution code:
s = list(map(int, input().split()))

A = s[0]
B = s[1]
s = -1

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

Submission status: Accepted

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

n = (100/8) * 100
for i in range(int(n)):
    if int(i*0.08) == A and i//10 == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
def main():
    A,B = map(int, input().split())
    # 税率rate%でtaxがA円となる税抜き価格xは、ceil(a*100/rate)<=x<ceil((a+1)*100/rate)を満たす
    min1 = math.ceil(A*100/8)
    max1 = math.ceil((A+1)*100/8)-1
    min2 = math.ceil(B*100/10)
    max2 = math.ceil((B+1)*100/10)-1
    if min1<=min2 and min2<=max1:
        ans = min2
    elif min2<=min1 and min1<=max2:
        ans = min1
    else:
        ans = -1
    print(ans)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ami,ama = A/0.08,(A+1)/0.08
bmi,bma = B/0.1,(B+1)/0.1
#print(ami,ama,bmi,bma)
ans = 0
flag = False
for x in range(1,1200):
    if ami<=x<ama and bmi<=x<bma:
        ans = x
        flag = True
        break
if flag:
    print(ans)
else:
    print("-1")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    a, b = list(map(int, input().split()))
    for i in range(1,1010):
        if int(i*0.08)==a and int(i*0.1)==b:
            print(i)
            break
    else:
        print(-1)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
flag = 1
for i in range(1,10001):
  if int(i*0.08) == A and int(i*0.1) == B:
    print(i)
    flag = 0
    break
if flag:
  print(-1)

Submission status: Accepted

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

ans = 0
a = A // 0.08 + 1
b = B // 0.1 + 1
c = max(a, b)
if int(c * 0.08) == A and int(c * 0.1) == B:
    ans = int(c)
else:
    ans = "-1"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
C = int(-(-A//0.08))
D = int(-(-(A+1)//0.08))
for i in range(C,D):
    if i//10 == B:
      print(i)
      break
else:
    print(-1)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ans = -1

for i in range(1,10**4+1):
    if int(i * 0.08) == A and int(i * 0.10) == B:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
minXB = B * 10
maxXB = B * 10 + 9
for X in range(minXB, maxXB):
    a_ = int(X * 0.08)

    if a_ == A:
        print(X)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

A, B = getNM()
ans = -1
for i in range(1, 2000):
    optA = math.floor(i * 0.08)
    optB = math.floor(i * 0.1)
    if optA == A and optB == B:
        ans = i
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

List = list(map(int, input().split()))

min8 = math.ceil(List[0]/0.08)
max8 = math.floor((List[0]+1)/0.08) - 1

min10 = math.ceil(List[1]/0.1)
max10 = math.floor((List[1]+1)/0.1) - 1

if max8 < min10 or max10 < min8:
    print('-1')
elif min8 <= min10:
    print(min10)
elif min10 <= min8:
    print(min8)

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split()))
x = list(range(int(a//0.08+1), int((a+1)//0.08+1)))
y = list(range(int(b//0.1+1), int((b+1)//0.1+1)))
z = list(set(x) & set(y))
if not z:
  print(-1)
else:
    print(min(z))

Submission status: Accepted

Solution code:
import math
A,B = list(map(int,input().split()))
for i in range(1,1001):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

A1 = math.ceil((A*100)/8)
A2 = 0
if ((A+1)*100)%8 == 0:
  A2 = (((A+1)*100)//8)-1
else:
  A2 = ((A+1)*100)//8

B1 = B*10
B2 = ((B+1)*10)-1

if A1 <= B1:
    if B1 > A2:
      print(-1)
      exit()
    else:
      print(B1)

else:
    if A1 > B2:
      print(-1)
      exit()
    else:
      print(A1)
      exit()

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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


res = -1


for x in range(0,1010):
    if floor(x*0.08) == A and floor(x*0.1) == B:
        res = x
        break

print(res)

Submission status: Accepted

Solution code:
import math

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

x_min = math.ceil(a / 0.08)
x_sup = math.ceil((a+1) / 0.08) 
y_min = math.ceil(b / 0.1)
y_sup  = math.ceil((b+1) / 0.1) 

u = set(range(x_min, x_sup))
v = set(range(y_min, y_sup))


w = u & v

s = 0

if len(w) == 0:
    s = -1
else:
    s = min(w)

print(s)

Submission status: Accepted

Solution code:
from math import floor
a, b = map(int, input().split())
ans = -1

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

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=-1
cont=0
for i in range(10,10000):
    if int(i*0.08)==a and int(i*0.1)==b:
        ans=i
        count=1
        break
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
i=1
while 1:
    if int(i*0.08)==a:
        if int(i*0.1)==b:
            print(i)
            break
    else:
        if int(i*0.08)>a:
            print(-1)
            break
    i+=1

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if A % 2 == 1:
    a1,a2 = int(A*12.5)+1, A*12.5+12.5
else:
    a1,a2 = int(A*12.5),int(A*12.5+12.5)
b1,b2 = B*10,B*10+10

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

Submission status: Accepted

Solution code:
import math

A,B = map(int,input().split())
anser = 0
for i in range(1, 1100):
    if math.floor(i * 0.08) == A:
        if math.floor(i * 0.1) == B:
            anser = i
            break
    else:
        anser = -1

print(anser)

Submission status: Accepted

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

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x == a) and (y == b)

ans = -1
for n in range(20000):
    if test(n):
        ans = n
        break
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
import math
al=(a/0.08)
bl=(b/0.10)
ah=(a+1)/0.08
bh=(b+1)/0.10
#print(al,ah)
#print(bl,bh)
if ah<=bl or bh<=al:
  print(-1)
  exit()
print(math.ceil(max(al,bl)))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
A,B = map(int,read().split())
 
def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x == A) and (y == B)
 
answer = -1
for n in range(20000):
    if test(n):
        answer = n
        break
print(answer)

Submission status: Accepted

Solution code:
#k=int(input())
a,b=map(int,input().split())
#hl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

flag=False
import math
for price in range(1,1001):
    if math.floor(price*0.08)==a and math.floor(price*0.1)==b:
        flag=True
        break

if flag:
    print(price)
else:
    print(-1)

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit
from math import ceil


def main():
    input = stdin.buffer.readline
    a, b = map(int, input().split())

    set_a = set(range(ceil(a / 0.08), ceil((a + 1) / 0.08)))
    set_b = set(range(ceil(b / 0.1), ceil((b + 1) / 0.1)))

    ans = sorted(list(set_a & set_b))

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


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
 
a,b=map(int,input().split())
m=100*a
n=80*b
l=min(100*(a+1)/8,80*(b+1)/8)
r=max(m,n)
def aprint(num):
    if l<=num:
        print(-1)
    else:
        print(num)
if (r/8)//1==r/8:
    aprint(r//8)
else:
    aprint(int(r//8)+1)

Submission status: Accepted

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

x_mina = (A/0.08)
x_maxa = (A+1)/0.08

if x_mina > (int)(x_mina):
  x_mina = (int)(x_mina)+1
else:
   x_mina = (int)(x_mina)
    
if x_maxa > (int)(x_maxa):
  x_maxa = (int)(x_maxa)
else:
  x_maxa = (int)(x_maxa-1)

x_minb = B/0.1
x_maxb = (B+1)/0.1

ans = -1

for i in range(x_mina,x_maxa+1):
  if i >= x_minb and i<x_maxb:
    ans = i
    break

print(ans)

Submission status: Accepted

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

import math
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

if a_max<b_min or b_max<a_min:
    ans=-1
else:
    ans=max(a_min,b_min)
print(ans)

Submission status: Accepted

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

import math
ans="-1"
for i in range(10000):

    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        
        ans=i
        break

print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
al = []
bl = []
import math
ans = -1
for i in range(1,1251):
    if math.floor(i*0.08) == a:
        if math.floor(i*0.1) == b:
            ans = i
            break
print(ans)

Submission status: Accepted

Solution code:
# ABC158C
# 消費税率が 8 %のとき A 円、10 ％のとき B 円の消費税が課されるような商品の税抜き価格

# 税抜き価格は正の整数、消費税の計算において小数点以下は切り捨て
# 条件を満たす税抜き価格が複数存在する場合は最も小さい金額、条件を満たす税抜き価格が存在しない場合は -1
import numpy as np
def f(a, b):
    x = np.arange(1, 1001)
    xa = np.floor(x*0.08)
    xb = np.floor(x*0.10)
    for i, value in enumerate(x):
        if xa[i] == a and xb[i] == b:
            print(value)
            break
    else:
        print(-1)

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

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
 
if math.ceil(a*100/8) <= math.ceil(b*100/10):
    if math.floor(b*100/10) < math.floor((a+1)*100/8):
        print(math.ceil(b*100/10))
    else:
        print(-1)
else:
    if math.floor(a*100/8) < math.floor((b+1)*100/10):
        print(math.ceil(a*100/8))
    else:
        print(-1)

Submission status: Accepted

Solution code:
import sys
 
a,b = map(int,input().split())
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    sys.exit()
print(-1)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
tempa1=math.ceil(a/0.08)
tempa2=math.ceil((a+1)/0.08)-1
tempb1=math.ceil(b/0.1)
tempb2=int((b+1)/0.1)-1
if tempa1>tempb2 or tempa2<tempb1:
  print(-1)
else:
  print(max(tempa1,tempb1))

Submission status: Accepted

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

for i in range(1,100000):
    A = int(i*0.08)
    B = int(i*0.10)
    if A == a and B == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest


def resolve():
    A, B = [int(i) for i in input().split()]
    mina = int(-(-min(A / 0.08, B / 0.1) // 1))
    while int(mina * 0.08) == A or int(mina * 0.1) == B:
        if int(mina * 0.08) == A and int(mina * 0.1) == B:
            print(mina)
            return
        mina += 1
    else:
        print(-1)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2 2"""
        output = """25"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """8 10"""
        output = """100"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """19 99"""
        output = """-1"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """25 32"""
        output = """320"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

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

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

print(found)

Submission status: Accepted

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

Submission status: Accepted

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

isok = False
for i in range(1,2000):
    n1 = i * 0.08
    n2 = i * 0.1
    n1 = n1//1
    n2 = n2//1
    
    if(n1==A and n2==B):
        print(i)
        isok=True
        break

if(not isok):
    print(-1)

Submission status: Accepted

Solution code:
a,b=map(float,input().split())
 
import math 
 
x=a//0.08 
 

f=0
for i in range(100000):
    x=i
    
 
    if a==math.floor(x*0.08) and b==math.floor(x*0.1) :
        print(i)
        f=1
        break
if f==0:
    print(-1)

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
price = int(max(math.ceil(a/0.08), math.ceil(b/0.1)))
ans = -1
while int(price*0.08) >= a and int(price*0.1) >= b:
  if int(price*0.08) == a and int(price*0.1) == b:
    ans = price
  price -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
f = False
ans = 0
n = A * 100 // 8
m = (A + 1) * 100 // 8
for i in range(n, m + 1):
  if i * 8 // 100 == A and i // 10 == B:
    f = True
    ans = i
    break
print(ans if f else -1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
bt = [b*10+i for i in range(10)]
ans = -1
for i in range(10):
  if int(bt[i]*0.08)==a:
    ans = bt[i]
    break
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
f = False
ans = 0
for i in range(1, 1100):
  if i * 8 // 100 == A and i // 10 == B:
    f = True
    ans = i
    break
print(ans if f else -1)

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
if a % 2 == 0:
    c = [int(a * 12.5), int((a + 1) * 12.5)]
else:
    c = [int(a * 12.5) + 1, int((a + 1) * 12.5) - 1]
d = [b * 10, b * 10 + 9]
if c[1] < d[0] or d[1] < c[0]:
    print(-1)
else:
    print(max(c[0], d[0]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
a, b = map(int, input().split())

x_s = math.ceil(a /0.08)
y_s = math.ceil(b/0.10)
x = x_s
y = y_s
while math.floor(x*0.08) <= a:
    x+=1

while math.floor(y*0.10) <= b:
    y+=1


for i in range(x_s,x):
    for j in range(y_s,y):
        if i == j:
            print(i)
            quit()

print(-1)

Submission status: Accepted

Solution code:

class abc_158:
    
    def __init__(self):
        pass
    
    def A(self):
        S=input()
        if "BA" in S or "AB" in S:print("Yes")
        else:print("No")
    
    def B(self):
        NAB=list(map(int,input().split()))
        tail = NAB[0]%(NAB[1]+NAB[2]) if NAB[0]%(NAB[1]+NAB[2])<NAB[1] else NAB[1]
        ans=((NAB[0]/(NAB[1]+NAB[2]))*NAB[1])+tail
        print(int(ans))
            
    def C(self):
        AB=list(map(int,input().split()))
        ans=-1
        
        #A<B<100
        for i in range(1,1001):
            if AB[0]==int(i*0.08) and AB[1]==int(i*0.1):
                ans=i
                break
            else:continue
        print(ans)
            
    def D(self):
        pass
        
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_158()
    obj.C()

Submission status: Accepted

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

flag=1
for i in range(1100):
    if  i*8//100 == a and i//10 ==b:
        print(i)
        flag=0
        break

if flag:
    print(-1)

Submission status: Accepted

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

for i in range(10, 1011):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        exit()
    elif i == 1010:
        print(-1)
    else:
        pass

Submission status: Accepted

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

for i in range(1101):
    if int(i*0.08) == A and int(i*0.10) == B:
        print(i)
        break
    elif i == 1100:
        print("-1")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=-1
for i in range(10000,-1,-1): #10000円から0円まで大きい順に調べる
 tax1=int(i*0.08)
 tax2=int(i*0.1)
 if tax1==a and tax2==b:
   ans=i
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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)
        break;

    if i == 1009:
        print(-1)

Submission status: Accepted

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

ans = -1
for price in range(1, 1500):
    a = int(price * 0.08)
    b = int(price * 0.1)
    if a == A and b == B:
        ans = price 
        break

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
res=-1
for i in range(10,1251):
    if int(i*0.08)==a and int(i*0.1)==b:
        res=i
        break
print(res)

Submission status: Accepted

Solution code:
import sys

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

for i in range(13, 1010):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        sys.exit(0)
    
print(-1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split(" "))
p = []
q = []

for i in range(int(((a/8)*100)//1), int((((a+1)/8)*100)//1+1)):
  if i >= (a/8)*100 and i < ((a+1)/8)*100:
    p.append(i)
    
for i in range((b*10), (b+1)*10):
    q.append(i)

pq = list(set(p) & set(q))
if pq == []:
  print("-1")
else:
  print(min(pq))

Submission status: Accepted

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

from math import floor
def judge(p):
    return floor(p*0.08)==a and floor(p*0.10)==b

res = [p for p in range(10000) if judge(p)]

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

Submission status: Accepted

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

x = A * 100 // 8
flag = False

for i in range(13):
  if (x+i) * 8 // 100 == A and (x+i) // 10 == B:
    print(x+i)
    flag = True
    break

if flag == False:
  print(-1)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
from math import floor

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

ans = 10000

for i in range(10000):
    if floor(i*0.08) == A and floor(i*0.10) == B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
from math import floor

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

ans = 10000

for i in range(10000):
    if floor(i*0.08) == A and floor(i*0.10) == B:
        ans = min(ans, i)

if ans == 10000:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
A,B=map(int, raw_input().split())

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
Ans=-1

for i in range(1,10000):
    if i*0.08//1==A:
        if i*0.1//1==B:
            Ans=i
            break

print(Ans)

Submission status: Accepted

Solution code:
import sys

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

for i in range(1, MAX):
    if int(i*0.08) == A and int(i*0.1) == B:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
exist = 0
for i in range(5000):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        exist = 1
        break
if exist == 0:
    print(-1)