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 k in range(1,1010):
  if (int(k * 0.08) == A) & (int(k * 0.10) == B):
    print(k)
    exit()
print(-1)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ak = []
bk = []
for k in range(-int((-A/0.08)//1),-int(-(A/0.08+12.5)//1)):
  ak.append(k)
for k in range(-int((-B/0.10)//1),-int(-(B/0.10+10.0)//1)):
  bk.append(k)
ans = min(set(ak) & set(bk)) if len(set(ak) & set(bk)) > 0 else -1
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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

flag=0
for i in range(1,1001):
  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:
import math
a, b = map(int, input().split())

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

print(-1)

Submission status: Accepted

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


def solve(A: int, B: int):
    
    kmina = math.ceil((A)/0.08)
    kmaxa = (A + 1)/0.08
    
    kminb = math.ceil((B)/0.10)
    kmaxb = (B + 1)/0.10
    
    if (kmina <= kminb) and (kminb < kmaxa):
        print(kminb)    
    elif (kminb <= kmina) and (kmina < kmaxb):
        print(kmina)
    else:
        print(-1)
    return


# 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
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
price = 1200
for i in range(1200):
  if int(i * (0.08)) == A and int(i * (0.10)) == B :
    if i < price:
      price = i
if price == 1200:
  print("-1")
else:
  print(price)

Submission status: Accepted

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

def main():
    A, B = map(int, open(0).read().split())
    L = min(A//(0.08), B//(0.10))
    U = max((A + 1)//(0.08), (B + 1)//(0.10))

    flag = False
    for i in range(int(L), int(U) + 1):
        if (math.floor(i * 0.08) == A) and (math.floor(i * 0.10) == B):
            print(i)
            flag = True
            break
    
    if not flag:
        print(-1)


main()

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

Submission status: Accepted

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

max = math.ceil(a*100/8)*math.ceil(b*10)

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

for n in range(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(2000):
    if a <= i * 0.08 < a+1 and b <= i * 0.10 < b+1:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
#import queue
from copy import copy, deepcopy
from operator import itemgetter

import bisect#2分探索
#bisect_left(l,x), bisect(l,x)
from collections import deque 
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
#dequeを使うときはpython3を使う、pypyはダメ
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#q=heapq.heapify(l),heappush(q,a),heappop(q)

def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s): return sorted(range(len(s)), key=lambda k: s[k])

#mod = 10**9+7

#N = int(input())
A, B = map(int, input().split())
#L = [int(input()) for i in range(N)]
#A = list(map(int, input().split()))
#S = [inputl() for i in range(H)]
#q = queue.Queue() #q.put(i) #q.get() 
#q = quseue.LifoQueue() #q.put(i) #q.get() 

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b=copy.deepcopy(a)  #2次元配列はこうコピーする
#w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

#素数リスト
# n = 100
# primes = set(range(2, n+1))
# for i in range(2, int(n**0.5+1)):
#     primes.difference_update(range(i*2, n+1, i))
# primes=list(primes)

#bisect.bisect_left(a, 4)#aはソート済みである必要あり。aの中から4未満の位置を返す。rightだと以下
#bisect.insort_left(a, 4)#挿入

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

print(-1)

Submission status: Accepted

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

tax_8 = 0.08
tax_10 = 0.1

li = [99999999999]
for i in range(1,1010):
    temp = math.floor(i *tax_8)
    temp2 = math.floor(i*tax_10)
    if temp == a and temp2 == b:
        li.append(i)
li.sort()
if li[0] == 99999999999:
    print("-1")
else:
    print(li[0])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
 
t8,t10=map(int,input().split(" "))
 
mint8=t8/0.08
maxt8=(t8+1)/0.08
mint10=t10/0.1
maxt10=(t10+1)/0.1
 
ans=list(set(range(math.ceil(mint8),int(maxt8))) & set(range(math.ceil(mint10),int(maxt10))))
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 ** 3 + 1):
  if int(i * 0.08) == A and int(i * 0.1) == B:
    ans = i
    break
    
print(ans)

Submission status: Accepted

Solution code:
#158.C
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)
        break
else:
    print(-1)

Submission status: Accepted

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

import math

a,b=map(int,input().split())
na=[i for i in range(math.ceil(a*12.5),math.ceil((a+1)*12.5-1)+1)]
nb=[i for i in range(b*10,(b+1)*10)]

ans=set(na)&set(nb)

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(2000):
    if (int(i * 0.08) == A) & (int(i * 0.10) == B):
        ans = i
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b,=map(int, input().split())
aTax = math.ceil(a / 0.08)
bTax = math.ceil(b / 0.10)
if 0 <= aTax - bTax < 10:
    print(aTax)
elif aTax < bTax and math.floor(bTax * 0.08) == a:
    print(bTax)
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B = (int(x) for x in input().split())
    ans = -1
    for i in range(1001):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            ans = i
            break

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

list1 = []
list2 = []

border1 = math.ceil(A/0.08)
border2 = math.ceil((A+1)/0.08-1)
border3 = math.ceil(B/0.1)
border4 = math.ceil((B+1)/0.1-1)

for i in range(border1,border2+1,1):
    list1.append(i)
for j in range(border3,border4+1,1):
    list2.append(j)
    
list3 = list(set(list1) & set(list2))

if bool(list3)==True:
    print(min(list3))
else:
    print('-1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import *
A,B=list(map(int, input().split()))
x=ceil(max(A/0.08,B/0.1))
y=min((A+1)/0.08,(B+1)/0.1)
if x<y:
    print(x)
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

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

for i in range(1,1251):
	tax_a = math.floor(i * 0.08)
	tax_b = math.floor(i * 0.1)
	if tax_a == a and tax_b == 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*2/25) == a and int(i/10) == b:
    print(i)
    exit()
print('-1')

Submission status: Accepted

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

for i in range(10):
    num = 10*b + i

    if a <= num*0.08 < a+1:
        ans = num
        break

print(ans)

Submission status: Accepted

Solution code:
from math import ceil

A, B = map(int, input().split())
# minS = [int(A*(100/8)), int(B*(100/10))]
# maxS = [ceil((A+1)*(100/8)), ceil((B+1)*(100/10))]
# if maxS[1] <= minS[0] or maxS[0] <= minS[1]:
#     print(-1)
# else:
#     print(max(minS))
# print(minS, maxS)
for i in range(max(int(A*(100/8)), int(B*(100/10))), 10000):
    if int(i*8/100) == A and int(i*10/100) == B:
        print(i)
        break
    elif int(i*8/100) > A or int(i*10/100) > B:
        print(-1)
        break
# print(max(int(A*(100/8)), int(B*(100/10))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=[]
d=[]
if a % 2 == 0:
    s = int(100*a/8)
    t = int(100*(a+1)/8) + 1
else:
    s = int(100*a/8) + 1
    t = int(100*(a+1)/8) 
u = int(10*b) 
v = int(10*(b+1)) 
for i in range(s,t):
    c.append(i)
for j in range(u,v):
    d.append(j)
c_d = set(c) & set(d)
if (len(c_d)>0):
    print(min(c_d))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a,b=map(int, input().split())
a_min = math.ceil(a/0.08)
a_max = math.ceil((a+1)/0.08)-1
b_min = math.ceil(b/0.1)
b_max = math.ceil((b+1)/0.1)-1

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

Submission status: Accepted

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


a1 = a/0.08
a2 = (a+1)/0.08
b1 = b/0.1
b2 = (b+1)/0.1
c = 0

for i in range(1001):
    if a1<= i <a2 and b1<= i <b2:
        print(i)
        c = 1
        break
        
if c==0:
    print('-1')

Submission status: Accepted

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

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

print(-1)



"""
while True:
    if (c*0.080)//1 == a:
        print(int(c))
        exit()
    elif (c*0.080)//1 >= a or (c*0.1)//1 != b:
        print(-1)
        exit()
    else:
        c += 1.0
"""

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
C = 0
for i in range(1001):
  if A1 <= i < A2 and B1 <= i < B2:
    print(i)
    C = 1
    break
if C == 0:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
il = input().split()
A = int(il[0])
B = int(il[1])

flag = -1

for i in range(10, 1000+1):
    if(math.floor(i * 0.08) == A and math.floor(i * 0.1) == B):
        flag = i
        break
print(flag)

Submission status: Accepted

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

# check
ans = -1
for n in range(1000, -1, -1):
    if int(n * 0.08) == A and int(n * 0.1) == B:
        ans = n

print(ans)

Submission status: Accepted

Solution code:
import math

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

tax_a = 0.08
tax_b = 0.1

start_price = math.ceil(A / tax_a)
stop_price = math.ceil((A+1) / tax_a)

for i_price in range(start_price, stop_price):
    if math.floor(i_price * tax_b) == B:
        ans = i_price
        break
else:
    ans = -1

print(ans)

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
a1=-(-a//0.08)
a+=1
a2=-(-a//0.08)-1
b1=b*10
b+=1
b2=b*10-1
if b1<=a2<=b2:
    print(int(b1))
elif a1<=b2<=a2:
    print(int(a1))
else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for i in range(20000):
    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())
i = 1
while True:
  if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
    print(i)
    break
  if math.floor(i*0.08) > a or math.floor(i*0.1) > b:
    print(-1)
    break
  i += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Str = input().split()
A = int(Str[0])
B = int(Str[1])
import math 
amin = math.ceil(A/0.08)
amax = (A+1)/0.08
if amax == math.floor(amax):
  amax= amax-1
else:
  amax = math.floor(amax)

i = amin
ans = -1
while i <= amax:
  if int(i*0.1) == B:
    ans = i
    break
  i+=1

print(ans)

Submission status: Accepted

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

ans=-1

for i in range(1,1002):
  if math.floor(i*0.10)==b and math.floor(i*0.08)==a:
    ans=i
    break
  else:
    continue
    
print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if a/0.08 == a//0.08:
    emin = a//0.08
else:
    emin = a//0.08+1
if (a+1)/0.08 == (a+1)//0.08:
    emax = (a+1)//0.08-1
else:
    emax = (a+1)//0.08
tmin = b/0.1
tmax = (b+1)/0.1-1
if tmax >= emax:
    if tmin <= emax:
        print(int(tmin))
    else:
        print(-1)
else:
    if emin <= tmax:
        print(int(emin))
    else:
        print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
n = 1
while n <= 1000:
  if a <= n*0.08 < a+1 and b <= n*0.1 < b +1:
    print(n)
    break
  n += 1
  if n == 1001:
    print(-1)
    break

Submission status: Accepted

Solution code:
import sys
a, b = map(int, sys.stdin.readline().split())
i = 0
res = -1
while i <= 1000:
  if int(i*0.08) == a and int(i*0.1) == b:
    res = i
    break
  i += 1
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=math.floor,math.ceil
from collections import deque
Yes=lambda b:print('Yes')if b else print('No');YES=lambda b:print('YES')if b else print('NO')
is_even=lambda x:True if x%2==0 else False

def main():
  a,b=ints()
  A = {n for n in range(int(ceil(a/0.08)),int(ceil((a+1)/0.08)))}
  B = {n for n in range(int(ceil(b/0.1)),int(ceil((b+1)/0.1)))}
  print(min(A&B)) if len(A&B)!=0 else print(-1)
    
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
I = 1009
a,b = map(int,input().split());flag=0
for i in range(1,I):
    x = (i*8)//100;y=(i*10)//100
    if(x==a and y==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, 100000):
    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())
X = B * 10
for i in range(X,X+10):
  if int(i * 0.08) == A:
    print(i)
    exit()
print('-1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    A, B = map(int, input().split())
    ans = 10001
    for x in range(1, 10001):
        if 0 <= 8*x - 100*A < 100 and 0 <= 10*x - 100*B < 100:
            ans = min(ans, x)
    if ans == 10001:ans = -1
    print(ans)
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
# input処理を高速化する
input = sys.stdin.readline

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

Moneys = range(1,1001)

#消費税が入力と一致したインデックス
a_index=set()
b_index=set()

for i in Moneys:
    if math.floor(i*0.08) == A:
        a_index.add(i)

for j in Moneys:
    if math.floor(j*0.1) == B:
        b_index.add(j)

Tax = a_index&b_index

if len(Tax)!=0:
    print(min(list(Tax)))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
x = []
y = []
for i in range(math.ceil(b/0.1), math.floor((b+1)/0.1)):
    y.append(i)
for i in range(math.ceil(a/0.08), math.floor((a+1)/0.08)):
    x.append(i)
    if y.count(i) == 1:
        print(i)
        exit()
print('-1')

Submission status: Accepted

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

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

if not found:
    print(-1)

Submission status: Accepted

Solution code:
import sys

a,b = (int(n) for n in input().split())

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

print("-1")

Submission status: Accepted

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

from math import ceil

a1 = ceil(a / 0.08)
a2 = ceil((a+1) / 0.08)
b1 = ceil(b / 0.1)
b2 = ceil((b+1) / 0.1)

m = min([a1,b1])

if m == a1:
    if b1 in range(a1,a2):
        ans = b1
        print(ans)
    else:
        print('-1')

else:
    if a1 in range(b1,b2):
        ans = a1
        print(ans)
    else:
        print('-1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

if math.ceil(A / 0.08) < math.ceil(B / 0.1):
  start_plice = math.ceil(A / 0.08)
  
  while True:
    if math.floor(start_plice * 0.08) > A:
      print(-1)
      break

    if math.floor(start_plice * 0.1) >= B:
      print(start_plice)
      break

    start_plice += 1
    
else:
  start_plice = math.ceil(B / 0.1)
  
  while True:
    if math.floor(start_plice * 0.1) > B:
      print(-1)
      break

    if math.floor(start_plice * 0.08) >= A:
      print(start_plice)
      break

    start_plice += 1

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
import math
ans = -1
X = 1
while X <= 1000 :
    if (math.floor(X*0.08)==A) & (math.floor(X*0.1)==B) :
        ans = X
        break
    X += 1
    
print(ans)

Submission status: Accepted

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

c = int(b * 10)

for i in range(c-20, c+20):
    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 = []
for i in range(1010): 
    ans8 = math.floor(i * 0.08)
    ans10 = math.floor(i * 0.1)
    if ans8 == A and ans10 == B:
        ans.append(i)
 
if len(ans) != 0:
    print(min(ans))
else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
 
 
def f(A, B):
    for i in range(1, 1010):
        if i//10 == B and (i*2)//25 == A:
            print(i)
            return
    print(-1)
    return
 
 
f(A, B)

Submission status: Accepted

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

Submission status: Accepted

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

ans = -1
for i in range(1251):
    atax = int(i*0.08)
    btax = int(i*0.1)
    if atax == a and btax == b:
        ans = 0
        break
if ans == 0:
    print(i)
else:
    print(ans)

Submission status: Accepted

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


def f(A, B):
    for i in range(1, 1010):
        if i//10 == B and (i*2)//25 == A:
            print(i)
            return
    print(-1)
    return


f(A, B)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    a, b = map(int, rl().split())
    for p in range(1, 10001):
        if int(p * 0.08) == a and int(p * 0.1) == b:
            print(p)
            exit()
    print(-1)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

for i in range(1100):
    if i * 0.08 // 1 == A and i * 0.1 // 1 == B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
for i in range(10100):
  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())
if A%2==0:
  X=int(A/0.08)
else:
  X=int(A/0.08)+1
Y=int(B/0.10)
if (A+1)%2==0:
  P=int((A+1)/0.08)
else:
  P=int((A+1)/0.08)+1
Q=int((B+1)/0.10)
if X<Y:
  if Y<P:
    print(Y)
  else:
    print(-1)
else:
  if X<Q:
    print(X)
  else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
ans = []
for i in range(1010): #math.ceil(1009*0.1)=100
    p8 = math.floor(i * 0.08)
    p10 = math.floor(i * 0.1)
    if p8 == a and p10 == b:
        ans.append(i)

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

Submission status: Accepted

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

#print(ans)
if len(ans)==1:
    print(-1)
else:
    ans.remove(-1)
    print(min(ans))

Submission status: Accepted

Solution code:
def main():
    import sys
    import math
    A,B=map(int,input().split())
    A1=math.ceil(A/0.08)
    A2=(A+1)//0.08
    for i in range(int(A1),int(A2)):
        if i//10==B:
            print(i)
            sys.exit()

    print(-1)    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
import math
q = 0
for i in range(math.ceil(12.5*A),int(12.5*(A+1))):
    if 10*B <= i < 10*(B+1):
        q = i
        break
if q != 0:
    print(i)
else:
    print(-1)

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math

A, B = list(map(int, stdin.readline().rstrip().split()))

#x * 8 / 100 = A
#x * 10 / 100 = B

#xA = A * 100 / 8
#xB = B * 100 / 10


def tax(x,ratio):
    return math.floor(x * ratio / 100)


xA = int(A * 100 / 8)
xB = int(B * 100 / 10)

for i in range(max(0, xB-1), xA+10000):
    tax_a = tax(i, 8)
    tax_b = tax(i, 10)

    if tax_a == A and tax_b == B:
        print(i)
        sys.exit()

print(-1)

Submission status: Accepted

Solution code:
A,B = map(int,input().split(sep=" "))
i = 0
for i in range(0, 1251,1):
    if i*8//100 == A and i*10//100 == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int,input().split())
e = 10**-7
mi = max(math.ceil(a*12.5),b*10)
ma = min(int(math.ceil((a+1)*12.5)-1),(b+1)*10-1)
if mi > ma:
    print(-1)
else:
    print(mi)

Submission status: Accepted

Solution code:
import sys

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