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 sys
import math
A,B = map(int,input().split(" "))

curr1 , curr2 = int(math.ceil(A/0.08)), int(math.floor(B/0.1))
low , high = min(curr1,curr2), max(curr1,curr2)

while low <= high:
    c1 ,c2= int(low*0.08), int(low*0.1)
    if c1 == A and c2 == B:
        print(low)
        sys.exit(0)
    low+=1
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
d=int(a/0.08)
u=int(b/0.1)
ans=-1
if min(d,u)>12:
    start=min(d,u)-12
else:
    start=0
for i in range(start,max(d,u)+13):
    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())
x = 0
up = int(min(12.5*(A+1),10*(B+1)))
down = int(max(12.5*A,10*B))
if up - down  >=1 :
  if max(12.5*A,10*B) == down:
    print(down)
  else:
    print(down+1)
else:
  print(-1)

Submission status: Accepted

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

for i in range(1, 15000):
    if i * 8 // 100 == a:
        if i * 10 // 100 == b:
            print(i)
            exit()

print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = -1
for i in range(1300):
    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())
maxV = 1010 # これ以上の値は絶対に条件Bを満たさない。
for i in range(1, maxV):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A, B = list(map(int,input().split()))
min1 = math.ceil(A / 0.08)
min2 = math.ceil(B / 0.1)
ans = max(min1, min2)

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

Submission status: Accepted

Solution code:
A, B = list(map(int,input().split()))
for i in range(1500):
    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
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

x = a / 0.08
y = b / 0.1
left = math.floor(min(x, y))
right = math.ceil(max(x, y))
for i in range(left , right + 1):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        exit()
print('-1')

Submission status: Accepted

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

minA=(A*125+9)//10
maxA=((A+1)*125+9)//10 - 1
minB=(B*100+9)//10
maxB=((B+1)*100+9)//10 - 1
#print(minA,maxA,minB,maxB)
if max(minA,minB) <= min(maxA,maxB):
    print(max(minA,minB))
else:
    print(-1)

Submission status: Accepted

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

import math
flag = 0

for i in range(1250):
	if math.floor(i*0.08) == A and math.floor(i*0.1) == B:

		print(i)
		flag = 1
		break

if flag == 0:
	print(-1)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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)
            return
        if i == 1000:
            print(-1)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b=map(int, input().split())
import math
la=math.ceil(a/0.08)
ua=(a+0.9999999)//0.08
lb=math.ceil(b/0.1)
ub=(b+0.9999999)//0.1

if la<=lb and lb<=ua:
  print(lb)
elif lb<=la and la<=ub:
  print(la)
else:
  print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
a=A//0.08
b=B//0.1
S=sorted([b,b+1,b+2,b+3,b+4,b+5,b+6,b+7,b+8,b+9])
for s in S:
    if int(s*0.08)==A and int(s*0.1)==B:
        print(int(s))
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


# 処理内容
def main():
    A, B = map(int, input().split())
    ans = -1
    for n in range(1500):
        if int(n * 0.08) == A and int(n * 0.1) == B:
            ans = n
            break
    
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import floor

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

Submission status: Accepted

Solution code:
import math

tax_8, tax_10 = map(int, input().split())

price_8_min = tax_8 / 0.08
price_8_max = (tax_8 + 0.99) / 0.08

price_10_min = tax_10 / 0.1
price_10_max = (tax_10 + 0.99) / 0.1

if max(price_8_min, price_10_min) <= min(price_8_max, price_10_max):
    print(math.ceil(max(price_8_min, price_10_min)))
else:
    print('-1')

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(math.ceil(A/0.08),math.ceil((A+1)/0.08)):
    A_se.add(i)

for i in range(math.ceil(B/0.1),math.ceil((B+1)/0.1)):
    B_se.add(i)

C = A_se & B_se
if len(C)==0:
    print(-1)
else:
    print(min(C))

Submission status: Accepted

Solution code:
import math

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

for i in range(1, 1251):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
A,B = list(map(int, input().split()))
for x in range(1, 10200):
    if A == x*8//100 and B == x//10:
        print(x)
        exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

a,b=map(int,input().split())
x=-1
xa=xb=0
for i in range(1,10000):
	xa=int(i*0.08)
	xb=int(i*0.10)
	if xa==a and xb==b:
		x=i
		break
print(x)

Submission status: Accepted

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

P = B*10
for i in range(P, P+10):
    if i*0.08 >= A and i*0.08 < A+1:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
from math import floor, ceil


def solve(A, B):
    candidates = set()
    for i in range(10):
        _A = A + i * 0.1
        x = _A / 0.08
        candidates.add(floor(x))
        candidates.add(ceil(x))
    # print(candidates)

    for i in range(10):
        _B = B + i * 0.1
        x = _B / 0.1
        candidates.add(floor(x))
        candidates.add(ceil(x))
    # print(candidates)

    ans = -1
    for c in candidates:
        if floor(c * 0.08) == A and floor(c * 0.1) == B:
            ans = min(ans, c) if ans != -1 else c

    print(ans)


if __name__ == '__main__':
    A, B = map(int, input().split())
    solve(A, B)

Submission status: Accepted

Solution code:
import math as m
a,b=map(int,input().split())
flag=True
for i in range(1,100000):
    if m.floor(i*0.08)==a and m.floor(i*0.10)==b:
        flag=False
        print(i)
        break
if flag:
    print(-1)

Submission status: Accepted

Solution code:
import math as m
a,b=map(int,input().split())
flag=True
for i in range(1,100000):
    if ((i*(8))//100)==a and (i*10)//100==b:
        flag=False
        print(i)
        break
if flag:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
Am = -(-A * 100 // 8)
AM = (A + 1) * 100 // 8
Bm = int(B * 10)
BM = int((B + 1) * 10)
for m in range(Am, AM):
    for mm in range(Bm, BM):
        if m == mm:
            print(m)
            sys.exit()
else:
    print('-1')

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

eightlow = math.ceil(A/0.08)
eighthigh = int((A+1)//0.08)
tenlow = math.ceil(B/0.1)
tenhigh = int((B+1)//0.1)

eight = []
ten = []

for i in range(eightlow, eighthigh+1):
    eight.append(i)
for i in range(tenlow, tenhigh+1):
    ten.append(i)

for i in range(len(eight)):
    for j in range(len(ten)):
        if eight[i] ==ten[j]:
            print(eight[i])
            exit()

print(-1)

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

def c_rate(X, Y):
    for i in range(1010):
        if (math.floor(i * 0.08) == X) and (math.floor(i * 0.1) == Y):
            return i
    return -1

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

Submission status: Accepted

Solution code:
import numpy as np
# S*8% = A 切り捨て np.floor(S*8%) = A
# S*10% = B　切り捨て
A,B = map(int, input().split())
S = B*10
C = 0
for i in range(S+9,S-1,-1):
    if np.floor(i*0.08) == A:
        C = i
if C == 0:
    print(-1)
else:
    print(C)

Submission status: Accepted

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

n = int(a/float(0.08))
m = int(b/float(0.10))

if int(n*float(0.08)) == a:
  n = n
else:
  n += 1

if int(m*float(0.10)) == b:
  m = m
else:
  m += 1
  
if int(n*float(0.10)) == b and int(m*float(0.08)) != a:
  print(n)
elif int(n*float(0.10)) != b and int(m*float(0.08)) == a:
  print(m)
elif int(n*float(0.10)) == b and int(m*float(0.08)) == a:
  print(min(n, m))
else:
  print('-1')

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
n = 1
ans = 0
while True:
    n += 1
    if (int(n*0.08) == a and int(n*0.10) == b):
        print(n)
        break
    if n >= (a+1)*10 and n >= (b+1)*10:
        print(-1)
        break

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
la,ra=12.5*a,12.5*a+12.5
lb,rb=10*b,10*b+10
for i in range(lb,rb):
  if la<=i<ra:
    print(i)
    exit(0)
print(-1)

Submission status: Accepted

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

for i in range(1,10100):
    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())
for i in range(1,1002):
    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())

L1, R1 = -(-(100*A) // 8), -(-(100*(A+1)) // 8) - 1
L2, R2 = -(-(100*B) // 10), -(-(100*(B+1)) // 10) - 1
L = max(L1, L2)
R = min(R1, R2)

if L <= R:
    print(L)
else:
    print(-1)

Submission status: Accepted

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


import math
for i in range(1,1251):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

for i in range(1001):
    tax_eight = int(i * 0.08)
    tax_ten = int(i * 0.1)
    if A == tax_eight and B == tax_ten:
        ans.append(i)

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

Submission status: Accepted

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

for i in range(1, 1001):
    hati = int(i * 0.08)
    juu = int(i * 0.1)
    
    if hati == a and juu == b:
        flag = 1
        print(i)
        break
    
if flag == 0:
    print("-1")

Submission status: Accepted

Solution code:
import math

a,b = map(int,input().split())
 
ans_a = int(math.ceil(a/0.08))
ans_b = int(b/0.1)
 
if ans_a <= ans_b:
  if int(ans_b*0.08) == a:
    print(ans_b)
  else:
    print(-1)
elif ans_b < ans_a:
  if int(ans_a*0.1) == b:
    print(ans_a)
  else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

m = 1/0.08
M = 100/0.08

#print(m, M)

for i in range(13, 1250):
    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 math

a,b=map(int,input().split())
#x=int(a/0.08)
#y=int(b/0.1)
for i in range(1,1001):
#for i in range(y,x+1):
  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(10001):
  if i*8//100 == a and i//10 == b:
    ans = i
    break
  else:
    ans = -1
print(ans)

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:
a, b = map( int, input().split() )

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

ans = 0
for i in range(10000):
    if (i * 8 //100) == 0:
        pass
    else:
        if (i * 8 //100) == A and (i * 10 //100) == B:
            print(i)
            ans = 1
            break

if ans == 0:
    print(-1)

Submission status: Accepted

Solution code:
import math
a,b = list(map(int, input().split()))
def zeinuki(tax, ratio):
    _min=math.ceil(tax/ratio)
    _max=math.ceil((tax+1)/ratio)-1
    return _min, _max

c08=zeinuki(a, 0.08)
c10=zeinuki(b, 0.1)
if c10[0]>c08[1] or c08[0]>c10[1]:
    print(-1)
else:
    print(max(c08[0], c10[0]))

Submission status: Accepted

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

for i in range(B*10,(B+1)*10):
    if i*8//100 == A:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, 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())

if a%2 == 0:
    a_list = [(a//2)*25+i for i in range(13)]
else:
    a_list = [(a//2)*25+i+13 for i in range(12)]

b_list = [10*b + i for i in range(10)]

flag = 0

for i in range(len(b_list)):
    for j in range(len(a_list)):
        if a_list[j] == b_list[i]:
            print(a_list[j])
            flag = 1
        if flag == 1:
            break
    if flag == 1:
        break

if flag == 0:
    print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from math import floor

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

import math
x = 0.99999999999999999999
amin = math.ceil(a/0.08)
amax = int((a+x)//0.08) 
bmin = math.ceil(b/0.10)
bmax = int((b+x)//0.10)

amin,amax,bmin,bmax #(25, 37, 20, 29)

ans = -1
for i in range(amin,amax+1):
  if i >= bmin and i <= bmax:
    ans = i
    break

print(ans)

Submission status: Accepted

Solution code:

import math
A, B = map(int, input().split())
l = []
for i in range(2000):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        l.append(i)
if len(l) != 0:
    print(min(l))
else:
    print(-1)

Submission status: Accepted

Solution code:
def main():
    from math import ceil

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

    la, ra = ceil(A * 12.5), ceil((A + 1) * 12.5)
    lb, rb = B * 10, (B + 1) * 10

    L, R = max(la, lb), min(ra, rb)  # [L,R)

    if L >= R:
        print(-1)
        return

    print(L)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

x = []
i = 1
n = int(a/0.08) + int(b/0.1) + 2

for i in range(0,n):
  if(int(0.08*i) == a and int(0.1*i) == b):
    x.append(i)
    
if(len(x) != 0):
  print(min(x))
else:
  print(-1)

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
for i in range(1,1263):
  if int(i*0.08)==n and int(i*0.1)==m:
    print(i)
    break
else:
  print(-1)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; cnt = 0; ansli = []; tmpli = []; candili = []; stillset = set()
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]#WideIntPoint
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def s_list(): return list(input())
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]#HeightString
def mi(n): return [wi() for _ in range(n)]#MatrixInt
def num__grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]#NumberGrid
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def grid(n): return [s_list() for _ in range(n)]

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

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:
import math
A,B=map(int,input().split())
a=math.ceil(A/0.08)
aa=math.floor((A+1)/0.08)
for i in range(a,aa):
  if B<=i*0.1<B+1:
    print(i)
    exit()
else:
  print('-1')

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    A, B = LI()
    A_bottom,A_upper = A/0.08,(A+1)/0.08
    B_bottom,B_upper = B/0.10,(B+1)/0.10
    # print(A_bottom,A_upper,B_bottom,B_upper)
    if A_bottom>=B_bottom and A_bottom<B_upper:
        print(int(A_bottom) if A_bottom<=int(A_bottom) else int(A_bottom)+1)
    elif B_bottom>=A_bottom and B_bottom<A_upper:
        print(int(B_bottom) if B_bottom<=int(B_bottom) else int(B_bottom)+1)
    else:
        print(-1)

main()

Submission status: Accepted

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

Submission status: Accepted

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

x1 = -(-25*A//2)
x2 = 25*(A+1)//2
x3 = 10*B
x4 = 10*(B+1)
#print(x1, x2, x3, x4)

if x1 <= x3 and x3 < x2:
  print(x3)
elif x3 <= x1 and x1 < x4:
  print(x1)
else:
  print(-1)

Submission status: Accepted

Solution code:
import sys

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

print(-1)

Submission status: Accepted

Solution code:
import sys

def ep(*params):
    print(*params,file=sys.stderr)

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

    

aa = int((A / 8 * 100))
bb = int(B / 10 * 100)
ep(aa,bb)

sa = set()
sb = set()
for a in range(aa-13,aa+14):
    if int(a * 0.08) == A:
        sa.add(a)
for b in range(bb-11,bb+12):
    if int(b * 0.10) == B:
        sb.add(b)
ep(sa,sb,sa&sb)
s = sa&sb
if len(s) > 0:
    print(min(s))
else:
    print(-1)

Submission status: Accepted

Solution code:
# import sys
import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()
# sys.setrecursionlimit(100000)
# INF = 1001001001001
# MOD = 1000000007


def main():

    A, B = map(int, input().split())
    a1 = A * 12.5
    a2 = (A + 1) * 12.5
    b1 = B * 10
    b2 = (B + 1) * 10

    ans = math.ceil(max(a1, b1))
    if ans < a2 and ans < b2:
        print(ans)
    else:
        print("-1")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

n = b * 10

for i in range(10):
    if a == int((n+i)*0.08):
        print(n+i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
rmin = B*10
rs = []
for r in range(rmin, rmin+10+1):
  if r*8//100 == A and r*10//100 == B:
    rs.append(r)
if len(rs) == 0:
  print(-1)
else:
  r = min(rs)
  print(r)

Submission status: Accepted

Solution code:
# For taking space seperated integer variable inputs.
import math


def invr():
    return(map(int, input().split()))


A, B = invr()
res = -1
for i in range(1001):
    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())
money = B*10
ans=-1
while money//10==B:
	if int(money*0.08)==A:
		ans=money
		break
	money+=1
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ans=[]
for i in range(1,2000):
  if int(i*0.08)==A and int(i*0.1)==B:
    ans.append(i)
if len(ans)==0:
  print("-1")
else:
  print(min(ans))

Submission status: Accepted

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

a=math.ceil(A/0.08)
b=math.ceil(B/0.10)
#print(a,b)
c=max(a,b)
d=int(c*0.08)
e=int(c*0.1)

if A==d and B==e:
    print(int(c))
else:
    print(-1)

Submission status: Accepted

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

for n in range(1000 + 1):
    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())
cal,cal2=0,0
ans=[]

for i in range(1200):
    cal=math.floor(i*0.08)
    cal2=math.floor(i*0.1)

    if cal==A and cal2==B:
        ans.append(i)


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

Submission status: Accepted

Solution code:
# C - Tax Increase
# https://atcoder.jp/contests/abc158/tasks/abc158_c

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

for x in range(1, 100000):
  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())
s = 0
for i in range(10001):
    if (i*0.08)//1 == a and (i*0.1)//1 == b:
        s = 1
        break
if s == 0:
    print("-1")
else:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    ans = -1
    for i in range(10000, -1, -1):
        tax1 = int(i*0.08)
        tax2 = int(i*0.10)
        if tax1 == a and tax2 == b:
            ans = i
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import ceil, floor

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

Submission status: Accepted

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

a=True
for i in range(10000):
    if int(0.08*i)==A and int(0.10*i)==B:
        print(i)
        a=False
        break
if a==True:
    print(-1)

Submission status: Accepted

Solution code:
from math import floor

A, B = map(int, input().split())
for i in range(1, 1251):
    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(10000):
    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(100000):
    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())
for i in range(B*100):
    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
a1 = math.ceil(A/0.08)
a2 = math.floor((A+1)/0.08)
b1 = math.ceil(B/0.1)
b2 = math.floor((B+1)/0.1)
aa = list(range(a1, a2+1))
bb = list(range(b1, b2+1))
ab = set(aa)&set(bb)
ab = list(ab)
ab.sort()
if len(ab)>1:
  print(ab[0])
else:
  print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for ans in range(1, 1001):
    tmp_A = ans * 8 // 100
    tmp_B = ans // 10
    if tmp_A == A and tmp_B == B:
        print(ans)
        exit()
print('-1')

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    a,b=map(int,readline().split())

    for n in range(b*10,b*10+10):
        if n*8//100==a:
            print(n)
            break
    else:
        print(-1)

if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
a1 = A/0.08
a2 = (A+1)/0.08
X = []
for i in range(13,1263):
    if a1<=i<a2:
        X.append(i)
b1 = B/0.1
b2 = (B+1)/0.1
x = -1
for y in X:
    if b1<=y<b2:
        x = y
        break
print(x)

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
for k in range(1,20000):
    if int(k*1.08) == A+k and int(k*1.10) == B+k:
        print(k)
        exit(0)
print(-1)

Submission status: Accepted

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

for X in range(1, max(A * 13, B * 10) + 1):
    A_tmp = X * 8 // 100
    B_tmp = X * 10 // 100
    if A_tmp == A and B_tmp == B:
        ans = X
        break
else:
    ans = -1

print(ans)