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 .

Solution (Python):
a,b = map(int,input().split())
dic1 = [0 for _ in range(10**3+1)]
dic2 = [0 for _ in range(10**3+1)]

for i in range(1,10**3+1):
    tax = i * 0.08
    tax2 = i * 0.1
    dic1[i] = int(tax)
    dic2[i] = int(tax2)

for i in range(10**3+1):
    if dic1[i] == a and dic2[i] == b:
        print(i)
        exit()
print(-1)

Solution (Python):
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)

Solution (Python):
A,B=map(int,input().split())
flag = True
res = 0
for i in range(2000):
  n8 = int(i * 0.08)
  n10 = int(i* 0.1)
  if n8 == A and n10 == B:
    flag = False
    res = i
    break
  elif n10 == A and n8 == B:
    flag=False
    res = i
    break
  else:
    pass
if flag:
  print(-1)
else:
  print(res)

Solution (Python):

a,b = map(int,input().split())
import math
c=10000
for i in range(1200):
    if math.floor(i*0.08)==a and math.floor(i*0.10)==b:
        c = min(c,i)
if c==10000:
    print(-1)
    exit()
print(c)

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

for i in range(1,10000):
    aa = ( i * 8 ) // 100
    bb = ( i * 10 ) // 100
    if aa == a and bb == b:
        print(i)
        exit()
print("-1")

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

S = B * 10
ans = -1

while S < (B+1) * 10:
    if int(S*0.08) == A:
        if ans != -1:
            ans = min(ans, S)
        else:
            ans = S
    S += 1

print(ans)

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

ans = -1

for i in range(13, 1001):
  if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B :
    ans = i
    break

print(ans)

Solution (Python):
def readinput():
    a,b=map(int,input().split())
    return a,b

def main(a,b):
    for i in range(20000):
        if i*108//100 - i ==a and i*110//100 - i ==b:
            return i
    return -1

if __name__=='__main__':
    a,b=readinput()
    ans=main(a,b)
    print(ans)

Solution (Python):


from math import ceil

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

a = [i for i in range(ceil(A*100/8), int((A+1)*100/8))]
b = [i for i in range(B*10, (B+1)*10)]

ans = list(set(a) & set(b))
if ans:
  print(min(ans))
else:
  print(-1)

Solution (Python):
def tax_increase():
    """
    消費税率 8% → 消費税 A円
    消費税率 10% → 消費税 B円
    商品価格 X = A / 0.08  → 25A / 2
        　　 X = B / 0.1   → 10B
    消費税は切り捨てなので、消費税の範囲は
    A <= X < A+1
    """
    
    A, B = map(int, input().split())
    
    tax_excluded_price_list1 = list()
    tax_excluded_price_list2 = list()
    
    tax_excluded_price_low1 = 25 * A / 2 
    tax_excluded_price_low2 = int(tax_excluded_price_low1) 
    tax_excluded_price_high1 = 25 * (A+1) / 2 
    tax_excluded_price_high2 = int(tax_excluded_price_high1) 
    
    for i in range(tax_excluded_price_low2, tax_excluded_price_high2+1):
        if tax_excluded_price_low1 <= i and i < tax_excluded_price_high1:
            tax_excluded_price_list1.append(i)
    
    tax_excluded_price_low1 = 10 * B 
    tax_excluded_price_low2 = int(tax_excluded_price_low1) 
    tax_excluded_price_high1 = 10 * (B+1) 
    tax_excluded_price_high2 = int(tax_excluded_price_high1) 
    
    for i in range(tax_excluded_price_low2, tax_excluded_price_high2+1):
        if tax_excluded_price_low1 <= i and i < tax_excluded_price_high1:
            tax_excluded_price_list2.append(i)
    
    for i in tax_excluded_price_list1:
        if i in tax_excluded_price_list2:
            return i
    
    return '-1'
    
result = tax_increase()
print(result)

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

a = [i for i in range(int((A-1)*100/8 ), int((A+1)*100/8 ))]
b = [i for i in range(int((B-1)*100/10), int((B+1)*100/10))]

a = [i for i in a if int(i*0.08) == A]
b = [i for i in b if int(i*0.10) == B]

ans = list(set(a) & set(b))
if ans and min(ans) > 0:
    print(min(ans))
else:
    print(-1)

Solution (Python):
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7

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

big = 100000
ans = big + 1
for i in range(big, 0, -1):
    if int(i*0.08) == a and int(i*0.1) == b:
        ans = i
    
if ans <= big:
    print(ans) 
else:
    print(-1)

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

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

cand = [i for i in range(1, 1001)]
res = []
flg = False
for i in cand:
  if int(i * 0.08) == A and int(i * 0.10) == B:
    res.append(i)
    flg = True

if flg:
  print(res[0])
else:
  print(-1)

Solution (Python):
A,B=map(int,input().split())
for i in range(1,1010):
  if (i*100*0.08)//100==A and (i*100*0.1)//100==B:
    print(i)
    break
else:
  print(-1)

Solution (Python):
a, b = map(int,input().split())
a_list = []
b_list = []
flag = 0

for i in range(1,1009):
    if int(i*1.08)-i == a:
        a_list.append(i)

for j in a_list:
    if int(j*1.1)-j == b:
        print(j)
        flag = 1
        break

if flag != 1:
    print('-1')

Solution (Python):


from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(A: int, B: int):
    for i in range(1000 + 1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            return i
    return -1


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    print(f'{solve(A, B)}')


if __name__ == '__main__':
    main()

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

ans = -1
for i in range(1, 1251):
    if i * 8 // 100 == A and i * 10 // 100 == B:
        ans = i
        break
print(ans)

Solution (Python):
import math
import sys

A, B = list(map(int, input().split()))
for i in range(1001):
  priceA = math.floor(i*1.08)
  priceB = math.floor(i*1.10)
  taxA = priceA - i 
  taxB = priceB - i 
  if taxA == A and taxB == B:
    print(i)
    sys.exit()
print("-1")

Solution (Python):
import math
A, B = map(int, input().split())
answer = -1
for x in range(10000):
    if math.floor(x * 0.08) == A and math.floor(x * 0.10) == B:
        answer = x
        break
print(answer)

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

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

Solution (Python):




















































global FLAG_LOG
FLAG_LOG = False


def log(value):
    
    
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    
    
    A, B = list(map(int, lines[0].split()))
    
    
    
    
    
    
    
    

    for n in range(1020):
        a = int(n * 0.08)
        b = int(n * 0.1)
        if a == A and b == B:
            return [n]

    return [-1]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2 2']
        lines_export = [25]
    if pattern == 2:
        lines_input = ['8 10']
        lines_export = [100]
    if pattern == 3:
        lines_input = ['19 99']
        lines_export = [-1]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):
def resolve():
    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")
resolve()

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

if int(a / 0.08 * 0.1) == b:
    print(round(a / 0.08 + 0.0001))
elif int(b / 0.1 * 0.08) == a:
    print(round(b / 0.1 + 0.0001))
else:
    print(-1)

Solution (Python):
A,B=map(int,input().split())
for money in range(1,1001):
    if int(money*0.08)==A and int(money*0.1)==B:
        print(money)
        break
else:
    print(-1)

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

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

N = 1000
p1 = 0.08
p2 = 0.1

for i in range(1, N + 1):
    if int(i * p1) == A and int(i * p2) == B:
        print(i)
        exit()

print("-1")

Solution (Python):
from sys import stdin
input = stdin.readline


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

  for i in range(10000):
    if int(i * 0.08) == A and \
       int(i * 0.10) == B:

      print(i)
      return
  print(-1)


if(__name__ == '__main__'):
  main()

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

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

print(-1)

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

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

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

Solution (Python):
from sys import stdin
import sys
import math
from functools import reduce

a,b = [int(x) for x in stdin.readline().rstrip().split()]

c = int(b*10)

for i in range(10):
    if a == int(c*0.08):
        print(c)
        sys.exit()
    c = c + 1

print(-1)

Solution (Python):


A, B = map(int, input().split())
x = 25 * A // 2

for x in range(B * 10 + 0, B * 10 + 10, 1):
  if round(x * 8 // 100) == A:
    print(x)
    exit()
print('-1')

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

min_ans = int((12.5*A) // 1)
max_ans = int(-((-12.5*(A+1)) // 1))

ans = -1
for i in range(min_ans,max_ans):
  temp_A = (i*0.08)//1
  temp_B = (i*0.1)//1
  if temp_A == A and temp_B == B :
    ans = i
    break
  
print(ans)

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

Solution (Python):
from math import floor


def main():
    a, b = map(int, input().split())
    for yen in range(1, 1100):
        if floor(yen * 0.08) == a and floor(yen * 0.1) == b:
            print(yen)
            return
    print(-1)


if __name__ == '__main__':
    main()

Solution (Python):

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

for i in range(1,10001):
    num1 = int(i*decimal.Decimal("0.08"))
    num2 = int(i*decimal.Decimal("0.1"))
    if num1 == a and num2 == b:
        print(i)
        break
    if int(i*decimal.Decimal("0.08")) > a:
        print("-1")
        break

Solution (Python):
import sys


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


def main():
    input = sys.stdin.buffer.readline
    a, b = map(int, input().split())
    print(solve(a, b))


if __name__ == "__main__":
    main()

Solution (Python):
import math
N,M = map(int,input().split())
n = math.ceil(N/0.08)
m = int(M/0.1)
ans = 2000
if int(n*0.1) ==M:
  ans = min(n,ans)
if int(m*0.08) ==N:
  ans =min(m,ans)
  
if int(n*0.1)!=M and int(m*0.08)!=N:
  ans = -1
  
print(ans)

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

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

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

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

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

Solution (Python):
a,b = map(int,input().split())
q = list()
for i in range(1009):
  if int(i*0.08) == a and int(i*0.1) == b:
    q.append(i)

if len(q) == 0:
  print(-1)
  exit()
print(min(q))

Solution (Python):
a,b=map(int,input().split())
num=1
while 1:
    if int(num*0.08)==a and int(num*0.1)==b:
        print(num)
        break
    if int(num*0.08)>a and int(num*0.1)>b:
        print(-1)
        break
    num+=1

Solution (Python):
A,B=map(int,input().split())
c=[]
d=[]
if int(A*100/8)==A*100/8:
  i=int(A*100/8)
else:
  i=int(A*100/8+1)
while i<(A+1)*100/8:
  c.append(i)
  i+=1
if int(B*100/10)==B*100/10:
  j=int(B*100/10)
else:
  j=int(B*100/10+1)
while j<(B+1)*100/10:
  d.append(j)
  j+=1
if min(c[len(c)-1],d[len(d)-1])<max(c[0],d[0]):
  print(-1)
else:
  print(max(c[0],d[0]))

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

taxfree = 1

while True:
    if int(taxfree*0.08)==a and int(taxfree*0.1)==b:
        break
    taxfree += 1
    if taxfree == 1001:
        taxfree = -1
        break

print(taxfree)

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

print(-1)

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

genka_8_min=a*12.5
genka_8_max=(a+1)*12.5

if not genka_8_min.is_integer():
    genka_8_min=int(genka_8_min+1)

if genka_8_max.is_integer():
    genka_8=list(range(int(genka_8_min),int(genka_8_max)))
else:
    genka_8=list(range(int(genka_8_min),int(genka_8_max)+1))

genka_10_min=b*10
genka_10_max=(b+1)*10
genka_10=list(range(int(genka_10_min),int(genka_10_max)))

ans=set(genka_8)&set(genka_10)

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

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

for x in range(10**3+1):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        exit()

print(-1)

Solution (Python):
import math

a, b = list(map(int, input().split()))
n = b * 10
flag = False
while n <= 1009:
    if math.floor(n * 0.1) == b and math.floor(n * 0.08) == a:
        flag = True
        break
    n += 1
print(n) if flag is True else print(-1)

Solution (Python):
a,b=map(int,input().split());r=[i for i in range(1,1010) if i*0.08//1==a and i*0.1//1==b];print(r[0] if r else -1)

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

Solution (Python):
import math
a,b=map(int,input().split())
count=1
while True:
  c=count*0.08
  d=count*0.1
  if math.floor(c)==a and math.floor(d)==b:
    print(count)
    break
  count+=1
  if count>1500:
    print(-1)
    break

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

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

Solution (Python):

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


def floor_inv(x, f):
    res = int(x / f)
    if int(res * f) < x:
        res += 1
    return res


lb1 = floor_inv(A, 0.08)
ub1 = floor_inv(A + 1, 0.08)

lb2 = floor_inv(B, 0.10)
ub2 = floor_inv(B + 1, 0.10)

if ub1 <= lb2 or ub2 <= lb1:
    print(-1)
else:
    print(max(lb1, lb2))

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

for p in range(1, 10000):
    if p * 8 // 100 == A and p // 10 == B:
        print(p)
        break
else:
    print(-1)

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

flag = False

for a in range(12, 1263):
    if flag:
        break
    for b in range(10, 1001):
        a_tax = int(a * 0.08)
        b_tax = int(b * 0.10)
        if(a_tax == A and b_tax == B and a == b):
            print(a)
            flag = True
            
else:
    print(-1)

Solution (Python):

import sys
import collections as cl
import math

def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    A,B = MI()
    for i in range(11000):
        if math.floor( i * 0.08 ) == A and math.floor(i * 0.1) == B:
            print(i)
            exit()

    print(-1)


main()

Solution (Python):
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)

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

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

print(-1)

Solution (Python):
a = list(map(int,input().split()))
p = a[0]
q = a[1]
for i in range(2000):
  if int(i*0.08) == p and int(i*0.1) == q:
    print(i)
    break
  if i == 1999:
    print(-1)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for k in range(1001):
  if int(ans*0.08) == A and int(ans*0.1) ==B:
    print(ans)
    exit()
  else:
    ans += 1
print(-1)

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

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

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

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

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

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

ans = -1

for i in range(1,10100):
  if i // 12.5== a and i // 10 == b:
    ans = i
    break

print(ans)

Solution (Python):
import math
A,B=map(int,input().split())
eight=[]
i=0
ten=[]
for a in range(1,1001):
    if math.floor(a*0.08)==A:
        eight.append(a)
    if math.floor(a*0.1)==B:
        ten.append(a)

for a in eight:
    if a in ten:
        print(a)
        i=1
        break
if i==0:
    print("-1")

Solution (Python):
a,b = map(int,input().split())
'''
floor(x * 1.08) = a -> x = a/1.08
floor(x * 1.10) = b -> x = b/1.10
少数や切り捨てがめんどくさい・・・全探索か
'''
ans = -1
for n in range(10000):
    if n * 8 // 100 == a and n * 10 // 100 == b:
        ans = n
        break
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
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)

Solution (Python):
from math import floor as fl

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

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

Solution (Python):
import math
A,B=map(int,input().split())
for i in range(10000):
    A_ori = math.floor(i*0.08)
    B_ori = math.floor(i*0.1)
    if A_ori==A and B_ori==B:
        print(i)
        exit()
print(-1)

Solution (Python):
A, B = list(map(int, input().split()))
ans = -1
for i in range(1, 1009):
    if int(i*0.08) == A and int(i*0.10) == B:
        ans = i
        break
print(ans)

Solution (Python):
a,b = map(int, open(0).read().split())

i = int(a/0.08-1e-8)
while 1:
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        break
    if int(i*0.08)>a:
        print(-1)
        break
    i += 1

Solution (Python):
a, b = map(int, input().split())
for price in range(0,1010) :
    if int(price*0.08) == a and int(price*0.10) == b :
        print(price)
        break
else :
    print("-1")

Solution (Python):
a, b = map(int, input().split())
def solve():
    for i in range(1, 1010):
        if int(i*0.08) == a and int(i*0.1) == b:
            print(i)
            return
    print(-1)

solve()

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

Solution (Python):
import math

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

x = math.ceil(100 / 8 * A)
y = math.ceil(100 / 10 * B)

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

Solution (Python):
A,B =map(int,input().split())
flg = False
for i in range(1,1009):
    if int(i*8/100) == A and int(i/10) == B:
        print(i)
        flg = True
        break
if flg == False:
    print(-1)

Solution (Python):
A,B=map(int,input().split())
c=-1
for i in range(1,10**5):
    if int(i*0.08)==A and int(i*0.1)==B:
        c=i
        break
print(c)

Solution (Python):
A, B = map(int, input().split())
x = 0
while int(x * 0.08) <= A or int(x * 0.1) <= B:
    x += 1
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        exit()
print(-1)

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

p_lst = []
f = False
for p in range(1, 100*11):
    if int(p*0.08) == A and int(p*0.1) == B:
        p_lst.append(p)
        f = True
if not f:
    print(-1)
else:
    print(min(p_lst))

Solution (Python):
import math

t8 = [[] for _ in range(130)]
t10 = [[] for _ in range(130)]
for i in range(1251):
    t8[math.floor(i * 0.08)].append(i)
    t10[math.floor(i * 0.1)].append(i)

a, b = map(int, input().split())
if min(t8[a]) > max(t10[b]) or max(t8[a]) < min(t10[b]):
    print(-1)
else:
    print(max(min(t8[a]), min(t10[b])))

Solution (Python):

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

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

print(ans)

Solution (Python):
import math
a,b = map(int,input().split())
ans=-1
for i in range(math.ceil(a*12.5),math.ceil(12.5*(a+1))-1):
  if i//10==b:
    ans=i
    break
print(ans)

Solution (Python):
A, B = map(int, input().split())
MAX = 10 ** 3 + 1
res = -1
for i in range(1, MAX):
    if int(0.08 * i) == A and int(0.1 * i) == B:
        res = i
        break
print(res)

Solution (Python):
A, B = list(map(int, input().split()))
ans = -1
for i in range(1, 1009):
    if int(i*0.08) == A and int(i*0.10) == B:
        ans = i
        break
print(ans)

Solution (Python):
import math

def main():

    a, b = [int(i) for i in input().split()]

    lo = max(1000 * a, 800 * b)
    hi = min(1000 * (a + 1), 800 * (b + 1))

    if lo < hi:
        print(math.ceil(lo / 80))
    else:
        print(-1)


main()

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

ans = 1001
for n in range(1001):
  if n * 8 // 100 == a and n * 10 // 100 == b:
    ans = min(ans, n)

if ans < 1001:
  print(ans)
else:
  print(-1)

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

for i in range(1200):
    if (i * 8)//100 == a and (i*10)//100 == b:
        print(i)
        exit()

print(-1)

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

import math
flag = True
for i in range(1009):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
        print(i)
        flag = False
        break
if flag:
    print(-1)

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

import math
aS = math.ceil(a / 0.08)
al = math.floor((a + 1) / 0.08)
bs = math.ceil(b / 0.10)
bl = math.floor((b + 1) / 0.10)

flag = True
for i in range(10000):
    if aS <= i < al and bs <= i < bl:
        print(i)
        flag = False
        break
if flag:
    print(-1)

Solution (Python):

import sys
import math

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

c = math.ceil(b / 0.1)

for i in range(c, c + 10):
    if math.floor(i * 0.1) == b:
        if math.floor(i * 0.08) == a:
            print(i)
            sys.exit()

print(-1)

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

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

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

Solution (Python):
from math import ceil,floor

A,B=map(int,input().split())
x_min=int(min(ceil(A/0.08)-5, ceil(B/0.1)-5))
x_max=int(max(ceil((A+1)/0.08)+5, ceil((B+1)/0.1)+5))
exists=0
for i in range(x_min, x_max):
  if floor(i*0.08)==A and floor(i*0.1)==B:
    print(i)
    exists=1
    break
if not exists:print(-1)

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

A = int(a/0.08)
B = int((b+1)/0.1)
l =['-1']

for i in range(A,B+1):
    if int(i*0.08) == a and int(i*0.1) == b:
        l.append(i)
        break
        
print(l[-1])

Solution (Python):
import math
A, B = list(map(int, input().split()))
a = math.ceil(A / 0.08)
b = math.ceil(B / 0.1)
if a == b:
    print(a)
else:
    if a < b and int(b * 0.08) == A:
        print(b)
    elif a > b and int(a * 0.1) == B:
        print(a)
    else:
        print(-1)

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

Solution (Python):
import math
A, B = map(int, input().split())
arange = set(range(math.ceil(A*100/8), math.ceil((A+1)*100/8)))
brange = set(range(math.ceil(B*100/10), math.ceil((B+1)*100/10)))
ans_range = arange & brange
if len(ans_range) == 0:
    print(-1)
else:
    print(min(ans_range))

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

Solution (Python):
import math

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

n = math.floor(a / 0.08)
m = math.floor(b / 0.1)
n2 = n + 1
m2 = m + 1

p = math.floor(n * 0.08)
q = math.floor(n * 0.1)
x = math.floor(m * 0.08)
y = math.floor(m * 0.1)
p2 = math.floor(n2 * 0.08)
q2 = math.floor(n2 * 0.1)
x2 = math.floor(m2 * 0.08)
y2 = math.floor(m2 * 0.1)

if p == a and q == b and x == a and y == b:
    print(min(n,m))
elif p == a and q == b:
    print(n)
elif x == a and y == b:
    print(m)
elif p2 == a and q2 == b and x2 == a and y2 == b:
    print(min(n2,m2))
elif p2 == a and q2 == b:
    print(n2)
elif x2 == a and y2 == b:
    print(m2)
else:
    print(-1)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    for x in range(1, 1500):
        if 8 * x // 100 == A and 10 * x // 100 == B:
            print(x)
            return

    print('-1')
    return


if __name__ == '__main__':
    main()

Solution (Python):
n,m= map(int,input().split())
num = 0

f_n = False
f_m = False

num_n = 0
num_m = 0

while True:
  num_n = int(num * 0.08)
  num_m = int(num * 0.1)
  if int(num_n) == n:
    f_n = True
  if int(num_m) == m:
    f_m = True
  if f_m == True and f_n == True:
    print(num)
    break
  if num_m > 100 or num_n > 100 :
    print(-1)
    break
  f_m = False
  f_n = False
  num += 1

Solution (Python):
a,b = map(float,input().split())
for i in range(10000):
  c = i*8//100
  d = i*10//100
  if(a == c and b == d):
    print(i)
    exit()
print(-1)

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

a1 = math.ceil(A / 0.08)
a2 = math.floor((A+1) / 0.08)
b1 = math.ceil(B / 0.10)
b2 = math.floor((B+1) / 0.10)

dupl = set(range(a1, a2)) & set(range(b1, b2))
if len(dupl) > 0: 
    print(min(dupl))
else:
    print(-1)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

e = 0.08
t = 0.1

for i in range(1, 1000+1):
    if int(i * e) == a and int(i * t) == b:
        print(i)
        exit()

print(-1)

Solution (Python):
import sys
import math
input = sys.stdin.readline

A, B = map(int, input().split())
X = A / 0.08
Y = B/0.1
for i in range(math.floor(min(X, Y)), math.ceil(max(X, Y)) + 1):
    if int(i * 0.08) == A and int(i * 0.10) == B:
        print(i)
        exit()
print(-1)

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

for money in range(pow(10, 4)):
    if int(money*0.08) == a and int(money*0.1) == b:
        ans = money
        break

print(ans)

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

ans = 0
for i in range(10000):
    x = int(i*0.08)
    y = int(i*0.10)
    if x == a and y == b:
        ans = i
        break
if ans == 0:
    print(-1)
    exit()
print(ans)

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

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

n = 0
while True:

    if int(n * 0.08) == A and int(n*0.1) == B:
        break

    n += 1

    if n > 10000:
        n = -1
        break

print(n)

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

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

Solution (Python):
import sys

A, B = (int(x) for x in input().split())
num=0
while int(num*0.08)<=A:
  if int(num*0.08)==A and int(num*0.1)==B:
    print(num)
    sys.exit(0)
  num+=1
print(-1)

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

a_min, a_max = ceil(a/0.08), ceil((a+1)/0.08)
b_min, b_max = ceil(b/0.1), ceil((b+1)/0.1)

l = set(range(a_min, a_max)) & set(range(b_min, b_max))
ans = '-1' if len(l) == 0 else min(l)
print(ans)