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

s = input().split(' ')
a = int(s[0])
b = int(s[1])
a1 = a / 0.08
a += 0.9999
a2 = a / 0.08
b1 = b / 0.1
b += 0.9999
b2 = b / 0.1

# print(a1, a2, b1, b2)
if a2 < b1 or b2 < a1:
    print(-1)
elif a1 >= b1:
    print(int(math.ceil(a1)))
else:
    print(int(math.ceil(b1)))

Submission status: Accepted

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

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

for n in range(25):
  l = (25 * a + n) % 2
  m = 25 * a + n
  if(l == 0):
    if((m/2 - 10 * b) == int(m/2 - 10 * b) and (m/2 - 10 * b) < 10 and (m/2 - 10 * b) >= 0):
      x = int(m/2)
      break
  if(n == 24):
    x = -1
    break
    
print("{}".format(x))

Submission status: Accepted

Solution code:
import math

s = input().split(' ')
a = int(s[0])
b = int(s[1])
a1 = a / 0.08
a += 0.9999
a2 = a / 0.08
b1 = b / 0.1
b += 0.9999
b2 = b / 0.1

# print(a1, a2, b1, b2)
if a2 < b1 or b2 < a1:
    print(-1)
elif a1 >= b1:
    print(int(math.ceil(a1)))
else:
    print(int(math.ceil(b1)))

Submission status: Accepted

Solution code:
import math
a , b = map(int,input().split())
al = math.ceil(a / 0.08)
ar = math.floor((a + 1)/0.08)
bl = math.ceil(b/0.1)
br = math.floor((b+1)/0.1)
ans = 0
if al <= bl and ar > bl:
    ans = bl
elif al >= bl and br > al:
    ans = al
else:
    ans = -1
print(ans)

Submission status: Accepted

Solution code:
import math
a , b = map(int,input().split())
al = math.ceil(a / 0.08)
ar = math.floor((a + 1)/0.08)
bl = math.ceil(b/0.1)
br = math.floor((b+1)/0.1)
ans = 0
if al <= bl and ar > bl:
    ans = bl
elif al >= bl and br > al:
    ans = al
else:
    ans = -1
# if al == bl:
#     ans = al
# elif al > bl:
#     if al > br:
#         ans = -1
#     else:
#         ans = al
# elif al < bl:
#     if ar < bl:
#         ans = -1
#     else:
#         ans = bl
if ar < al or br < bl:
    ans = -1
print(ans)

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = list(map(int,input().split()))
X = []
mA = int(100/8*A)
MA = int(100/8*(A+1))+1
mB = int(10*B)
MB = int(10*(B+1))+1
 

for i in range(max(mA,mB),min(MA,MB)):
    X.append(i)
#print(X)

f = True
for i in X:
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        f = False
        break
if f:
    print(-1)

Submission status: Accepted

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

if not done:
        print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
eight_list = []
ten_list = []
eight_min = math.ceil(A/0.08)
ten_min = math.ceil(B/0.10)
eight_list.append(eight_min)
ten_list.append(ten_min)

eight_min += 1
while(math.floor(eight_min*0.08)==A):
    eight_list.append(eight_min)
    eight_min += 1

ten_min += 1
while(math.floor(ten_min*0.10)==B):
    ten_list.append(ten_min)
    ten_min += 1

#print(eight_list)
#print(ten_list)
try:
    print(min(set(eight_list)&set(ten_list)))
except ValueError:
    print(-1)

Submission status: Accepted

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

res = -1;

for x in range(10 * b, 10 * b + 10):
    if (2 * x) // 25 == a:
        res = x;
        break;

print(res);

Submission status: Accepted

Solution code:
A,B=(int(x) for x in input().split())
for N in range(1001):
    a=int(N*0.08)
    b=int(N*0.1)
    if a==A and b==B:
        print(N)
        break
    if N==1000:
        print("-1")

Submission status: Accepted

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

ans = -1

for x in range(20*b):
    if int(x * 0.08) == a and int(x * 0.1) == b:
        ans = x
        break

print(ans)

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    
    flg = 0
    for i in range(10000):
        tmp_a = int(i*0.08)
        tmp_b = int(i*0.1)
        if a == tmp_a and b == tmp_b:
            print(i)
            flg = 1
            break
    
    if flg == 0:
        print(-1)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(1001):
  a = int(i * 0.08)
  b = int(i * 0.10)
  if a == A and b == B:
    print(i)
    break
else:
  print(-1)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
A=set(range(math.ceil(a/0.08),math.floor((a+1)/0.08)))
B=set(range(math.ceil(b/0.1),math.floor((b+1)/0.1)))
A_B=list(A&B)
print("-1" if len(A_B)==0 else min(A_B))

Submission status: Accepted

Solution code:
import math

def main():

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

    a_l = A / 0.08
    a_m = (A + 1) / 0.08

    b_l = B / 0.1
    b_m = (B + 1) / 0.1

    l = max(a_l, b_l)
    m = min(a_m, b_m)

    c = math.ceil(l)

    if c < m:
        print(int(c))
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
a,b = map(float, input().split())
min8 = 12.5*a
max8 = 12.5*(a+1)
min10 = 10*b
max10 = 10*(b+1)
if max8 < min10 or max10 < min8:
    print('-1')
    exit()
if min8 > min10:
    min = min8
else:
    min = min10
if max8 < max10:
    max = max8
else:
    max = max10
if math.ceil(min) < max:
    print(math.ceil(min))
else:
    print("-1")

Submission status: Accepted

Solution code:
import math 

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

if (A / 0.08) > (B / 0.10):
  withOutA = math.ceil(A / 0.08)
  withOutB = math.floor(B / 0.10)
else:
  withOutA = math.floor(A / 0.08)
  withOutB = math.ceil(B / 0.10)


mark = True

for i in range(min(int(withOutA), int(withOutB)), max(int(withOutA), int(withOutB)) + 1):  
  if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
    print(i)
    mark = True
  else:
    mark = False

if not mark:
  print(-1)

Submission status: Accepted

Solution code:
import sys

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

max_n = (b + 1) * 10

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

print(-1)

Submission status: Accepted

Solution code:
import math
ab = input().split(' ')
if len(ab) != 2:
    raise Exception

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

min_x_a = math.ceil(a / 0.08)
bound = (a + 1) / 0.08
if bound == int(bound):
    max_x_a = int(bound) - 1
else:
    max_x_a = int(bound)

min_x_b = math.ceil(b / 0.1)
bound = (b + 1) / 0.1
if bound == int(bound):
    max_x_b = int(bound) - 1
else:
    max_x_b = int(bound)

if min_x_a < min_x_b and max_x_a < min_x_b:
    print(-1)
elif min_x_b < min_x_a and max_x_b < min_x_a:
    print(-1)
else:
    print(max(min_x_a, min_x_b))

Submission status: Accepted

Solution code:
import math 

from sys import stdin
 



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

A_min = int(math.ceil(100*A/8))
A_max = int(math.floor((100*A + 1)/8))
B_min = 10*B 


A_ = []
c = int(math.ceil(100*A/8))
while c < (A + 1)*100/8:
	A_.append(c)
	c += 1
B_ = []
c = 10*B 
while c < 10*B + 10:
	B_.append(c)
	c += 1 

C = list(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())
for i in range(1, 1020):
    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())

for x in range(1010):
    if(x * 8 // 100 == A and x * 10 // 100 == B):
        print(x)
        exit()
    
print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8

import math

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

lower = math.ceil(a / 0.08)
upper = math.ceil(a / 0.08 + 12.5) - 1

if upper >= b * 10 and lower <= b * 10 + 9:
    print(max(b * 10, lower))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

# get input
eight, ten = map(lambda x: int(x), input().split(' '))

def oriPrice(a, b):
  """
  <int> a = round(0.08 * ori)
  <int> b = round(0.10 * ori)
  """
  # ori = b*10 ~ (b+1)*10 - 1
  for i in range(10, 0, -1):
    possibleOri = (b+1)/0.10-i
    if np.int(np.floor(possibleOri*0.08)) == a:
      return np.int(possibleOri)
    
  return -1

print(oriPrice(eight, ten))

Submission status: Accepted

Solution code:
import numpy as np

# get input
eight, ten = map(lambda x: int(x), input().split(' '))

def oriPrice(a, b):
  """
  <int> a = round(0.08 * ori)
  <int> b = round(0.10 * ori)
  """
  # ori = b * 10 ~ (b+1)*10 - 1
  possibleOri = [(b+1)/0.10-i for i in range(10, 0, -1)]
  
  for i in range(len(possibleOri)):
    if np.int(np.floor(possibleOri[i]*0.08)) == a:
      return np.int(possibleOri[i])
  
  return -1

print(oriPrice(eight, ten))

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
n = 1
while n <=10000:
  if n*8//100 == a and n*10//100 == b:
    print(n)
    break
  n +=1
else:
  print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
i = 0
while i < 100000:
    if int(i * 0.08) == a:
        if int(i * 0.1) == b:
            print(i)
            exit()
    i += 1
print(-1)

Submission status: Accepted

Solution code:
import math

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

    # 条件を満たす可能性のある最小の正数を計算
    x_min = max(math.ceil(A / 0.08), math.ceil(B / 0.1))
    # 条件を満たす可能性のある最大の正数を計算
    x_max = min((math.ceil((A + 1) / 0.08), math.ceil((B + 1) / 0.1)))

    # 候補の正数を順番にチェックし、満たすものがあればそれを出力して終了
    for x in range(x_min, x_max + 1):
        if (math.floor(x * 0.08) == A) and (math.floor(x * 0.1) == B):
            print(x)
            quit()

    # ここまで来るときは満たすものがないので、-1を出力
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
base_A = int(A / 0.08) if A / 0.08 - int(A/0.08) < 0.5 else int(A / 0.08)+1
base_Aplus = int((A+1) / 0.08)
count = 0
for i in range(base_A, base_Aplus):
  if (int(i * 0.1) == B):
    ans = i
    count += 1
    break
if count > 0:
  print(ans)
else:
  print(-1)

Submission status: Accepted

Solution code:

from math import ceil
A, B = map(int, input().split())

min_8 = ceil(A / 0.08)
max_8 = ceil((A+1) / 0.08)

min_10 = ceil(B / 0.1)
max_10 = ceil((B+1) / 0.1)

ans = -1

for i in range(min_8,max_8):
    if i in range(min_10,max_10):
        ans = i
        break

print(ans)

Submission status: Accepted

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

def non_taxed_price_8(x):
    min_8 = x/0.08
    Max_8 = (x+1)/0.08
    eight = set(range(ceil(min_8), ceil(Max_8)))
    return eight

def non_taxed_price_10(x):
    min_10 = x/0.1
    Max_10 = (x+1)/0.1
    ten = set(range(ceil(min_10), ceil(Max_10)))
    return ten

a = non_taxed_price_8(A)
b = non_taxed_price_10(B)

r = a&b
if len(r) == 0:
    print(-1)
else:
    print(min(list(r)))

Submission status: Accepted

Solution code:
import math

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

INF = 10**4
for x in range(INF):
    if math.floor(x * 0.08) == A:
        if math.floor(x * 0.10) == B:
            print(x)
            exit()

print(-1)

Submission status: Accepted

Solution code:
from math import ceil 
A, B = map(int,input().split())
def non_taxed_price_8(x):
    min_8 = x*12.5
    Max_8 = (x+1)*12.5
    eight = set(range(ceil(min_8), ceil(Max_8)))
    return eight

def non_taxed_price_10(x):
    min_10 = x*10
    Max_10 = (x+1)*10
    ten = set(range(ceil(min_10), ceil(Max_10)))
    return ten

a = non_taxed_price_8(A)
b = non_taxed_price_10(B)

r = a&b
if len(r) == 0:
    print(-1)
else:
    print(min(list(r)))

Submission status: Accepted

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

for x in range(10000):
    if math.floor(x * 8 / 100) == a:
        if math.floor(x * 10 / 100) == b:
            print(x)
            exit()

print(-1)

Submission status: Accepted

Solution code:
import numpy as np


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

Submission status: Accepted

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

Submission status: Accepted

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

def tax8(n):
  res = n*(8/100)
  res = math.floor(res)
  return res

def tax10(n):
  res = n*(1/10)
  res = math.floor(res)
  return res

def excluded(a, b):
  for i in range(1300):
    if ((tax8(i)) == a) and ((tax10(i)) == b):
      return i
  return -1

print(excluded(A,B))

Submission status: Accepted

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

price = range(1100)

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

Submission status: Accepted

Solution code:
from math import ceil, floor

def tax(yen, percent):
  start = yen * 100 / percent
  end = (yen + 1) * 100 / percent
  return set(range(ceil(start), ceil(end)))

A, B = map(int, input().split(" "))
a = tax(A, 8)
b = tax(B, 10)
r = a & b
if len(r):
  print(sorted(list(r))[0])
else:
  print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = -1
for candidate in range(max(A, B), 1009):
    if int(candidate * 0.08) == A and int(candidate * 0.1) == B:
        ans = candidate
        break
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = -1
for candidate in range(max(A, B), 1009):
    if (int(candidate * 0.08) == A) and (int(candidate * 0.1) == B):
        ans = candidate
        break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# O(1) solution
import math

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

min_A = int(math.ceil(A * 12.5))
max_A = int(math.ceil((A + 1) * 12.5) - 1)

grp_A = {i for i in range(min_A, max_A + 1)}

min_B = int(math.ceil(B * 10))
max_B = int(math.ceil((B + 1) * 10) - 1)

grp_B = {i for i in range(min_B, max_B + 1)}

ans = grp_A & grp_B

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

print(ans)

Submission status: Accepted

Solution code:
import math

S = input().split(' ')
A = int(S[0])
B = int(S[1])
p = -1
for x in range(2100):
    if math.floor(x*0.08) == A and math.floor(x*0.1) == B:
        p = x
        break
print(p)

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
minA=math.ceil(float(A  )*100/8) 
minB=math.ceil(float(B  )*100/10)
maxA=float(A+1)*100/8
maxB=float(B+1)*100/10

print(max(minA,minB)) if max(minA,minB)<min(maxA,maxB) else print(-1)

Submission status: Accepted

Solution code:
import math

inputs=input().split()
a=float(inputs[0])
b=float(inputs[1])

res=-1
for p in range(1111):
  if a == math.floor(p *0.08) and b == math.floor(p *0.1):
    res=p
    break
print(res)

Submission status: Accepted

Solution code:
from math import ceil,floor
def without_tax(a,b):
    w_a = ceil(a/0.08)
    m_w_a = ceil((a+1)/0.08) -1
    w_b = ceil(b/0.1)
    m_w_b = ceil((b+1)/0.1) -1
    result = max(w_a,w_b)
    if result > min(m_w_a,m_w_b): 
        return -1
    return result
a,b = [int(e) for e in input().split()]
print(without_tax(a,b))

Submission status: Accepted

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

while True:
  p=i*8//100
  q=i//10
  if p==a and q==b:
    break
  i+=1
  if i>=(a+1)*13 and i>(b+1)*10:
    print(-1)
    exit()
print(i)

Submission status: Accepted

Solution code:
cuts = []
for i in range(2000):
  cuts+= [[int(i*0.08), int(i*0.10)]]
  
A, B = map(int,input().split())

for i in range(1,2000):
  if [A, B] == cuts[i]:
    print(i)
    break
else:
  print(-1)

Submission status: Accepted

Solution code:
import math


class Solution:
    def solve(self, A: int, B: int) -> int:

        for i in range((B+1)*10):
            if int(math.floor(i * 0.08)) == A and int(math.floor(i * 0.10)) == B:
                return i

        return -1


if __name__ == '__main__':

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

    # solve
    solution = Solution()
    print(solution.solve(A, B))

Submission status: Accepted

Solution code:
tax_8, tax_10 = map(int, input().split())
ans = -1

for i in range(1250):
  if (i+1) * 0.08 //1 == tax_8 and (i+1) * 0.1 //1 == tax_10:
    ans = i+1
    break

print(ans)

Submission status: Accepted

Solution code:
import math
taxA, taxB= map(int,input().split())

minPriceA = math.ceil(taxA / 0.08)
maxPriceA = math.ceil((taxA + 1) / 0.08) 

minPriceB = math.ceil(taxB / 0.1)
maxPriceB = math.ceil((taxB + 1) / 0.1) 

minPrice = None
finish = False
for a in range(minPriceA, maxPriceA):
	for b in range(minPriceB, maxPriceB):
		if (a == b):
			minPrice = a
			finish = True
			break
	if (finish):
		break
if minPrice == None:
	print(-1)
else:
	print(minPrice)

Submission status: Accepted

Solution code:
#input
A, B = map(int,input().split())
#消費税0.08 0.1
import math

ans = -1

for n in range(1001):##最大値を間違えていた
        if math.floor(n*0.08) == A and math.floor(n*0.1) == B:
            ans = int(n)
            break

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# O(1)

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

for n in range(10 * B, 10 * (B + 1)):
    if 25 * A <= 2 * n < 25 * (A + 1):
        print(n)
        break
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
lst = []
for i in range(1, 1010):
    if int(i*0.08) == A and int(i*0.1) == B:
        lst.append(i)

if len(lst) > 0:
    print(lst[0])
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
y=b*10
f=False
for i in range(y, y+10):
  if i*8//100 == a:
    print(i)
    f=True
    break
if not f:
  print(-1)

Submission status: Accepted

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

for i in range(1001):
    a = int(i * 0.08)
    b = int(i* 0.10)
    if a == A and b == B:
        print(i)
        quit()
        
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''input
8 10
'''
import math

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

a_low = math.ceil((a + 0.000) / 0.08)
a_hig = math.floor((a + 0.999) / 0.08)

b_low = math.ceil((b + 0.000) / 0.1)
b_hig = math.floor((b + 0.999) / 0.1)

if b_low <= a_low and a_low <= b_hig:
    print(a_low)
    exit()

if a_low <= b_low and b_low <= a_hig:
    print(b_low)
    exit()

print(-1)

Submission status: Accepted

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

for i in range(10000):
    a = int(i * 0.08)
    b = int(i * 0.1)

    if A == a and B == b:
        print(i)
        exit(0)

print(-1)

Submission status: Accepted

Solution code:
a,b=tuple(map(int,input().split()))
c=25*a
d=10*b
if -(-c // 2) <= d < (c+25)/2 :
    print(d)
elif d <= -(-c // 2) < d+10:
    print(-(-c // 2))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
A, B = (int(x) for x in input().split(' '))

for i in range(1001):
  p8 = math.floor(i*0.08)
  p1 = math.floor(i*0.10)
  
  if p8 == A and p1 == B:
    print(i)
    break
  
  if i >= 1000:
    print(-1)

Submission status: Accepted

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

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    a,b = LI()
    for i in range(b*10,(b+1)*10):
        if math.floor(i*0.08) == a:
            return i

    return -1


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

c = 1
while True:
    if math.floor(c*0.08) == a and math.floor(c*0.1) == b:
        print(c)
        break
    
    if c == 100000:
        break
    
    c += 1

if c == 100000:
    print(-1)

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
y = 0
while y <= 1000:
	if math.floor(y * 0.08) == A and math.floor(y * 0.1) == B:
		print(y)
		break
	y += 1
else:
	print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i  in range(1010):
  if int(i*0.08)==a and int(i*0.1)==b:
    li.append(i)
    ans=li[0]
    break
  else:
    ans=-1
print(ans)

Submission status: Accepted

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

d = {}
for n in range(1250, 0, -1):
    a = int(n * 0.08)
    b = int(n * 0.10)
    if 1 <= a and 1 <= b:
        d[(a, b)] = n

print(d.get((A, B), -1))

Submission status: Accepted

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

# low =  math.floor(A / 0.08)
low =  math.ceil(A / 0.08)
high = math.floor((A+1) / 0.08)

# low_B = math.floor(B / 0.1)
low_B = math.ceil(B / 0.1)
high_B = math.floor((B+1) / 0.1)

is_found = False
for price in range(low,high) :
    # print(price)
    if (low_B <= price and price < high_B) :
        is_found = True
        print(price)
        break

if (not is_found) :
    print("-1")

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

for i in range(1,1250):
  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())

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

Submission status: Accepted

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

for i in range(1,1001):
    pa = math.floor(i * 0.08)
    pb = math.floor(i * 0.1)

    if pa == a and pb == b :
        result = i
        break
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

sys.setrecursionlimit(1000000)
input = lambda: sys.stdin.readline().rstrip()

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

i = 1
while True:
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        exit(0)
    if math.floor(i * 0.1) > B:
        break
    i += 1

print(-1)

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
ans = []
for i in range(1,1300):
    if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
        ans.append(i)
if ans == []:
    print(-1)
else:
    print(min(ans))

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
ans = 0
a_min = math.ceil(12.5 * a)
a_max = 12.5 * (a + 1)
b_min = math.ceil(10 * b)
b_max = 10 * (b + 1)
min = max(a_min,b_min)
if min < a_max and min < b_max:
    ans = min
else:
    ans = -1
print(int(ans))

Submission status: Accepted

Solution code:
import math

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

for i in range(1, 1009 + 1):
    if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
        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, 1025 + 1):
    if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
        answer = i
        break
else:
    answer = -1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a=input().split()
A,B=int(a[0]),int(a[1])
flg=0
for i in range(1,1001):
    if(math.floor(i*0.08)==A and math.floor(i*0.10)==B):
        print(i)
        flg=1
        break
if(flg==0):
    print(-1)

Submission status: Accepted

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

## 全探索
for i in range(1,1010,1):
  ans_8 = int(i * 0.08)
  if A == ans_8:
    ans_10 = int(i * 0.10)    
    if B == ans_10:
      print(i)
      exit()
else:
  print('-1')

Submission status: Accepted

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

for num in range(12000):
    a_ = int(num * 0.08)
    b_ = int(num * 0.1)
    if a_ == a and b_ == b:
        print(num)
        break
else:
  print(-1)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline
from bisect import *
from collections import *
from heapq import *
INF = 500000
mod = 10**9+7

A, B = map(int, input().split())
s1, s2 = set(), set()
for i in range(10000):
    if int(i*0.08) == A:
        s1.add(i)
    if int(i*0.10) == B:
        s2.add(i)
s = s1 & s2
if len(s) == 0:
    print(-1)
else:
    print(min(s))