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:
from math import ceil,floor
def tax(a, b):
    mina, maxa = a/0.08, (a+1)/0.08
    minb, maxb = b/0.1, (b+1)/0.1
    if(mina >= maxb or minb >= maxa): return -1

    return max(ceil(mina), ceil(minb))

a, b= map(int, input().strip().split())
print(tax(a, b))

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split(" "))
for i in range(1,1009):
    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())
notax = [int((B + i / 10) * 10) for i in range(10)]

for val in notax:
  if int(val * 0.08) == A:
    print(val)
    exit()
    
print(-1)

Submission status: Accepted

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

if(a%2==0):
  y1=[a*12.5,(a+1)*12.5]
else:
  y1=[a*12.5+0.5,(a+1)*12.5]  

y2=[b*10,(b+1)*10]

if(y1[0]<=y2[0] and y2[0]<y1[1]):
  print(int(y2[0]))
elif(y2[0]<=y1[0] and y1[0]<y2[1]):
  print(int(y1[0]))
else:
  print("-1")

Submission status: Accepted

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

ansA = set(range(math.ceil(A/0.08), math.ceil((A+1)/0.08)))
ansB = set(range(math.ceil(B/0.10), math.ceil((B+1)/0.10)))

if ansA & ansB:
    print(min(ansA & ansB))
else:
    print(-1)

Submission status: Accepted

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

x1 = math.ceil(a / .08)
b1 = math.floor(x1 * .1)

x2 = math.ceil(b / .1)
a1 = math.floor(x2 * .08)

if(b==b1):
    print(x1)
elif (a == a1):
    print(x2)
else:
    print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
answer=False
for i in range(1,1009):
    if int(i*0.08)==a and int(i*0.10)==b:
        print(i)
        answer=True
        break
if not answer:
     print("-1")

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

else:print(-1)

Submission status: Accepted

Solution code:
P8, P10 = map(int, input().split())


import math
price1_min = math.ceil(P8/0.08)

price1_max = math.floor((P8+1)//0.08)

price2_min = math.ceil(P10/0.10)

price2_max = math.floor((P10+1)//0.10)



if (price1_max >= price2_min) and (price2_max >= price1_min):
    print(max(price2_min, price1_min))
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.10)==b:
    ans = i
    break

print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
import math
A,B = (int(x) for x in input().split())
A1 = math.ceil(A/0.08)
A2 = math.ceil((A+1)/0.08)

"""if float((A+1)/0.08).is_integer() == True:
    A2 = math.floor((A+1)/0.08)
else:
    A2 = math.floor((A+1)/0.08) + 1
"""
B1 = math.ceil(B/0.1)
B2 = math.ceil((B+1)/0.1)

"""if float((B+1)/0.1).is_integer() == True:
    B2 = math.floor((B+1)/0.1)
else:
    B2 = math.floor((B+1)/0.1) + 1
"""
a = range(A1, A2)
b = range(B1, B2)
c = set(a) & set(b)
if len(c) == 0:
          print(-1)
else:
          print(min(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def cal1(x):
    c=int(x/0.08)
    if x*100%8==0:
        return c 
    else:
        return c+1
      
def cal2(x):
    c=int(x/0.1)
    return c
      
A,B=map(int,input().split())
a,b,c,d=cal1(A),cal1(A+1)-1,cal2(B),cal2(B+1)-1

if  b<c or d<a:
    print("-1")
else:
    print(max(a,c))

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
T = max(25*A, 20*B)

if 25*A >= 20*(B+1) or 25*(A+1)<=20*B:
    print(-1)
else:
    print(T//2 + T%2)

Submission status: Accepted

Solution code:
import sys

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

for i in range(10000):
    if i*8//100==a and i*10//100==b:
        print(str(i)+'\n')
        sys.exit()

print("-1\n")

Submission status: Accepted

Solution code:
import math
A,B = (int(x) for x in input().split())
A1 = math.ceil(A/0.08)
Ab = (A+1)/0.08
if float(Ab).is_integer() == True:
    A2 = math.floor(Ab)
else:
    A2 = math.floor(Ab) + 1
B1 = math.ceil(B/0.1)
Bb = (B+1)/0.1
if float(Bb).is_integer() == True:
    B2 = math.floor(Bb)
else:
    B2 = math.floor(Bb) + 1
a = range(A1, A2)
b = range(B1, B2)
c = set(a) & set(b)
if len(c) == 0:
          print(-1)
else:
          print(min(c))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Spyderエディタ

これは一時的なスクリプトファイルです。
"""
import math

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

alpha = []
beta = []

for x in range(math.floor(a/0.08), math.floor(a/0.05)):
    if math.floor(x * 0.08) == a:
        alpha.append(x)
for y in range(math.floor(b/0.10), math.floor(b/0.05)):
    if math.floor(y * 0.1) == b:
        beta.append(y)

if min(alpha) in beta:
    print(min(alpha))
elif min(beta) in alpha:
    print(min(beta))
else:
    print("-1")

Submission status: Accepted

Solution code:
from math import floor, ceil

a, b = map(int, input().split())
for i in range(ceil(a / 0.08), ceil(b/0.1)+10):
    if floor(i*0.08) == a and floor(i*0.10) == b and i >= 1:
        print(i)
        break
else:
    print('-1')

Submission status: Accepted

Solution code:
from math import floor
from sys import exit, stdin
A, B = [int(_) for _ in stdin.readline().rstrip().split()]
for i in range(1, 10000):
    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 = (int(x) for x in input().split())
A1 = math.ceil(A/0.08)
if float((A+1)/0.08).is_integer() == True:
    A2 = math.floor((A+1)/0.08)
else:
    A2 = math.floor((A+1)/0.08) + 1
B1 = math.ceil(B/0.1)
if float((B+1)/0.1).is_integer() == True:
    B2 = math.floor((B+1)/0.1)
else:
    B2 = math.floor((B+1)/0.1) + 1
a = range(A1, A2)
b = range(B1, B2)
c = set(a) & set(b)
if len(c) == 0:
          print(-1)
else:
          print(min(c))

Submission status: Accepted

Solution code:
def tax(A,B):
    for i in range(1, 800001):
        t1=int(i*0.08)
        t2=int(i*0.1)
        if t1 == A:
            if t2 == B:
                return i
        

if __name__ == "__main__":
    A, B = input().split()
    A = int(A)
    B = int(B)
    i=tax(A,B)
    if i == None:
        print("-1")
    else:
        print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

ans_b_min = b * 10
ans_b_list = []
for i in range(0, 10):
    ans_b_tmp = ans_b_min + i
    ans_b_list.append(ans_b_tmp)
    # print(ans_b_tmp)

for ans_b in ans_b_list:
    if int(math.floor(ans_b * 0.08)) == a:
        print(ans_b)
        exit(0)

print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
tmp=0
for i in range(a+b,1250):
    x=i*0.08
    y=i*0.1

    if int(x)==a and int(y)==b:
        print(int(i))
        tmp=1
        break
if tmp==0:
    print(-1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

ans = b * 10
status = ''
for i in range(10):
  8*(ans + i)//100
  if(a == 8*(ans + i)//100):
    ans += i
    status = 'ok'
    break;

if status =='ok':
  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:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


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

main()

Submission status: Accepted

Solution code:
import math

def per8_and_per10(n, a, b):
  per8  = n * 0.08 
  per10 = n * 0.1
  if a <= f01_rounding(per8) < a+1 and b <= f01_rounding(per10) < b+1:
    return True
  else:
    return False

def f01_rounding(number):
  number_str = list(str(number))
  number_str_slice = "".join(number_str[:(number_str.index("."))])
  number_int = int(number_str_slice)
  return number_int

a, b = map(int, input().split())
for i in range(1,1010):

  if per8_and_per10(i, a, b):
    print(i)
    exit()
print(-1)

Submission status: Accepted

Solution code:
from math import ceil,floor

numA,numB = map(int,input().split())
for i in range(10000):
  testA = floor(i * 0.08)
  testB = floor(i * 0.10)
  if testA == numA and testB == numB:
    print(i)
    break
else:
  print("-1")

Submission status: Accepted

Solution code:
import math
n,m = map(int,input().split())
if (n+1)/0.08 > m/0.1 and (m+1)/0.1 > n/0.08:
    print(max(math.ceil(n/0.08),math.ceil(m/0.1)))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
if (A+1)/0.08 > B/0.1 and (B+1)/0.1 > A/0.08:
    print(max(math.ceil(A/0.08),math.ceil(B/0.1)))
else:
    print(-1)

Submission status: Accepted

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

for i in range(10000):
    za = floor(i * 8 / 100)
    zb = floor(i * 10 / 100)
    if (a == za and b == zb):
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

ans = range(math.ceil(a*12.5), math.ceil((a+1)*12.5))
for i in ans:
    if int(i*0.1) == b:
        print(i)
        exit()
print('-1')

Submission status: Accepted

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

# ans = math.ceil(a*12.5)
# if int(ans*0.1) != b:
#     print('-1')
#     exit()

# print(ans)

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

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

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

    else:
        continue

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
 
count = 0
for i in range(1,1001):
  if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
    print(i)
    exit()
  else:
    count += 1
if count > 99:
  print(-1)

Submission status: Accepted

Solution code:
import math

A, B = [int(x) for x in input().strip().split()]

lA = math.ceil(A / 0.08)
uA = (A + 1) / 0.08
if uA.is_integer():
    uA = int(uA) - 1
else:
    uA = int(uA)

lB = math.ceil(B / 0.1)
uB = (B + 1) / 0.1
if uB.is_integer():
    uB = int(uB) - 1
else:
    uB = int(uB)

if uA < lB or uB < lA:
    print(-1)
else:
    print(max(lA, lB))

Submission status: Accepted

Solution code:
A,B=input().split()
A=int(A)
B=int(B)
price1_min=A/0.08
price1_max=(A+1)/0.08
price2_min=B/0.1
price2_max=(B+1)/0.1

if price2_min>=price1_max or price1_min>=price2_max:
    print(-1)

else:
    price=max(price1_min,price2_min)
    if price==int(price):
        print(int(price))
    else:
        print(int(price)+1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
x1 = int((a-1)/0.08)
x2 = int((a+1)/0.08)
y1 = int((b-1)/0.1)
y2 = int((b+1)/0.1)
x = []
for i in range(x1, x2+1):
    if int(i*0.08) == a:
        x.append(i)
y = []
for i in range(y1, y2+1):
    if int(i*0.1) == b:
        y.append(i)
for i in x:
    if i in y:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

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

x_min = a / 0.08
x_max = (a + 1) / 0.08

y_min = b / 0.1
y_max = (b + 1) / 0.1

x_list = list(range(math.ceil(x_min), math.floor(x_max) + 1))
if x_max == math.floor(x_max):
    x_list.pop(-1)

y_list = list(range(math.ceil(y_min), math.floor(y_max) + 1))
if y_max == math.floor(y_max):
    y_list.pop(-1)


matome = set(x_list) & set(y_list)
matome = list(matome)


if not matome:
    print(-1)
else:
    print(min(matome))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
C = math.ceil(100*A/8)

if A % 2 == 0:
  D = math.floor(100*(A+1)/8)
else:
  D = math.floor(100*(A+1)/8)-1
  
for X in range(C,D+1):
  if B == math.floor(10*X/100):
    print(X)
    break
else:
  print(-1)

Submission status: Accepted

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

table = []
for x in range(1010):
    a = int(x * 0.08)
    b = int(x * 0.10)
    table.append((a, b))

res = -1
for x in range(1010):
    a, b = table[x]
    if a == A and b == B:
        res = x
        break

print(res)

Submission status: Accepted

Solution code:
import numpy as np

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

xa_min = 12.5 * A
xa_max = 12.5 * (A+1)
xb_min = 10 * B
xb_max = 10 * (B+1)

x_min = np.ceil(max(xa_min, xb_min))
x_max = np.floor(min(xa_max, xb_max))

if x_min >= x_max:
	print(-1)
else:
	print(int(x_min))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

x = 10 * b
ans = -1


while (x < 10 * (b + 1)) and (ans == -1):
  if int(x * (1 / 10)) != b:
    x += 1
  else:
    ans = x

ans = -1

if x < (a + 1) * (25 / 2):
  while (x < (a + 1) * (25 / 2)) and (ans == -1 ):
    if int(x * (2 / 25)) == a:
      ans = x
    else:
      x += 1

  if int(x * (1 / 10)) == b:
    ans = x
  else:
    ans = -1

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

    base = b * 10
    for i in range(10):
        r = int((base + i) * 0.08)
        if r == a:
            print(base + i)
            return
    print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
import sys
# libraries

alpha,beta = map(int, input().split())
    
for i in range(1010):
    sierra = math.floor(i*0.08)
    tango = math.floor(i*0.10)
    if sierra == alpha and tango == beta:
            print(i)
            break
else:
    print(-1)

Submission status: Accepted

Solution code:
# A = [list(map(int, input().split())) for _ in range(3)]
# n = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
a, b = map(int, input().split())
for i in range(10000):
    za = (8*i)//100
    zb = (10*i)//100
    if za == a and zb == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

for i in range(min(int(A / 0.08),int(B / 0.10) ),max(int((A+1)/0.08),int((B+1)/0.08))):
  # print(i)
  if int(i*0.08) == A and int(i*0.10) == B:
    print(i)
    break
else:
  print(-1)

Submission status: Accepted

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

for i in range(1250):
    i += 1

    if math.floor(i * 0.1) == b and math.floor(i * 0.08) == a:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
n = 0
while n<11000:
 n+=1
 if A == math.floor(n*.08) and B == math.floor(n*.1):
     print(n)
     break
else:
    print(-1)

Submission status: Accepted

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

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

n = 0

while n<11000:
 n+=1
 x1 = int(n * .08)
 x2 = int(n * .1)
 if A == x1 and B == x2:
     print(n)
     break
else:
    print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
value = 0
for i in range(1, 1001):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        value = i
        break
if value == 0:
    print(-1)
else:
    print(value)

Submission status: Accepted

Solution code:
from math import floor
a,b=map(int, input().split())
x=0
for i in range(1001):
  if a==floor(i*.08) and b==floor(i*.1):
      x=i
      break
print(x if x else -1)

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
candidate = [i for i in range(10*B, 10*(B+1))]
result_list = [i for i in candidate if (25/2) * A <= i and i < (25/2) * (A+1)]
if result_list == []:
  print(-1)
else:
  print(min(result_list))

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
i1 = x * 12.5
i2 = y * 10
i1 += 0.5
i1 //= 1
z = max(i1, i2)
if z // 12.5 != x or z // 10 != y:
    print(-1)
else:
    print(int(z))

Submission status: Accepted

Solution code:
a,b=list(map(int,input().split()));b*=10;l=[i for i in range(b,b+10) if int(i*0.08)==a];print(-1 if len(l)==0 else min(l))

Submission status: Accepted

Solution code:
a, b = map(float, input().split())
lowest = max([-(-a // 0.08), -(-b // 0.1)])
highest = min([-(-(a+1) // 0.08), -(-(b+1) // 0.1)])
answer = -1
for target in range(int(lowest), int(highest+1)):
	cand = [(target*0.08)//1, (target*0.1)//1]
	if cand == [a, b]:
		answer = int(target)
		break
print(answer)

Submission status: Accepted

Solution code:
import math


def solve(a, b):
    for i in range(2000):
        if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
            return i

    return -1


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

print(solve(A, B))

Submission status: Accepted

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

Submission status: Accepted

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

total = int(max(-(-a//0.08),-(-b//0.1)))
for i in range(1,total+1):
  y1 = int(i * 0.08)
  y2 = int(i * 0.1)
  if y1 == a and y2 == b:
    print(i)
    exit()
print("-1")

Submission status: Accepted

Solution code:
a, b = (int(x) for x in input().split())

c_list = []
b_list = []


def f(n, tax, list):
    limit = n + 1
    while(n < limit):
        list.append(int(n / tax))
        n += tax / 2

f(b, 0.1, b_list)

for i in b_list:
    tmp = int(i * 0.08)
    if(tmp == a):
        c_list.append(i)



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

Submission status: Accepted

Solution code:
A, B = map(int,input("").split(" "))
value = int(A*12.5) -1
ans = -1
while True:
  value += 1
  tax_1 = int(value*0.08)
  tax_2 = int(value*0.10)
  if tax_1 == A and tax_2 == B:
    ans = value
    break
  elif tax_1 > A and tax_2 > B:
    break
print(ans)

Submission status: Accepted

Solution code:
import math
A,B = input().split()
A_i = int(A)
B_i = int(B)
C = []
for i in range(1100):
    if math.floor(i * 0.08) == A_i and math.floor(i *0.1) == B_i:
        C.append(i)
    else:
        pass
if not C:
    print(-1)
else:
    print(C[0])

Submission status: Accepted

Solution code:
import math
a, b = [int(i) for i in input().split()]
 
a_min = math.ceil(a * 12.5)
a_max = int((a+1) * 12.5 - 10e-10)
 
b_min = math.ceil(b * 10 )
b_max = int((b+1)*10 - 10e-10)

  
if a_max < b_min:
  print(-1)
  exit()
  
if b_max < a_min:
  print(-1)
  exit()
  
if a_min <= b_min:
  print(b_min)
  exit()
print(a_min)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
a_down=math.ceil(a/0.08)
a_up=math.ceil((a+1)/0.08)
b_down=math.ceil(b/0.1)
b_up=math.ceil((b+1)/0.1)

for i in range(a_down,a_up):
  if i >= b_down and i < b_up:
    answer=i
    break
  else:
    answer=-1
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

if max(a_min, b_min) < min(a_max, b_max):
    ans = max(a_min, b_min)
    ans = int(ans) if (ans - int(ans)) == 0 else int(ans) + 1
else:
    ans = -1

print(ans)

Submission status: Accepted

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

cand_a = math.ceil(12.5*A)
cand_b = math.ceil(10*B)
max_a = math.floor(12.5*(A + 1))
max_b = math.floor(10*(B + 1))

if cand_a > cand_b:
    if cand_a < max_b:
        ans = cand_a
    else:
        ans = -1
elif cand_b > cand_a:
    if cand_b < max_a:
        ans = cand_b
    else:
        ans = -1
else:
    ans = cand_a

print(ans)

Submission status: Accepted

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

ma = 20000

for i in range(1, ma):
	p1 = i * 0.08
	p2 = i * 0.1
	if a <= p1 < a+1 and b <= p2 < b+1:
		print(i)
		exit()
print('-1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
res=[]
for n in range(1,1251):
    a=n*0.08; b=n*0.1
    if (A<=a<A+1)&(B<=b<B+1):
        res.append(n)
print(-1 if len(res)==0 else min(res))

Submission status: Accepted

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

i = 1
while True:
    
    if i >= 1010:
        print(-1)
        break
    
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        break
        
    i += 1

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().strip().split())
def helper(val):
  return math.floor(val * 0.08) == A and math.floor(val * 0.1) == B

i = 0
while i < 1100:
  if helper(i):
    print(i)
    exit()
  i += 1

print(-1)

Submission status: Accepted

Solution code:
import math
x,y=map(int,input().split())

for i in range(1010):
    if math.floor(i*0.08)==x and math.floor(i*0.1)==y:
        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)
    exit()
print('-1')

Submission status: Accepted

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

amax = math.ceil((A + 1) / 8 * 100) - 1
amin = math.ceil(A / 8 * 100)
bmax = math.ceil((B + 1) * 10) - 1
bmin = math.ceil(B * 10)

if amin > bmax or bmin > amax:
    print(-1)
else:
    print(int(max(amin, bmin)))

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
ls = [b*10+i for i in [0,1,2,3,4,5,6,7,8,9]]
t = 0
for x in ls:
    if a == math.floor(x*8/100):
        print(x)
        break
    else:
        t += 1
        
if t == 10:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for num in range(1, 1252):
    if int(num * 0.08) == a and int(num * 0.10) == b:
        break
if num == 1251:
    print(-1)
else:
    print(num)

Submission status: Accepted

Solution code:
import math

A, B = [int(i) for i in input().split()]
taxA, taxB = [0.08, 0.1]

ans = -1
for i in range(1250):
    if math.floor(i * taxA) == A and math.floor(i * taxB) == B:
        ans = i
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

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

for i in range(1,10001):
  if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
    print(i)
    sys.exit()
    
print('-1')

Submission status: Accepted

Solution code:
import sys
import math

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

for i in range(1,10000):
  if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
    print(i)
    sys.exit()
    
print('-1')

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
lsta = list(range(math.ceil(a/0.08), math.ceil((a+1)/0.08)))
lstb = list(range(math.ceil(b/0.1), math.ceil((b+1)/0.1)))
for la in lsta:
  for lb in lstb:
    if la==lb:
      print(la)
      exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
import math

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

for i in range(1, 1010):
	x = math.floor(i * 0.08)
	y = math.floor(i * 0.10)
	if x == A and y == B:
		print(i)
		sys.exit(0)

print(-1)

Submission status: Accepted

Solution code:
import sys
import math

number = list(map(int, input().split()))
expect = 0.0

for i in range(1500):
    expect += 1
    if int(expect*0.08) == number[0] and int(expect*0.1) == number[1]:
        print(int(expect))
        sys.exit()

print(-1)

Submission status: Accepted

Solution code:
A, B =map(int, input().split())
M=int(-1)
for i in range(1001):
    if int(i*0.08)==A:
        if int(i*0.10)==B:
            M=i
            break

print(M)

Submission status: Accepted

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

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
def c(x,r):
    return int(-(-x//r))
a1,a2 = c(a,.08), c(a+1,.08)-1
b1,b2 = c(b,.1), c(b+1,.1)-1
if a1 > b2 or b1 > a2:
    print(-1)
else:
    print(max(a1,b1))

Submission status: Accepted

Solution code:
import math

a,b = map(int, input().split())
t = 1
x = False
y = False
z = False

while t <= 10000:
    c = math.floor(t * 0.08)
    d = math.floor(t * 0.1)
    
    if c == a:
        x = True
    else:
        x = False
        
    if d == b:
        y = True
    else:
        y = False
        
    if x and y:
        print(t)
        z = True
        break
        
    t = t + 1

if z == False:
    print('-1')

Submission status: Accepted

Solution code:
import math 
A,B = map(int,input().split()) 
# print(A/0.08,B/0.1)
price = []
x = int(A/0.08)
# print(x,y)
y = int(B/0.1)
for i in range(min(x,y),10001):
	if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
		price.append(i)	
		break
		# print(i, math.floor(i*0.08),math.floor(i*0.1))
if len(price) == 0:
	print(-1)
else:
	print(min(price))

Submission status: Accepted

Solution code:
import math
 
A, B = map(int, input().split())
ans = -1
 
for i in range(int(min(A/0.08, B/0.1)), 10001):
  if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
    ans = i
    break
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

for i in range(int(min(A * 12.5, B * 10)), 10001):
  if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
    ans = i
    break
    
print(ans)