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

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

x = math.ceil(100 / 8 * A)
y = math.ceil(100 / 10 * B)

if x == y:
  print(x)
elif x > y:
  if math.floor(x*0.1) == B:
    print(x)
  else:
    print(-1)
else:
  if math.floor(y*0.08) == A:
    print(y)
  else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
x = 0
while int(x * 0.08) <= A or int(x * 0.1) <= B:
    x += 1
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        exit()
print(-1)

Submission status: Accepted

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

p_lst = []
f = False
for p in range(1, 100*11):
    if int(p*0.08) == A and int(p*0.1) == B:
        p_lst.append(p)
        f = True
if not f:
    print(-1)
else:
    print(min(p_lst))

Submission status: Accepted

Solution code:
import math

t8 = [[] for _ in range(130)]
t10 = [[] for _ in range(130)]
for i in range(1251):
    t8[math.floor(i * 0.08)].append(i)
    t10[math.floor(i * 0.1)].append(i)

a, b = map(int, input().split())
if min(t8[a]) > max(t10[b]) or max(t8[a]) < min(t10[b]):
    print(-1)
else:
    print(max(min(t8[a]), min(t10[b])))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def main():

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

    lo = max(1000 * a, 800 * b)
    hi = min(1000 * (a + 1), 800 * (b + 1))

    if lo < hi:
        print(math.ceil(lo / 80))
    else:
        print(-1)


main()

Submission status: Accepted

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

ans = 1001
for n in range(1001):
  if n * 8 // 100 == a and n * 10 // 100 == b:
    ans = min(ans, n)

if ans < 1001:
  print(ans)
else:
  print(-1)

Submission status: Accepted

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

for i in range(1200):
    if (i * 8)//100 == a and (i*10)//100 == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

import math
flag = True
for i in range(1009):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
        print(i)
        flag = False
        break
if flag:
    print(-1)

Submission status: Accepted

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

import math
aS = math.ceil(a / 0.08)
al = math.floor((a + 1) / 0.08)
bs = math.ceil(b / 0.10)
bl = math.floor((b + 1) / 0.10)

flag = True
for i in range(10000):
    if aS <= i < al and bs <= i < bl:
        print(i)
        flag = False
        break
if flag:
    print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math

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

c = math.ceil(b / 0.1)

for i in range(c, c + 10):
    if math.floor(i * 0.1) == b:
        if math.floor(i * 0.08) == a:
            print(i)
            sys.exit()

print(-1)

Submission status: Accepted

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

for i in range(1200):
    if floor(i*0.08)==a and floor(i*0.1)==b:
        print(i)
        break
else:
   print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil,floor

A,B=map(int,input().split())
x_min=int(min(ceil(A/0.08)-5, ceil(B/0.1)-5))
x_max=int(max(ceil((A+1)/0.08)+5, ceil((B+1)/0.1)+5))
exists=0
for i in range(x_min, x_max):
  if floor(i*0.08)==A and floor(i*0.1)==B:
    print(i)
    exists=1
    break
if not exists:print(-1)

Submission status: Accepted

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

A = int(a/0.08)
B = int((b+1)/0.1)
l =['-1']

for i in range(A,B+1):
    if int(i*0.08) == a and int(i*0.1) == b:
        l.append(i)
        break
        
print(l[-1])

Submission status: Accepted

Solution code:
import math
A, B = list(map(int, input().split()))
a = math.ceil(A / 0.08)
b = math.ceil(B / 0.1)
if a == b:
    print(a)
else:
    if a < b and int(b * 0.08) == A:
        print(b)
    elif a > b and int(a * 0.1) == B:
        print(a)
    else:
        print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for N in range(10000):
  if int(N*0.08)==A and int(N*0.1)==B:
    print(N)
    break
else:
  print(-1)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
arange = set(range(math.ceil(A*100/8), math.ceil((A+1)*100/8)))
brange = set(range(math.ceil(B*100/10), math.ceil((B+1)*100/10)))
ans_range = arange & brange
if len(ans_range) == 0:
    print(-1)
else:
    print(min(ans_range))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

n = math.floor(a / 0.08)
m = math.floor(b / 0.1)
n2 = n + 1
m2 = m + 1

p = math.floor(n * 0.08)
q = math.floor(n * 0.1)
x = math.floor(m * 0.08)
y = math.floor(m * 0.1)
p2 = math.floor(n2 * 0.08)
q2 = math.floor(n2 * 0.1)
x2 = math.floor(m2 * 0.08)
y2 = math.floor(m2 * 0.1)

if p == a and q == b and x == a and y == b:
    print(min(n,m))
elif p == a and q == b:
    print(n)
elif x == a and y == b:
    print(m)
elif p2 == a and q2 == b and x2 == a and y2 == b:
    print(min(n2,m2))
elif p2 == a and q2 == b:
    print(n2)
elif x2 == a and y2 == b:
    print(m2)
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    for x in range(1, 1500):
        if 8 * x // 100 == A and 10 * x // 100 == B:
            print(x)
            return

    print('-1')
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,m= map(int,input().split())
num = 0

f_n = False
f_m = False

num_n = 0
num_m = 0

while True:
  num_n = int(num * 0.08)
  num_m = int(num * 0.1)
  if int(num_n) == n:
    f_n = True
  if int(num_m) == m:
    f_m = True
  if f_m == True and f_n == True:
    print(num)
    break
  if num_m > 100 or num_n > 100 :
    print(-1)
    break
  f_m = False
  f_n = False
  num += 1

Submission status: Accepted

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

Submission status: Accepted

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

a1 = math.ceil(A / 0.08)
a2 = math.floor((A+1) / 0.08)
b1 = math.ceil(B / 0.10)
b2 = math.floor((B+1) / 0.10)

dupl = set(range(a1, a2)) & set(range(b1, b2))
if len(dupl) > 0: 
    print(min(dupl))
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

e = 0.08
t = 0.1

for i in range(1, 1000+1):
    if int(i * e) == a and int(i * t) == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline

A, B = map(int, input().split())
X = A / 0.08
Y = B/0.1
for i in range(math.floor(min(X, Y)), math.ceil(max(X, Y)) + 1):
    if int(i * 0.08) == A and int(i * 0.10) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

for money in range(pow(10, 4)):
    if int(money*0.08) == a and int(money*0.1) == b:
        ans = money
        break

print(ans)

Submission status: Accepted

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

ans = 0
for i in range(10000):
    x = int(i*0.08)
    y = int(i*0.10)
    if x == a and y == b:
        ans = i
        break
if ans == 0:
    print(-1)
    exit()
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
ans = -1
for i in range((B+1)*10):
    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())

n = 0
while True:

    if int(n * 0.08) == A and int(n*0.1) == B:
        break

    n += 1

    if n > 10000:
        n = -1
        break

print(n)

Submission status: Accepted

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

for n in range(1500):
    xa = int(n * 0.08)
    xb = int(n * 0.1)
    if a == xa and b == xb:
        print(n)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import sys

A, B = (int(x) for x in input().split())
num=0
while int(num*0.08)<=A:
  if int(num*0.08)==A and int(num*0.1)==B:
    print(num)
    sys.exit(0)
  num+=1
print(-1)

Submission status: Accepted

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

a_min, a_max = ceil(a/0.08), ceil((a+1)/0.08)
b_min, b_max = ceil(b/0.1), ceil((b+1)/0.1)

l = set(range(a_min, a_max)) & set(range(b_min, b_max))
ans = '-1' if len(l) == 0 else min(l)
print(ans)

Submission status: Accepted

Solution code:
A, B = [int(_) for _ in input().split()]
aa = [int(i * 0.08) for i in range(1, 10000)]
bb = [int(i * 0.1) for i in range(1, 10000)]
for i, a, b in zip(range(1, 10000), aa, bb):
    if (a, b) == (A, B):
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
a1=a/0.08
a2=(a+1)/0.08
b1=b/0.1
b2=(b+1)/0.1
ans=20000
for i in range(1,10001):
    if a1<=i and b1<=i and a2>i and b2>i:
        ans=min(ans,i)
if ans==20000:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
a_0 = int((25 * A + 1) / 2)
a_1 = int((25 * (A + 1) - 1) / 2)
b_0 = int(10 * B)
b_1 = int(10 * (B + 1) - 1)
if a_0 >= b_0 and a_0 <= b_1:
    print(a_0)
elif b_0 >= a_0 and b_0 <= a_1:
    print(b_0)
else:
    print('-1')

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.10) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
A, B = 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)

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
#print(A/0.08)
#print(B/0.1)
ga = math.ceil(A/0.08)
gb = math.ceil(B/0.1)

small = min(ga,gb)
big = max(ga,gb)

for i in range(small,big+1):
  #print(math.floor(i*0.08) ,math.floor(i*0.1))
  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 sys
import math
a,b = map(int,input().split())
for i in range(1,1251):
	if math.floor((i*(8/100))) == a and math.floor((i*(10/100))) == b:
		print(i)
		sys.exit()
print(-1)

Submission status: Accepted

Solution code:
from math import ceil as c,floor as f
a,b=map(int,input().split())
ah,bh=a+.99,b+.99
a1,a2=c(a/.08),f(ah/.08)
b1,b2=c(b/.1),f(bh/.1)
if a2<b1 or b2<a1: print(-1)
else:
    if b1<=a1<=b2: print(a1)
    elif a1<=b1<=a2: print(b1)
    elif b1<=a2<=b2: print(a2)
    elif a1<=b2<=a2: print(b2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit

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

x = -(-A // 0.08)
y = B // 0.1

min_result = int(max(x, y))

while int(min_result * 0.08) <= A or int(min_result * 0.1) <= B:
    if int(min_result * 0.08) == A and int(min_result * 0.1) == B:
        print(int(min_result))
        exit()
    min_result += 1

print(-1)

Submission status: Accepted

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

ans = -1
for i in range(10**5):
    if i*8//100 == A and i*10//100 == B:
        ans = i
        break
    elif i*8//100 > A and i*10//100 > B:
        break
print(ans)

Submission status: Accepted

Solution code:
from math import floor

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
 
ans=-1
for x in range(1000+1):
    if int(x*(8/100))==A and int(x*(10/100))==B:
        ans=x
        break

print(ans)

Submission status: Accepted

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

for n in range(2000):
    if int(n * 0.08) == a and int(n * 0.1) == b:
        print(n)
        break
if n ==1999:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = []
for i in range(1, 15000):
    if int(i * 8 / 100) == A and int(i * 10 / 100) == B:
        ans.append(i)
if ans:
    print(ans[0])
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a,b=map(int,input().split())
top=int((b+1)*10)
bottom=int(b*10)
for i in range(bottom,top):
    if int(i*0.08)==a:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

for i in range(1010):
    if i*8//100==a and i//10==b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
A, B = map(int, input().split())
s = {*range(25 * A, 25 * A + 25)} & {*range(20 * B, 20 * B + 20)}
s = {i // 2 for i in s if i % 2 < 1}
print(-1 * (len(s) < 1) or min(s))

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b = readInts()
for i in range(1, 10001):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

a,b=MI()
for i in range(1,2000):
    x=(i*8)//100
    y=(i*10)//100
    #print(x,y)
    if x==a and y==b:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

Solution code:
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)
    exit()
print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
import math
N = math.ceil(A / 0.08)
n = math.ceil(B / 0.1)
M = max(N, n)
m = min(N, n)
ans = -1
for i in range(m, M+1):
  if int(i*0.08) == A and int(i*0.1) == B:
    ans = i
    break
print(ans)

Submission status: Accepted

Solution code:
def solve():
    ans = 0
    A, B = map(int, input().split())
    lower8 = A/0.08
    upper8 = (A+1)/0.08
    lower10 = B/0.1
    upper10 = (B+1)/0.1
    for i in range(1,2001):
        if i>=lower8 and i<upper8 and i>=lower10 and i<upper10:
            return i
    return -1
print(solve())

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

A, B = inm()


def solve():
    for x in range(200000):
        a = int(x * 0.08 + 1e-9)
        b = int(x * 0.10 + 1e-9)
        if a == A and b == B:
            return x

    return -1


print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

res = -1
p = int(B/0.1)

for i in range(p, p+10):
    if math.floor(i*0.08) == A:
        res = i
        break

print(res)

Submission status: Accepted

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

import math
ans=-1

for i in range(1251):#商品の価格の取りうる最大値は1250円
    sval_A=math.floor(i*0.08)#math.floor()は小数点以下切り捨て
    sval_B=math.floor(i*0.10)
    if sval_A == A and sval_B == B:
        ans=i
        break

print(ans)

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
p,ans = int(b / 0.1),-1

for i in range(p,int(p+10)):
    if math.floor(i * 0.08) == a:
        ans = i
        break

print(ans)

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

Submission status: Accepted

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    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)
            exit()
    print(-1)
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import math

a,b = map(int,input().split())
ans = []
count = 0

for i in range(1,1001):
     if(math.floor(i * 0.08) == a and math.floor(i * 0.1) == b):
        ans.append(i)
        count += 1

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

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
for i in range(10000):
    if int(i*2/25) == A and int(i/10) == B:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import exit
A,B = map(int,input().split())

satA = []
i = 0
while True:
    if int(i * 0.08) == A:
        satA.append(i)
        i += 1
    else:
        if len(satA) != 0:
            break
        else:
            i += 1

for i in satA:
    if int(i * 0.1) == B:
        print(i)
        exit(0)

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
rate8max = math.floor((A+1)/0.08)
rate8min = math.ceil(A/0.08)
rate10max = math.floor((B+0.9)/0.1)
rate10min = math.ceil(B/0.1)
ans = -1
if rate10min >= rate8min and rate10min <= rate8max:
    for i in range(rate10min, rate8max+1):
        if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
            ans = i
            break
elif rate8min >= rate10min and rate8min <= rate10max:
    for i in range(rate8min, rate10max+1):
        if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
            ans = i
            break
    # 100            100          109         112
elif rate10min >= rate8min and rate10max <= rate8max:
    for i in range(rate10min, rate10max+1):
        if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
            ans = i
            break
elif rate8min >= rate10min and rate8max <= rate10max:
    for i in range(rate8min, rate8max+1):
        if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
            ans = i
            break
print(ans)

Submission status: Accepted

Solution code:
import math
def main():
  A, B = map(int, input().split())
  
  #Nは最大でも１２５０
  
  for n in range(1, 1251):
    if math.floor(n * 0.08) == A and math.floor(n * 0.1) == B:
      print(n)
      return
  print(-1)
    
  
main()

Submission status: Accepted

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

if (int(12.5*a)+(a%2)) > 10*b+9 or (int(12.5*a)+(a%2))+12-(a%2) < 10*b:
    print(-1)
else:
    print(max((int(12.5*a)+(a%2)), 10*b))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
for i in range(1,10100//8+1):
    if int(i*0.08)==A and int(i*0.10)==B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

import math
for i in range(10):
    if math.floor((x+i)*0.08)==a:
        print(x+i)
        exit(0)

print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math


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

pred_a = math.ceil(a / 0.08)
pred_b = b * 10

ans = []
for i in range(13):
    for j in range(10):
        if pred_a+i == pred_b+j and int((pred_a+i)*0.08) == a and int((pred_b+j)*0.1) == b:
            ans.append(pred_a+i)
if len(ans)==0:
    print(-1)
else:
    print(min(ans))

Submission status: Accepted

Solution code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations

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

flg = 0
for i in range(1,1200+1):
    CHK_A= (i * 8) // 100
    CHK_B= (i * 10) // 100
    if A == CHK_A and B == CHK_B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
import math
A, B = map(float, input().split())
lowerA = math.ceil(A/0.08)
upperA = math.floor((A+1)/0.08)      
lowerB = math.ceil(B/0.1)
upperB = math.floor((B+1)/0.1)
answer = -1
for i in range(lowerA, upperA):
  if (lowerB <= i) and (i < upperB):
    answer = i
    break
print(answer)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for i in range(1, 1100):
    if int(i*0.08)==A and int(i*0.1)==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, 10001):
  a_tax = int(i * 0.08)
  b_tax = int(i * 0.1)
  
  if a_tax == a and b_tax == b:
    ans = i
    break

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# C - Tax Increase
A,B = map(int,input().split())
ans = '-1'
for x in range(10*B,10*(B+1)):
    if 8*x//100==A:
        ans = x
        break
print(ans)

Submission status: Accepted

Solution code:
import math
A,B = list(map(int,input().split()))
list08 = []
list10 = []
for i in range(math.floor(A/0.08),math.ceil((A+1)/0.08)+1):
    if math.floor(i*0.08) == A:
        list08.append(i)
for i in range(math.floor(B/0.10),math.ceil((B+1)/0.1)+1):
    if math.floor(i*0.10) == B:
        list10.append(i)
ans = list(set(list08) & set(list10))
if ans ==[]:
    print(-1)
else:
    print(min(ans))

Submission status: Accepted

Solution code:
import sys

A,B = (int(a) for a in input().split())
for i in range(10**4+1) :
    if (A <= i*0.08 < A+1) and (B <= i*0.1 < B+1) :
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for p in range(1010):
    if int(p*0.08) == a and int(p*0.1) == b:
        print(p)
        exit()

print(-1)

Submission status: Accepted

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

for i in range(10100):
    if A == int(i * 0.08) and B == int(i * 0.1):
        print(i)
        break
else:
    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())

judge = "none"
for i in range(1, 1300):
    if int(i*0.08)==A and int(i*0.10)==B:
        print(i)
        judge = "have"
        break

if judge=="none":
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
n=math.ceil((a*100)/8)
m=int((a*100)/10)
result=[]
for i in range(m-100,n+100):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        result.append(i)
if result==[]:
    print(-1)
    exit()
print(min(result))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ten = []
ei = []
for i in range(1,1010):
    if a <= i*0.08 < a+1:
        ei.append(i)
for j in range(1,1010):
    if b <= j*0.1 < b+1:
        ten.append(j)
case = set(ei) & set(ten)
if not case:
    print(-1)
else:
    print(min(case))