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

min_a=a*12.5
min_b=b*10

if min_b-min_a<12.5 and min_a<=min_b:
    print(str(min_b))

elif min_a-min_b<10 and min_b<=min_a:
    if a%2==1:
        print(str(int(min_a)+1))
    else:
        print(str(int(min_a)))
else:
    print(str(-1))

Submission status: Accepted

Solution code:

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

result = False
Amin = int(round(A * 12.5)) 
Amax = int(round((A+1) * 12.5)-1)
Bmin = B * 10
Bmax = (B+1) * 10 - 1


for i in range(Amin,Amax+1):
    for j in range(Bmin,Bmax+1):
        if(i == j):
            print(i)
            result = True
            break

    if(result):

        break



if(result==False):
    print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

A, B = map(int, input().split())
Am = math.ceil(A * 12.5)
AM = math.ceil((A+1) * 12.5)
Bm = B * 10
BM = (B+1) * 10

if AM <= Bm or BM <= Am:
  print(-1)
elif Am <= Bm:
  print(Bm)
else:
  print(Am)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
X=[]
for i in range(1100):
	if A+1>0.08*i>=A and B+1>0.1*i>=B:
		X.append(i)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
c = set(range(math.ceil(a*100/8), math.ceil((a + 1)*100/8)))
d = set(range(math.ceil(b*10), math.ceil((b + 1)*10)))
if len(c & d) == 0:
  print(-1)
else:
  print(min(c & d))

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

x = set(range(math.ceil(a/0.08), math.floor((a+0.99)/0.08)+1))
y = set(range(math.ceil(b/0.1), math.floor((b+0.99)/0.1)+1))
z = x.intersection(y)
print(min(z)) if z else print(-1)

Submission status: Accepted

Solution code:
from math import floor, ceil
a, b = map(int, input().split())
x = max(ceil(a / 0.08), ceil(b / 0.1))
ans = -1
for y in range(x, 2000, 1):
    if a == floor(y * 0.08) and b == floor(y * 0.1):
        ans = y
        break
    elif a != floor(y * 0.08) and b != floor(y * 0.1):
        ans = -1
print(ans)

Submission status: Accepted

Solution code:
import math

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

i = 1
c = 1
d = 0
while i > 0:
  if d > B:
    print(-1)
    break
  else:
    a = math.floor(c * 0.08)
    b = math.floor(c * 0.1)
    if a == A and b == B:
      print(c)
      break
    else:
      c += 1
      d = b

Submission status: Accepted

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


def solve(A: int, B: int):
    for i, a, b in map(lambda x: (x, int(x*0.08), int(x*0.1)), range(A*100)):
        if a == A and b == B:
            return i
    return -1


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    print(solve(A, B))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def main():
    A, B = [int(i) for i in input().split()]
    A_o = int(A*100/8)
    B_o = B*10

    if A_o == B_o:
        print(B*10)
    elif A_o > B_o:
        for i in range(B_o,(B+1)*10):
            if int(i * 0.08) == A:
                print(i)
                return
        else:
            print(-1)
    elif A_o < B_o:
        for i in range(A_o,int((A+1)*100/8)):
            if (i * 0.1) == B:
                print(i)
                return
        else:
            print(-1)

if __name__ == "__main__":
    main()

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())
x = -1

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

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
min_a = math.ceil(a / 0.08)
max_a = math.ceil((a+1) / 0.08)

max_b = math.ceil((b+1) / 0.1)
min_b = math.ceil(b / 0.1)

a_range = set(list(range(min_a, max_a)))
b_range = set(list(range(min_b, max_b)))
t = a_range & b_range
if len(t) > 0:
    print(min(list(t)))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
ans = [[] for _ in range(2)]
p1_min = math.ceil(a*100/8)
p1_max = math.ceil((a+1)*100/8)
for i in range(p1_min,p1_max):
    ans[0].append(i)
    
p2_min = math.ceil(b*100/10)
p2_max = math.ceil((b+1)*100/10)
for i in range(p2_min,p2_max):
    ans[1].append(i)

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

Submission status: Accepted

Solution code:
import math

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

x = 1
while x < 1010:
    if math.floor(x * 0.08) == a and math.floor(x * 0.1) == b:
        print(x)
        exit()

    x += 1

print(-1)

Submission status: Accepted

Solution code:
from math import floor
import sys
from copy import copy
input = sys.stdin.readline
'''
n, m = map(int, input().split())
n = int(input())
A = list(map(int, input().split()))
S = input().strip()
for test in range(int(input())):
'''
inf = 100000000000000000  # 1e17
mod = 998244353

aa, bb = map(int, input().split())
for i in range(1, 10000):
    if int(floor(i * 0.08)) == aa and int(floor(i * 0.1)) == bb:
        print(i)
        sys.exit()
print("-1")

Submission status: Accepted

Solution code:
N=[i for i in range(1,1001)]
A,B=map(int,input().split())
for j in range(len(N)):
  m=int(N[j]*0.08)
  if m>A:
    break
  elif m==A:
    M=int(N[j]*0.1)
    if M==B:
      print(N[j])
      exit()
    elif M>B:
      break
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

x = -1
for i in range(10100):
  if (int(i*0.08) == A) and (int(i*0.1) == B):
    x = i
    break
  
print(x)

Submission status: Accepted

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

for i in range(1009):
    if math.floor(i*0.08) == a and math.floor(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(2000):
    if int(i*0.08) == a and int(i*0.10) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

ans = -1 # 答えが見つからなかった場合の-1を初期値にしておく

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

print(ans)

Submission status: Accepted

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

ans = -1
for i in range(2000):
  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 = list(map(int,input().split()))
output = '-1'

c = math.ceil(a/0.08)
d = math.ceil(b/0.1)
c_plus = math.ceil((a+1)/0.08)
d_plus = math.ceil((b+1)/0.1)

if c_plus <= d or d_plus <= c:
  print(output)
else:
  print(max(c,d))

Submission status: Accepted

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

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    A, B = MI()
    x = 10*B
    n = 0

    for i in range(1001):
        if  math.floor(x*0.08) == A:
            break
        x += 1

        if i == 1000:
            x = 10*B
            break
    for i in range(1001):
        x += -1
        if math.floor(x*0.08) != A or math.floor(x*0.1) != B:
            x += 1
            break

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





if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

A, B = rl()

import math
for i in range(1, 2000):
    if math.floor(i*8/100) == A and math.floor(i*10/100) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

a_min = -(-a*100//8)
a_max = int((a+1)*100/8)-1
b_min = -(-b*100//10)
b_max = int((b+1)*100/10)-1

if a_max >= b_min and b_max >= a_min:
    print(max([a_min, b_min]))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
def main():
    A, B = map(int, input().split())
    find = False
    price = 0
    for i in range(1, 10001):
        if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
            price = i
            find = True
            break
    if find:
        print(i)
    else:
        print(-1)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
x_min = int(b * 10)
x_max = x_min + 9
ok_flag = False

for x in range(x_min, x_max + 1):
    ax = int(x * 0.08)
    if ax == a:
        ok_flag = True
        break

result = x if ok_flag else '-1'
print(result)

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.10) == B:
        print(i)
        sys.exit(0)
print(-1)

Submission status: Accepted

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

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

for i in range(1001):
    temp_a = i * 0.08
    temp_b = i * 0.1
    if math.floor(temp_a) == a and math.floor(temp_b) == b:
        print(i)
        exit(0)
print("-1")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=-1
for i in range(1,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())

min_a = math.ceil(a/0.08)
max_a = math.floor((a+1)/0.08)
min_b = math.ceil(b/0.1)
max_b = math.floor((b+1)/0.1)

if max_a <= min_b or max_b <= min_a:
  print(-1)
else:
  print(max([min_a, min_b]))

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1200):
    A_calc = int(i * 0.08)
    B_calc = int(i * 0.1)
    if A_calc == A and B_calc == B:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math
a, b = list(map(int,input().split()))
i = 0
j = 0
res = 0
while i < a or j < b:
	i = math.floor(res * 0.08)
	j = math.floor(res * 0.1)
	#print(i)
	#print(j)
	#print(res)
	#print("\n\n")
	if i == a and j == b:
		break
	res += 1

if i > a or j > b:
	print(-1)
else:
	print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

x_a_min = a/0.08
x_a_max = (a+1)/0.08
x_b_min = b/0.1
x_b_max = (b+1)/0.1

if math.ceil(max(x_a_min,x_b_min))<math.ceil(min(x_a_max,x_b_max)):
    print(math.ceil(max(x_a_min,x_b_min)))
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
cnt=0
ans=0
for x in range(1,1010):
    if 8*x//100==a and x//10==b:
        cnt += 1
        ans=x
        break
if cnt>0: print(ans)
else: print(-1)

Submission status: Accepted

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

print(X)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
X=A/0.08
Y=B/0.1
Z=max(X,Y)
if not int(Z*0.08) == A:
	Z=-1
if not int(Z*0.1) == B:
	Z=-1
if int(Z) == Z:
	print(int(Z))
else:
	print(int(Z)+1)

Submission status: Accepted

Solution code:
A,B=[int(s) for s in input().split()]
for i in range(1,1001):
  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:
# A: 0.08 tax, B: 0.10 tax
A, B = list(map(int, input().split()))

# find candidate prices
candidate_prices = [(B * 10) + i for i in range(0, 9)]

# find minimum possible price
min_price = -1
for p in candidate_prices:
    if int(p * (0.08)) == A:
        min_price = p
        break

print(min_price)

Submission status: Accepted

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

for i in range(1, 2000):
    price_a = 0.08 * i
    price_b = 0.1 * i

    if int(price_a) == a and int(price_b) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
A,B=map(int, input().split())
flag=False
for i in range(1250):
  A_X=math.floor(i*0.08)
  if(A_X==A):
    B_X=math.floor(i*0.10)
    if(B_X==B):
      print(i)
      flag=True
      break
if(flag==False):
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(int(min(A/0.08, B/0.1)), int(max((A+1)/0.08,(B+1)/0.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 = map(int, input().split())

x1 = a / 0.08
x2 = b / 0.10

for x in range(int(min(x1, x2))-10, int(max(x1, x2))+10):
    if int(x*0.08) == a and int(x*0.10) == b:
        print(x)
        exit()
print(-1)

Submission status: Accepted

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

for x in range(2000):
    if int(x*0.08) == a and int(x*0.10) == b:
        print(x)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
minV = math.ceil(a / 0.08)
maxV = int((a + 1) // 0.08)

for i in range(minV, maxV):
    if int(i * 0.1) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
if (100*a)%8==0:
    min8=int(a/0.08)
else:
    min8=int((a/0.08)+1)
if (100*(a+1))%8==0:
    max8=int((a+1)/0.08)-1
else:
    max8=int((a+1)/0.08)
min10=int(b/0.1)
max10=int((b+1)/0.1)-1

for i in range(min8,max8+1):
    if min10<=i<=max10:
        print(i)
        exit()
print("-1")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
data = input().split()

a = int(data[0])
b = int(data[1])

n = min(int(a / 0.08), int(b / 0.1))

def lookup():    
    for i in range(n, 10000):
        tax_a = int(i * 0.08)
        tax_b = int(i * 0.1)
        if tax_a == a and tax_b == b:
            print(i)
            return
    print(-1)

lookup()

Submission status: Accepted

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

for i in range(B * 100):
    tmp1 = int(i * 0.08)
    tmp2 = int(i * 0.1)

    if tmp1 == A and tmp2 == B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b =map(int,input().split())
for i in range(1009):
  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, 20000):
    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 math
a,b=map(int,input().split())
C = [i for i in range(12,1001)]
for c in C:
  if math.floor(c * 0.08) == a and math.floor(c * 0.1)==b:
    print(c)
    sys.exit()

print(-1)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1


if Amax<=Bmin or Bmax<=Amin:
    print(-1)
else:
  a=math.ceil(Amin)
  b=math.ceil(Bmin)
  if a<Bmax or b<Amax:
    print(max(a,b))
  else:
    print(-1)

Submission status: Accepted

Solution code:
import math

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

priceA1 = math.ceil(A / 0.08)
priceA2 = (A+1) / 0.08
priceB1 = math.ceil(B / 0.10)
priceB2 = (B+1) / 0.10

if math.floor(priceA2) < priceA2:
    priceA2 = math.floor(priceA2)
else:
    priceA2 = math.floor(priceA2) - 1


if math.floor(priceB2) < priceB2:
    priceB2 = math.floor(priceB2)
else:
    priceB2 = math.floor(priceB2) - 1

if priceA1 <= priceB1 <= priceA2:
    print(math.ceil(priceB1))
elif math.ceil(priceB1) < math.ceil(priceA1) < priceB2:
    print(math.ceil(priceA1))
elif math.ceil(priceA1) == math.ceil(priceB1):
    print(math.ceil(priceA1))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
i=1
while i<=1000:
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        exit()
    i+=1
print(-1)

Submission status: Accepted

Solution code:
from sys import stdin
import math

if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    A, B = list(map(int,_in[0].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    if B/0.1<A/0.08:
        cnt = -1 if (B+1)/0.1<=A/0.08 else math.ceil(A/0.08)
    else:
        cnt = -1 if (A+1)/0.08<=B/0.1 else math.ceil(B/0.1)
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
import sys

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

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

if __name__ ==  '__main__':
    main()

Submission status: Accepted

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

for i in range(b*10,(b+1)*10+1,1):
    if i == (b+1)*10:
        print(-1)
        break
    elif a*12.5 <= i and i < (a+1)*12.5:
        print(i)
        break

Submission status: Accepted

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

for bb in range(b*10,(b+1)*10+1,1):
  if bb == (b+1)*10:
    print(-1)
    break
  elif a*12.5 <= bb and bb < (a+1)*12.5:
    print(bb)
    break

Submission status: Accepted

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

if b[0]%2==0:
  for i in range(13):
    taxa = int(b[0]*12.5+i)
    for j in range(10):
      taxb = b[1]*10+j
      if taxa == taxb:
        break
    if taxa == taxb:
        break
else:
  for i in range(12):
    taxa = int(b[0]*12.5)+i+1
    for j in range(10):
      taxb = b[1]*10+j
      if taxa == taxb:
        break
    if taxa == taxb:
        break
if taxa == taxb:        
  print(taxa)
else :
  print("-1")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
cand_b=[b*10 + i for i in range(10*b)]
def ans(cand):
  for price in cand:
    if int(price*0.08)==a and int(price*0.1)==b:
      print(price)
      return
  print(-1)

ans(cand_b)

Submission status: Accepted

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

start = b * 10
flg = True
for i in range(10):
  tmp = start + i
  if int(tmp*0.08) == a:
    flg = False
    break
if flg:
  print('-1')
else:
  print(int(tmp))

Submission status: Accepted

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

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

if flag==0:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B =  map(int,input().split())
def tax(A,B):
    for i in range(1,1252):
        if int(0.08*i)==A and int(0.1*i)==B:
            return i
        elif i==1251:
            return -1
print(tax(A,B))

Submission status: Accepted

Solution code:

url = "https://atcoder.jp//contests/abc158/tasks/abc158_c"

def main():
    A, B = list(map(int, input().split()))
    ans = -1
    for i in range(1000, 0, -1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            ans = i
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
nuki=[]
for i in range(1001):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        nuki+=[i]

print(min(nuki) if len(nuki)!=0 else -1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
minprice = 1010
for i in range(1, 1010): #B<=100よりmax1009円+1
    if int(i*0.08)==A and int(i*0.10)==B:
        minprice = min(minprice,i)
        ans = 1
print(minprice if ans == 1 else -1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split(' '))
imin, imax = b*10, b*10+10
i = imin
while i < imax:
    if int(i*0.08) == a:
        print(i)
        break
    i += 1
if i == imax:
    print('-1')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4


def main():
    mod = 1000000007                  # 10^9+7
    inf = float('inf')
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    a, b = mi()
    a_s = math.ceil(a * 100 / 8)
    a_t = (a+1) * 100 / 8
    if a_t % 1 == 0:
        a_t = int(a_t) - 1
    else:
        a_t = int(a_t)
    for i in range(a_s, a_t + 1):
        if b * 10 <= i < (b+1) * 10:
            print(i)
            exit()
    print(-1)



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
for i in range(b*20):
    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
ans=0
a,b=map(int,input().split())
for i in range(b*20):
    ans1=i*0.08
    ans2=i*0.1
    if math.floor(ans1)==a and math.floor(ans2)==b:
        ans=i
        break
    else:
        ans=-1
print(ans)

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:
    a, b = b, a

for i in range(a, b+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:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    a,b = readInts()
    for i in range(1,1001):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)
        if a_ == a and b_ == b:
            print(i)
            exit()
    print(-1)
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
# coding: utf-8
A,B = list(map(int, input().split()))

def lr(A, tax):
    if (100 * A) % tax == 0:
        x1_l = 100 * A // tax
    else:
        x1_l = 100 * A // tax + 1
    if (100 * A + 100) % tax == 0:
        x1_r = (100 * A + 100) // tax - 1
    else:
        x1_r = (100 * A + 100) // tax
    return list(range(x1_l, x1_r+1))

list8=lr(A,8)
list10=lr(B,10)
ret = []
for val in list8:
    if val in list10:
        ret.append(val)
if len(ret)==0:
    print(-1)
else:
    print(min(ret))

Submission status: Accepted

Solution code:
from collections import deque, Counter as cnt
from collections import defaultdict as dd
from operator import itemgetter as ig
from bisect import bisect_right as bsr
from math import factorial, ceil, floor
import sys
sys.setrecursionlimit(1000000)

# お約束
args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def nlist(n, v):
    if not n:
        return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def yesno(v):
    print(["Yes", "No"][not v])


# エントリーポイント
def main():
    A, B = input([int, 2])

    for n in range(0, 1100):
        if floor(n * 0.08) == A and floor(n * 0.10) == B:
            print(n)
            break
    else:
        print(-1)


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

Submission status: Accepted

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

for x in range(1, 10**5):
    if floor(x*0.08) == a and floor(x*0.1) == b:
        print(x)
        exit()
print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
aa=-(-a*25//2)
aaa=-(-(a+1)*25//2)-1
bb=b*10
bbb=(b+1)*10-1
if aaa<bb or bbb<aa:
  print(-1)
elif aa<bb:
  print(bb)
else:
  print(aa)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

def shouhi(n,a,b):
    if (int(n * 1.08) -n == a) & (int(n * 1.1) -n== b):
        return True
    return False
ou = False
for n in range(int(a / 0.08), int(a / 0.08) + 13):
    if shouhi(n,a,b):
        print(n)
        ou = True
        break
if not ou:
    print(-1)

Submission status: Accepted

Solution code:
import math
A,B = (int(x) for x in input().split())
minA = math.ceil(A/0.08)
minB = math.ceil(B/0.1)
if minA > minB:
  if math.floor(minA*0.08) == A and math.floor(minA*0.1) == B:
    print(minA)
  else:
    print(-1)
else:
  if math.floor(minB*0.08) == A and math.floor(minB*0.1) == B:
    print(minB)
  else:
    print(-1)