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:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b = list(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)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
A,B =list(map(int,input().split()))
fr = 0
for i in range(10**6):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        fr += 1
        break
if fr == 0:
    print(-1)

Submission status: Accepted

Solution code:
import math

A,B=map(int, input().split())
Amin=int(math.ceil(A/0.08))
if A%2==0:
    Amax=int(math.floor((A+1)/0.08))
else:
    Amax=int(math.floor((A+1)/0.08)-1)
Bmin=int(math.ceil(B/0.1))
Bmax=int(math.floor((B+1)/0.1)-1)
if Amax<Bmin or Bmax<Amin:
    ans=-1
else:
    ans=max(Amin,Bmin)
print(ans)

Submission status: Accepted

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

#Aから判断される、元値として適切な値は?
Akagen=math.ceil(A*12.5 )
Azyogen=math.ceil((A+1)*12.5-1)
#B
Bkagen=math.ceil(B*10 )
Bzyogen=math.ceil((B+1)*10-1 )

#print("{} {} {} {} ".format(Akagen,Azyogen,Bkagen,Bzyogen))
if Azyogen<Bkagen or Bzyogen<Akagen:
    print("-1")
    exit()
print(Akagen if Akagen>Bkagen else Bkagen)

Submission status: Accepted

Solution code:
import math

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

count = 0

# 消費税が1%でも　A<=B<=100　より 10000を計算すればOK
# 全探索
for n in range(1, 10001, 1):
    # 小数点以下切り捨て計算
    c1 = math.floor(n * 0.08)
    c2 = math.floor(n * 0.10)

    if c1 == a and c2 == b:
        print(n)
        exit()
    else:
        count += 1

# 見つからなかったとき-1出力
if count == 10000:
    print(-1)

Submission status: Accepted

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

last = 2000

for i in range(12,last):
  mA = int(i*0.08)
  mB = int(i*0.10)
  
  if mA==A and mB==B:
    print(i)
    break
  if i==last-1:
    print("-1")

Submission status: Accepted

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

for x in range(1, 1250):
  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())
for i in range(10001):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        break
    if i==10000:
        print(-1)
        break

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
p,q= input().split()
a,b =(int(p), int(q))
a_list = []
b_list = []
import math 
for i in range(int((a+2)/0.08)):
    if a/0.08 <= i and i <(a+1)/0.08:
        a_list.append(i)
for i in range(int((b+2)/0.1)):
    if b/0.1 <= i and i <(b+1)/0.1:
        b_list.append(i)

        
m=len(a_list)-1
for i in range(m):
    if a_list[i] in b_list and i is not m:
        print(a_list[i])
        break
    elif i ==m-1:
        print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# C

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

p = -1

for i in range(1, 10001):
  if int(i*0.08)==A and int(i*0.10)==B:
    p = i
    break
print(p)

Submission status: Accepted

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

n = 2000

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

Submission status: Accepted

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

count = 0

for n in range(10000):
    za = n*0.08
    zb = n*0.1
    count += 1
    if A == math.floor(za) and B == math.floor(zb):
        print(n)
        break


if count == 10000:
    print(-1)

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

# ans * 0.08 = a -> a / 0.08

ans = -1

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

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
c=a//0.08
d=b/0.1
if a%0.08 != 0:
  c += 1

e=(a+1)//0.08
if (a+1)%0.08 == 0:
  e -= 1
  
f=(b+1)/0.1 - 1

if max(c,d) <= min (e,f):
  print(int(max(c,d)))
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Flag = False

price1 = int(A // 0.08) + 1
price2 = int(B // 0.1) + 1

if price1 < price2:
  start = price1
  end = price2
else:
  start = price2
  end = price1

for i in range(start,end+1):
  if int(i * 0.08) == A and int(i *0.1) == B:
    Flag = True
    price = i
    break

if Flag == True:
  print(price)
else:
  print(-1)

Submission status: Accepted

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

if max([100/8*A,10*B])<min([100/8*(A+1),10*(B+1)]):
    print(math.ceil(max([100/8*A,10*B])))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ans = 0
for i in range(10*B + 11,1,-1):
    if A <= i * 0.08 < A+1 and B <= i * 0.1 < B+1:
        ans = i
if ans == False:
    print(-1)
else:
    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:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
A, B=map(int,input().split())
for i in range(10000):
    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 math import floor

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import floor

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

A = a[0]
B = a[1]
x = int(100/8*A)

if A == B:
    while 1:
        if int(x*0.08)== int(x*0.10):
            print(x)
            break
        x+=1
        if x > 10000:
            print('-1')
            break

elif A != B:
    for i in range(x,10001):
        if int(i*8/100) == A and int(i/10) == B:
            print(i)
            break 
        elif int(i*8/100) != A and int(i/10) != B and i == 10000:
            print('-1')
            break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor
a,b=map(int,input().split())
for i in range(1010):
  if floor(i*0.08)==a and 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(1300):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        break
    if i==1299:
        print(-1)

Submission status: Accepted

Solution code:
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
 
mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000
 
d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))
 
A, B = LI()
ans = mod
for i in range(1251):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        ans = i
        break
    else:
        pass
else:
    ans = -1
 
print(ans)

Submission status: Accepted

Solution code:
import math
 
A, B = list(map(int, input().split()))
 
a_min = math.ceil(A * 100 / 8)        #'ceil' means rounding up 定価を求める
a_max = math.ceil((A + 1) * 100 / 8)
b_min = math.ceil(B * 100 / 10) #税金からの計算でギリ定価になるような最小の数 を切り上げたもの
b_max = math.ceil((B + 1) * 100 / 10) #整数にするため切り上げる（切り下げでは税金が小さくなる）
 #税金A、A＋１に対する最小の値段を求めることでrangeでa_minから（a_max-1）までの数うを羅列したlist作成
 
set_a = {i for i in range(a_min, a_max)} #the set of numbers whose taxes become A
set_b = {i for i in range(b_min, b_max)}
i = set_a.intersection(set_b)  #the set of intersection of set_a and set_b
if len(i) > 0:   #if the set, i has numbers, print the minimum number 
    print(min(i))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Amin = -(-A*100//8)

Amax = -(-(A+1)*100//8) -1

Bmin = -(-B*100//10)

Bmax = -(-(B+1)*100//10) -1

if Amin > Bmax or Bmin > Amax:
  print(-1)
else:
  print(max(Amin, Bmin))

Submission status: Accepted

Solution code:
import decimal

temp = input().split()

A, B = [int(num) for num in temp]
# print(A, B)

tax_rate_A = decimal.Decimal("0.08")
tax_rate_B = decimal.Decimal("0.10")


def calc_price_list(tax, tax_rate):
    temp = tax / tax_rate
    price_l = temp.to_integral_value(rounding=decimal.ROUND_UP)
    
    temp = (tax + 1) / tax_rate
    price_u = temp.to_integral_value(rounding=decimal.ROUND_UP)

    return list(range(int(price_l), int(price_u)))


price_A_list = calc_price_list(A, tax_rate_A)
# print(price_A_list)
price_B_list = calc_price_list(B, tax_rate_B)
# print(price_B_list)

price_set = set(price_A_list) & set(price_B_list)
# print(price_set)

if len(price_set) == 0:
    print("-1")
else:
    price_list = sorted(list(price_set))
    price = price_list[0]
    print(price)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
num = 0
while num < 1011:
  num += 1
  X = num * 0.08
  if int(X) == A:
    Y = num * 0.1
    if int(Y) == B:
      print(num)
      break
    else:
      pass
  elif num == 1010:
    print(-1)
    break
  else:
    pass

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from math import floor, ceil
a, b = map(int, input().split())
for i in range(2000):
    if b == floor(i * 0.10) and a == floor(i * 0.08):
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import sys


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)
        sys.exit(0)

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

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

print(-1)

Submission status: Accepted

Solution code:
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))

A, B = load_list()

# a1 = int(A * 100 / 8)
# a2 = int((A+1) * 100 / 8)
# b1 = int(B * 100 / 10)
# b2 = int((B+1) * 100 / 10)

# for i in range(b1, b2+1):
#     if i >= a1 and i <= a2:
#         print(i)
#         exit()
# print(-1)

for i in range(B, B+20000):
    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())
answer = -1


for i in range(5000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        answer = i
        break

print(answer)

Submission status: Accepted

Solution code:
import math

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

Min=math.ceil(100*A/8)
Max=math.ceil(100*(A+1)/8)-1
P={i for i in range(Min,Max+1)}

MIN=math.ceil(100*B/10)
MAX=math.ceil(100*(B+1)/10)-1
Q={j for j in range(MIN,MAX+1)}

R=P&Q
if len(R)>=1:
    print(min(R))
else:
    print('-1')

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
sol1 = math.ceil(A/0.08)
sol2 = math.ceil(B/0.10)
ans = lambda x1,x2 : x1 if x1 == x2 else -1
flagA = True
flagB = True
while True:
    if(sol1 * 0.08 < A and flagA):
        flagA = False
        if(math.floor((sol1+1)*0.10) == B):
            print(sol1+1)
            break
    sol1 -= 1
    if(sol2 * 0.10 < B and flagB):
        flagB = False
        if(math.floor((sol2+1)*0.08) == A):
            print(sol2+1)
            break
    if(not flagA and not flagB):
        print(-1)
        break
    sol2 -= 1

Submission status: Accepted

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

Amin=math.ceil(A*100/8)
Amax=(A+1)*100//8
if Amax*8/100 == Amax*8//100:
    Amax-=1

Bmin=B*10
Bmax=(B+1)*10
if Bmax/10 == Bmax//10:
    Bmax-=1

ans=-1
flag=False
for a in range(Amin,Amax+1):
    for b in range(Bmin,Bmax+1):
        if a==b:
            ans=a
            flag=True
            break
    if flag:
        break
print(ans)

Submission status: Accepted

Solution code:
import math

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

tmp = B * 10
for i in range(tmp, tmp + 10):
    if math.floor(i * 0.08) == A:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
ab_list = input().split(" ")
A = int(ab_list[0])
B = int(ab_list[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(1010):
    if A <= i*0.08 < A+1 and B <= i*0.1 < B+1:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

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

ans = x
print(ans)

Submission status: Accepted

Solution code:
import math
A, B = [int(i) for i in input().split()]
cand = set(list(range(math.ceil(A/0.08), math.ceil((A+1)/0.08))))
cand &= set(list(range(math.ceil(B/0.1), math.ceil((B+1)/0.1))))
if(len(cand)==0):
    print(-1)
else:
    print(min(cand))

Submission status: Accepted

Solution code:
import math

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

a_min = math.ceil(A * 100 / 8)
a_max = math.ceil((A + 1) * 100 / 8)
b_min = math.ceil(B * 100 / 10)
b_max = math.ceil((B + 1) * 100 / 10)

set_a = {i for i in range(a_min, a_max)}
set_b = {i for i in range(b_min, b_max)}
i = set_a.intersection(set_b)
if len(i) > 0:
    print(min(i))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
import random
import sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from functools import lru_cache, reduce
from heapq import heapify, heappop, heappush
from itertools import (chain, combinations, combinations_with_replacement,
                       permutations)

MAX_INT = 2**62-1
sys.setrecursionlimit(10**7)

input = sys.stdin.readline


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


def main():
    a, b = read_n_int()
    a1, a2 = a/0.08, (a+1)/0.08
    b1, b2 = b/0.1, (b+1)/0.1

    for i in range(int(a1), int(a2)+1):
        if b1 <= i < b2 and a1 <= i < a2:
            print(i)
            break
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

a,b=n1()

a2=a/0.08
a3=(a+1)/0.08
b2=b/0.1
b3=(b+1)/0.1
for x in range(1,1300):
    if a2<=x<a3 and b2<=x<b3:
        print(x)
        break;
else:
    print(-1)

Submission status: Accepted

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

x1=math.ceil(A/0.08)
x2=math.ceil(B/0.1)
ans=-1
if math.floor(x1*0.08)==A and math.floor(x1*0.10)==B:
	ans=x1
if math.floor(x2*0.08)==A and math.floor(x2*0.10)==B:
	if ans==-1 or x2<ans:
		ans=x2
print(int(ans))

Submission status: Accepted

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

for i in range(1100):
    if i//12.5 == a and i//10 == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

pa = 0 - -a//0.08
pb = b/0.1

ref = max(pa, pb)
refmin = min(pa, pb)

ta = int(ref*0.08)
tb = int(ref*0.1)

flag = 0

for i in range(2000):
    if i == 1999:
        print(-1)
    elif ta != a or tb != b and flag == 0:
        ref -= 1
        ta = int(ref*0.08)
        tb = int(ref*0.1)
        if ta == a and tb == b:
            flag += 1

    elif ta == a and tb == b:
        flag += 1
        ref -= 1
        ta = int(ref*0.08)
        tb = int(ref*0.1)
        if ta != a or tb != b:
            print(int(ref + 1))
            break
    else:
        print(-1)
        break

Submission status: Accepted

Solution code:
import math

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

x = []
for i in range(int(a / 0.08), int((a + 1) / 0.08)):
    if math.floor(i * 0.08)  == a:
        x.append(i)

for i in range(len(x)):
    if x[i] // 10 == b:
        print(x[i])
        break

if i == len(x) - 1:
    print(-1)

Submission status: Accepted

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

flag=0
for i in range(1,1010):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        flag+=1
        break
if flag !=1:
    print('-1')

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	a, b = IN()
	for i in range(1, 30000):
		if int(i * 0.08) == a and int(i * 0.10)==b:
			return i
		
	return -1
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
f=0
for X in range(1,10000):
    if int(X*0.08 )==A and int(X*0.1)==B:
        print(X)
        f+=1
        break
if f!=1:    
    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 i//10 == B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
listb = list(range(b*10, (b+1)*10))

for i in range (0, 10):
	if (listb[i]*0.08)//1 == a:
		print(listb[i])
		exit()

print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

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

print(ans)

Submission status: Accepted

Solution code:
import sys

a, b = map(int, input().split())
for i in range(1, 1010):
    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())
count = 0
bli = []
for i in range(10):
    bli.append(10*b + i)
    if bli[i]//12.5 == a:
        print(bli[i])
        count += 1
        break
if count == 0:
    print("-1")

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
alibli =[]
bli = []
for i in range(10):
    bli.append(10*b + i)
for i in range(10):
    if bli[i]//12.5 == a:
        alibli.append(bli[i])
if alibli != []:
    print(min(alibli))
else:
    print("-1")

Submission status: Accepted

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

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

Solution code:
import math

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

lst = []
for p in range(10, 1010):
  if (math.floor(0.08*p) == A) and (math.floor(0.10*p) == B):
    lst.append(p)

if lst:
  print(min(lst))
else:
  print(-1)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A, B = map(int, input().split())
for i in range(1001):
    if int(i*0.08) == A and int(i*0.10) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
from math import floor

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

	a = int(A / 0.08)
	b = int(B / 0.1)

	if a < b:
		c = a
	else:
		c = b

	for money in range(c, 1009+1):
		m_a = floor(money * 0.08)
		m_b = floor(money * 0.10)
		if m_a == A and m_b == B:
			print(money)
			sys.exit()
	print(-1)

Submission status: Accepted

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

a = 1
answer = 0
while answer == 0:
    if int(a * 0.08) == A and int(a * 0.1) == B:
        answer = a
    elif a == 1010:
        answer = -1
    a = a + 1
print(answer)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
price=10*b
c=[]  
while(price<10*b+10):
  if int(price*0.08)==a:
    c.append(price)
    price=price+1
  else:
    price=price+1
if c==[]:
  print(-1)
else:
  print(min(c))

Submission status: Accepted

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

amin = int(a//0.08)
amax = int((a+1)//0.08)
bmin = int(b//0.1)
bmax = int((b+1)//0.1)

if a%0.08 > 0:
	amin += 1
if (a+1)%0.08 > 0:
	amax -= 1
if b%0.1 > 0:
	bmin += 1
if (b+1)%0.1 > 0:
	bmax -= 1

if amin <= bmin:
	if bmin <= amax:
		print(bmin)
	else:
		print('-1')
else:
	if amin <= bmax:
		print(amin)
	else:
		print('-1')

Submission status: Accepted

Solution code:
A,B=[int(i) for i in 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:
def tax(price, percent):
    return (price * percent) // 100


a, b = map(int, input().split())
for i in range(1251):
    if tax(i, 8) == a and tax(i, 10) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC158C
import sys
a, b = map(int, sys.stdin.readline().split())
#print(a,b)

for num in range(0, 1001):
    A = int(num*0.08)
    B = int(num*0.1)
    #print(A, B, num)
    if a==A and b ==B:
        print(num)
        break
else:
    print(-1)

Submission status: Accepted

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

hati = 0
ten = 0
for i in range(1, 10001):
    hati = i * 8 // 100
    ten = i * 10 // 100
    if hati == a and ten == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(math.ceil((N[0])*(1/0.08)), math.ceil((N[0]+1)*(1/0.08)))]
Y = [i for i in range(math.ceil((N[1])*(1/0.10)), math.ceil((N[1]+1)*(1/0.10)))]
#print(X, Y)
#for i in X:
#  print(math.floor(i*0.08))

cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
flag = False
for x in range(1, 1000+100):
    if A == math.floor(x*0.08) and B == math.floor(x*0.1):
        print(x)
        flag = True
        break
if not flag:
    print(-1)