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=map(int,input().split())
for i in range(100001):
  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
A,B=map(int, input().split())

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

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

print('-1')

Submission status: Accepted

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

for i in range (11000):
  if a <= i*0.08 <a+1:
    if b<= i*0.1 <b+1:
      print(i)
      exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

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

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

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
X1 = int(A // 0.08)
X2 = int( (A+1) // 0.08)
array1 = []
for i in range(X1+1,X2):
  array1 += [i]
Y1 = int(B // 0.1)
Y2 = int( (B+1) // 0.1)
array2 =[]
for j in range(Y1+1,Y2):
  array2 += [j]
N1 = len(array1)
for t in range(N1):
  if array1[t] in array2:
    print(array1[t])
    exit()
print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8


def main():
    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

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor

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

d = False

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

if not d:
    print(-1)

Submission status: Accepted

Solution code:
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

a,b=map(int,input().split())
ans=1
while ans*8//100!=a or ans//10!=b:
    ans+=1
    if ans>2*10**5:
        print(-1)
        exit()
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
answer = -1
for i in range(10101):
  if A <= i*8/100 < A+1:
    if B <= i*10/100 < B+1:
      answer = i
      break
print(answer)

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    ans=-1
    
    A,B=MI()
    for i in range(10000):
        a=int(i*0.08)
        b=int(i*0.1)
        
        if a==A and b==B:
            ans=i
            break
        
    print(ans)


main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

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

print(-1)

Submission status: Accepted

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

#A<= x*0.08 <A+1
#B<= x*0.10 <B+1

x=int(B*10)
while x<10*(B+1):
	if A<=x*0.08 and x*0.08<A+1:
		print(x)
		exit()
	x+=1
print(-1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

    if i == 1009:
        print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
for i in range(10001):
  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())
l = []
for i in range(1, 10000):
  a = i * 0.08
  b = i * 0.1
  if a > A+1 and b > B+1:
    break
  elif A <= a < A+1 and B <= b < B+1:
    l.append(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

  if t8 > a or t10 > b:
    break

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
import math
a,b=map(int,input().split())
x=[]
for i in range(1,1251):
    if math.floor(i*0.08)==a:
        if math.floor(i*0.1)==b:
            x.append(i)
if len(x)==0:
    print(-1)
else:
    print(min(x))

Submission status: Accepted

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

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

Submission status: Accepted

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

for x in range(1100):
  if math.floor(x*0.08) == A and math.floor(x*0.1) == B:
    print(x)
    break
else:
  print('-1')

Submission status: Accepted

Solution code:
import math

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

a1 = (A+1)/0.08
a2 = A/0.08
b1 = (B+1)/0.1
b2 = B/0.1


if a2 >= b1 or b2 >= a1:
    print(-1)
else:
    print(math.ceil((max(a2, b2))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
ans = 10000
for i in range(1010):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
        ans = i
        break

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

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
ans = -1
for a in range(math.ceil(A/0.08), math.ceil((A+1)/0.08)):
    if int(a*0.1) == B:
        ans = a
        break

print(ans)

Submission status: Accepted

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

Xbmin = 10 * B
Xbmax = 10 * B + 10
ans = -1

for x in range(Xbmin, Xbmax):
    if 100 * A <= x * 8 and x * 8 < 100 * (A + 1):
        ans = x
        break
    
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)
        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)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if a*12.5 >= (b+1) *10 or b*10 >= (a+1)*12.5:
  print(-1)
else:
  m = max([a*12.5,b*10])
  M = min([(b+1) *10, (a+1)*12.5])
  i = m//1
  if m == i:
    print(int(i))
  else:
    print(int(i+1))

Submission status: Accepted

Solution code:
[A, B] = [int(i) for i in input().split()]
a = []
b = []
if A%2 == 1:
    s = 0
    t = 1
else:
    s = 1
    t = 0
     
for i in range(int(A*12.5) + t, int((A+1)*12.5) + s):
    a.append(i)
for i in range(10*B, 10*(B+1)):
    b.append(i)

ans = -1
for i in range(len(a)):
    if b[0] <= a[i] and a[i] <= b[-1]:
        ans = a[i]
        break
print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

a,b = na()
ans = -1
for i in range(1, 1001):
    if a == math.floor(i * 0.08) and b == math.floor(i * 0.10):
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import math

def main():
    A, B = map(int, input().split())
    a_min = int(math.ceil(A / 0.08))
    a_max = int(math.floor((A+1) / 0.08)) - 1
    b_min = 10 * B
    b_max = 10 * (B+1) - 1
    if a_max < b_min or b_max < a_min:
        print(-1)
    else:
        print(max([a_min, b_min]))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans1 = 0
ans2 = 0

for i in range(10000):
  ans1 = int(i * 0.08)
  ans2 = int(i * 0.10)
  
  if (ans1) == A and int(ans2) == B:
    print(i)
    exit()
    
print(-1)

Submission status: Accepted

Solution code:
import sys
a, b = map(int,input().split())
lsta = []
lstb = []
if (a%2 == 1):
    lsta.append(int(a*12.5//1 + 1))
else:
    lsta.append(int(a*12.5))
for i in range(12):
    if ((lsta[0] + i + 1)*0.08//1 == a):
        lsta.append(lsta[0] + i + 1)

lstb.append(b*10)
for i in range(9):
    lstb.append(lstb[0] + i + 1)

for i in range(len(lsta)):
    if (lsta[i] in lstb):
        print(lsta[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:
    kakaku = i
    print(kakaku)
    break
    
else:
  print(-1)

Submission status: Accepted

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

for i in range(1001):
    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(10*B,10*(B+1)):
    if A/0.08<=i<(A+1)/0.08:
        print(i)
        x=0
        break
    else:
        x=-1
if x:
    print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
# 8% -> [a,a+1)
# 10% -> [b,b+1)
# max(a*100/8, b*10) <= 元の価格 < min((a+1)*100/8, (b+1)*10)
min8 = a*(100/8)
max8 = (a+1)*(100/8)
min10 = b*10
max10 = (b+1)*10
mi = int(max(min8, min10) - 0.001) + 1
ma = int(min(max8, max10) - 0.001)
if mi > ma:
    ans = -1
else:
    ans = mi
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=b*10
for i in range(c,c+10):
  if int(i*0.08)==a:
    print(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:
a, b = map(int,input().split())
for i in range(1005):
    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())

c = math.ceil
min8, max8 = c(a*12.5), c((a+1)*12.5)
min10, max10 = c(b*10), c((b+1)*10)

l8, l10 = list(range(min8, max8)), list(range(min10, max10))
s8, s10 = set(l8), set(l10)

ss = s8 & s10
#print(min8, max8, min10, max10)
print(min(ss) if len(ss) >0 else -1)
#print(238*0.08)

Submission status: Accepted

Solution code:
def f():
  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)
      return
  print(-1)
f()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Sep  7 10:51:17 2020

@author: liang
"""
A, B = map(int, input().split())

res = B*10

for i in range(10):
    tmp =int((res + i)*0.08)
    if  tmp == A:
        print(res+i)
        break
else:
    print(-1)

Submission status: Accepted

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

A=math.ceil(a*12.5)
B=math.ceil(b*10)

x=math.floor(B*0.08)
y=math.floor(A*0.1)

if x==a and y==b :
    if A>B :
        print(B)
    else :
        print(A)

elif x==a :
    print(B)
elif y==b :
    print(A)
else :
    print(-1)

Submission status: Accepted

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

for n in range(1,1200):
  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())
flag = 0
for i in range(2000):
    if (i*0.08)//1 == a:
        if (i*0.1)//1 == b:
            print(i)
            flag += 1
            break

else:
    if flag == 0:
        print("-1")

Submission status: Accepted

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

ans = -1

for i in range(10000):
    if int((i/100)*8) == A and int((i/100)*10) == B:
        ans = i
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

AA = A * 100 / 8
BB = B * 100 / 10

L = []
for i in range(10000):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        L.append(i)
    
L = sorted(L)
if L == []:
    print(-1)
    exit()

print(L[0])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = [int(x) for x in input().split()]
res = -1
for i in range(20000):
  if i * 8 // 100 == a and i * 10 // 100 == b:
    res = i
    break
print(res)

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split(" "))
    for i in range(1,1010):
        ta = i*8//100
        tb = i*10//100
        if ta == a and tb == b:
            print(i)
            return
    print(-1)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

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

def candidate(tax, tax_rate, candidate):
  candidate.append(math.ceil(tax / tax_rate))
  i = candidate[0] + 1
  while tax == math.floor(i * tax_rate):
    candidate.append(i)
    i += 1

candidate(A, 0.08, candidate_a)
candidate(B, 0.1, candidate_b)

if candidate_a[0] <= candidate_b[0]:
  if candidate_a[-1] >= candidate_b[0]:
    print(candidate_b[0])
  else: 
    print(-1)
else:
  if candidate_b[-1] >= candidate_a[0]:
    print(candidate_a[0])
  else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for i in range(1, 12500):
  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,1001):
        if 8*i//100 == a and i//10 == b:
                print(i)
                exit()
print('-1')

Submission status: Accepted

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

for i in range(1, 10**5):
    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())
min1 = math.floor(A * 25/2)
max1 = math.ceil((A + 1) * 25/2)
ans_lis = []
ans1 = False
ans2 = False
for i in range(min1, max1):
  if A == math.floor(i * 2/25):
    ans1 = True
    ans_lis.append(i)
for x in ans_lis:
  if B == math.floor(x * 1/10):
    ans2 = True
    ans = x
    break
if ans1 == True and ans2 == True:
  print(x)
else:
  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.1)==B:
		print(i)
		break
	if i==1000:
		print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

x = a // 0.08
y = b // 0.10
x, y = int(x), int(y)
minv = min(x, y)
maxv = max(x, y)
ans = []

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

for i in range(10**5):
    if (8*i//100) == a and (i//10) == b:
        ans = i
        break
    
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b = mi()

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

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b = mi()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

volume_A = math.floor(A / 0.08)
volume_B = math.floor(B / 0.1)

min_A, max_A = math.inf, -math.inf
range_A = math.floor(1 / 0.08)
min_B, max_B = math.inf, -math.inf
range_B = math.floor(1 / 0.1)
# print(range_A)
# print(range_B)

for i in range(volume_A - range_A, volume_A + range_A):
    if math.floor(i * 0.08) == A:
        min_A = min(min_A, i)
        max_A = max(max_A, i)

for j in range(volume_B - range_B, volume_B + range_B):
    if math.floor(j * 0.1) == B:
        min_B = min(min_B, j)
        max_B = max(max_B, j)

ans_A = set()
for i in range(min_A, max_A + 1):
    ans_A.add(i)
# print(ans_A)

ans_B = set()
for j in range(min_B, max_B + 1):
    ans_B.add(j)
# print(ans_B)

ans = ans_A & ans_B

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  A, B = map(int,input().split())
  i1 = max(A * 12.5, B * 10.0)
  i2 = min((A + 1) * 12.5, (B + 1) * 10.0)
  i = int(i1)
  while i < i2:
    if i >= i1: return i
    i += 1
  return -1

ans = main()
print(ans)

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    A, B = MI()
    x = 10 * B
    for i in range(x, x + 10):
        y = int(i * 8 / 100)
        if y == A:
            print(i)
            exit()
    print(-1)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
r_max=int((b+1)//0.1)
r_min=int(b//0.1)
ans=0
for i in range(r_max,r_min,-1):
    if math.floor(i*0.08)==a:
        ans=i
print(-1 if ans==False else ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import decimal
def input():
    return sys.stdin.readline()[:-1]

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

    for i in range(1, 10 ** 4):
        a = int(decimal.Decimal(i * 0.08))
        b = int(decimal.Decimal(i * 0.1))
        if a == A and b == B:
            print(i)
            exit()
    print(-1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
flg=0
for i in range(1001):
    c=int(i*1.08)-i
    d=int(i*1.1)-i
    if c==a and b==d:
        print(i)
        flg=1
        exit()
if flg==0:
    print(-1)

Submission status: Accepted

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
x=10
y=int(x*8/100)
z=int(x*10/100)
i=0
while x<10000:
  if int(x*8/100)==a and int(x*10/100)==b:
    print(x)
    break
  else:
    x=x+1
if x==10000:
  print("-1")

Submission status: Accepted

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

bb = b * 10

ans = -1
for i in range(bb, bb+10):
    if i*8//100==a:
        ans=i
        break

print(ans)

Submission status: Accepted

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

import math
price=[]
for i in range(10100):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
         price.append(i)
if len(price)==0:
    print(-1)
else:
    print(sorted(price)[0])

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
 
# floor(1009*0.1)=100 かつ floor(1010*0.1)=101 より、1から1009までの数字を調べればよい
ans = '-1'
for i in range(1010):
  if i*8 // 100 == A and i // 10 == B:
    ans = i
    break

print(ans)

Submission status: Accepted

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

# floor(1009*0.1)=100 かつ floor(1010*0.1)=101 より、1から1009までの数字を調べればよい
ans = '-1'
for i in range(1010)[::-1]:
  if i*8 // 100 == A and i // 10 == B:
    ans = i

print(ans)

Submission status: Accepted

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


XstartA = A / 0.08
XendA = (A + 1) / 0.08

XstartB = B / 0.1
XendB = (B + 1) / 0.1

start = XstartA
if XstartA < XstartB:
    start = XstartB

end = XendA
if XendB < XendA:
    end = XendB

S = int(start)
E = int(end) + 1

ans = -1
for i in range(S, E + 1):
    if start <= i and i < end:
        ans = i
        break

print(ans)

Submission status: Accepted

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

ans = '-1'
for i in range(1001)[::-1]:
  if i*8 // 100 == A and i // 10 == B:
    ans = i

print(ans)

Submission status: Accepted

Solution code:
import math

def solve():
    A, B = [int(i) for i in input().split()]
    a = A / 0.08
    b = B / 0.1
    mi = min(a, b)
    ma = max(a, b)
    for i in range(math.floor(mi), math.ceil(ma) + 1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            print(i)
            exit()
    print(-1)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

st=.08
lt=.1
s=[]
l=[]

for i in range(1262):
    if a/st<=i<(a+1)/st:
        s.append(i)

for i in range(1262):
    if b/lt<=i<(b+1)/lt:
        l.append(i)

t=[]

for i in s:
    if i in l:
        t.append(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

q=[]
for i in range(1,20000):
    if a==floor(i*0.08) and b==floor(i*0.1):
        q.append(i)

if q:
    print(min(q))
else:
    print(ans)

Submission status: Accepted

Solution code:
##############################################
import sys
A, B = list(map(int, input().split()))
for i in range(1,1009+1):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        sys.exit(0)

print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
a1 = a/0.08
a2 = (a+1)/0.08

b1 = b/0.1
b2 = (b+1)/0.1


if a1.is_integer():
  x1 = a1
else:
  x1 = a1 + 1
if a2.is_integer():
  x2 = a2
else:
  x2 = a2 + 1
if b1.is_integer():
  y1 = b1
else:
  y1 = b1 + 1
if b2.is_integer():
  y2 = b2
else:
  y2 = b2 + 1
  
s1 = set([i for i in range(int(x1), int(x2))])
s2 = set([i for i in range(int(y1), int(y2))])
s = s1 & s2
if len(s) == 0:
  print(-1)
else:
  print(min(s1 & s2))

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
A_min = A / 0.08
A_max = (A + 1) / 0.08
B_min = B / 0.1
B_max = (B + 1) / 0.1

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())
for i in range(10**3 + 1):
    if (i*8)//100 == a and (i*10)//100 == b:
        print(i)
        exit()
print(-1)