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: Wrong Answer

Solution code:
ans=0
a,b=map(int,input().split())
for i in range(1000):
    ans1=int(i*1.08)
    ans2=int(i*1.1)
    ans11=ans1-i
    ans22=ans2-i
    if ans11==a and ans22==b:
        print(i)
        exit(0)
print(-1)

Submission status: Wrong Answer

Solution code:
import sys
a,b = map(lambda x: int(x),input().split())

for i in range(100) :
    a_tax = int((a + i*0.01)* (1/0.08))
    if a_tax < 13 :
        continue
    for j in range(100) :
        b_tax = int((b + j*0.01)* (1/0.1))
        if b_tax < 10 :
            continue
        if a_tax == b_tax :
            print(int(a_tax))
            sys.exit()
print(-1)

Submission status: Wrong Answer

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

a=math.ceil(A*12.5)
b=math.ceil((A+1)*12.5)
c=math.ceil(B*10)
d=math.ceil((B+1)*10)

if b-a==0:
  if c<=a<=d:
    print(a)
  else:
    print(-1)
else:
  if b<c or a>d:
    print(-1)
  else:
    while a+k<c:
      k+=1
    print(a+k)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-03-07 21:21:27 +0900
# LastModified: 2020-03-07 21:46:19 +0900
#




def main():
    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
    s_a = [i for i in range(int(a_min),int(a_max))]
    s_b = [i for i in range(int(b_min),int(b_max))]
    for common in s_a:
        if common in s_b:
            print(common)
            return
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

while 1:
  to += 1
  c = int(to * 0.08)
  d = int(to * 0.1)
  if c == a and d == b:
    print(to)
    exit()
  elif to == 100:
    print(-1)
    exit()

Submission status: Wrong Answer

Solution code:
import math
 
blue, red = map(int, input().split())
 
blueA = math.ceil(((blue) / 8) * 100)
blueB = math.floor(((blue+1) / 8) * 100)
 
redA = math.ceil((red / 10) * 100)
redB = math.floor(((red+1) / 10) * 100)

if blueA <= redA:
    if blueB >= redA:
        print(redA)
    else:
        print("-1")
else:
    if redB >= blueA:
        print(blueA)
    else:
        print("-1")

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

a, b = input_nums()

a_rate = 0.08
b_rate = 0.1

al = int(a / a_rate)
ar = int((a+1) / a_rate)
bl = int(b / b_rate)
br = int((b+1) / b_rate)

ans = 0
if bl <= al and al < br:
    ans = al
elif bl <= ar and ar < br:
    ans = bl
elif al <= bl and br <= ar:
    ans = bl
else:
    ans = -1

if not ans == -1 and int(ans*0.08) < a:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

A = int((a + 1) / 0.08)
a = int(a / 0.08)

B = int((b + 1) / 0.1)
b = int(b / 0.1)

if A >= B and B >= a:
    if a > b:
        print(a)
    else:
        print(b)
elif B >= A and A >= b:
    print(b)
else:
    print("-1")

Submission status: Wrong Answer

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

    resultA = A // 0.08
    resultB = B // 0.1

    #print(resultA)
    #print(resultB)
    answer = -1

    if(round(resultA * 0.08) == A and round(resultA * 0.1) == B):
        answer = resultA
    if(round(resultB * 0.08 == A and round(resultB * 0.1) == B)):
        answer = resultB

    print(int(answer))

    #print(int(answer))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

at = int(A/0.08)
bt = int(B/0.1)
if at == bt:
    print(at)
    exit()

for i in range(min(at, bt), 1250):
    i += 1
    aa = int(i*0.08)
    bb = int(i*0.1)
    if aa == bb:
        print(i)
        exit()
print("-1")

Submission status: Wrong Answer

Solution code:
import sys
import math

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

if A > B:
    print(-1)
    sys.exit()

c_A = math.floor(A/0.08)
c_B = math.floor(B/0.10)

#print(c_A, c_B)

if  c_A == c_B:
    print(c_A)
    sys.exit()


mymin = min(c_A, c_B)
mymax = max(c_A, c_B)

for i in range(mymin, mymax+1):
    #print(i, math.floor(i*0.08),math.floor(i*0.10))
    if math.floor(i*0.08) == A and  math.floor(i*0.10) == B:
        print(i)
        sys.exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math

def calc_list(X, z):

  root = math.ceil(X * (100 / z))
  origin = root
  l = [root]

  while True:
    if int((root + 1) * (z / 100)) == X:
      l.append(root + 1)
      root += 1
    else: break
  
  root = origin

  while True:
    if int((root - 1) * (z / 100)) == X:
      l.append(root - 1)
      root -= 1
    else: break

  return set(l)

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

# 8%でA円になる金額を求める
a = calc_list(A, 8)

# 10%でB円になる金額を求める
b = calc_list(B, 10)

# 一致しているものがあればその金額、なければ-1を出力する
c = a & b
if len(c) > 0:
  c = list(c)
  list(c).sort()
  print(int(c[0]))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

left_a = math.floor(a/0.08)
seg_a = (left_a, left_a + 12)

left_b = b/0.1
seg_b = (left_b, left_b + 9)

if seg_b[1] < seg_a[0]:
    print(-1)
else:
    print(int(seg_a[0]))

Submission status: Wrong Answer

Solution code:
import sys
from math import floor, ceil

def input():
    return sys.stdin.readline()[:-1]


A, B = map(int, input().split())
"""
let1 = ceil(A*12.5)
ov1 = floor((A+1)*100/8)
let2 = B*10
ov2 = (B+1)*10
select1 = set([i for i in range(let1 , ov1+1)])
select2 = set([i for i in range(let2 , ov2)])
print(select1, select2)
sel = select1 & select2
if sel == set():
	print(-1)
else:
	print(min(sel))
"""
A_ = []
B_ = []
for i in range(1, 101):
	if floor(i*0.08) == A:
		A_.append(i)

	if floor(i*0.1) == B:
		B_.append(i)

A_ = set(A_)
B_ = set(B_)
sel = A_ & B_
if sel == set():
	print(-1)
else:
	print(min(sel))

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
C=max(math.ceil(100*A/8),math.ceil(10*B))
D=min(math.floor(100*(A+1)/8),math.floor(10*(B+1)))
if C>D:
    print("-1")
else:
    print(C)

Submission status: Wrong Answer

Solution code:
import math
a, b = (int(i) for i in input().split())
x = a / 0.08
flag = False
if (math.floor(x * 0.1) == b):
    flag = True
else:
    for i in range(8):
        x = x + i
        if (math.floor(x * 0.1) == b):
            flag = True
            break
if flag:
    print(int(x))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
ans = []
for i in range(1,101):
    if a == int(i*0.08) and b == int(i*0.1):
        ans.append(i)

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
x=a/0.08
y=b/0.10
if(x<0 or y<0):
    print(-1)
elif(x==y):                                                                                                                             print(int(x))
else:
    xx=int(x*0.10)
    yy=int(y*0.08)
    if(xx==b and yy==a):
        print(int(min(x,y)))
    elif(xx==b):                                                                                                                            print(int(x))
    elif(yy==a):
        print(int(y))
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
ansA=A*100/8
ansB=B*100/10

# print(ansA,ansB)
# print(int(ansA*0.08))
# print(int(ansA*0.10))
if 0<=ansA-ansB and ansA-ansB<10 and (int(ansA*0.08)==A and int(ansA*0.10)==B):
    print(int(max(ansA,ansB)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
x = math.floor(A * 25 / 2)
for i in range(13):
  if math.floor(x * 0.1 + i) == B:
    print(int(x))
    break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

a,b = map(int,input().split())
min_x_a = math.floor(a / 0.08)
max_x_a = math.floor((a+1) / 0.08)

min_x_b = math.floor(b / 0.1)
max_x_b = math.floor((b+1) / 0.1)

length_a = max_x_a - min_x_a + 1
list_a = [ min_x_a + i for i in range(length_a)]

length_b = max_x_b - min_x_b + 1
list_b = [ min_x_b + i for i in range(length_b)]

results = set(list_a) & set(list_b)

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

Submission status: Wrong Answer

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

for i in range(1,101):
    x = math.floor(0.08 * i)
    y = math.floor(0.1 * i)
    if x == a and y == b:
        print(i)
        sys.exit()
print(-1)

Submission status: Wrong Answer

Solution code:
from decimal import *

def iin(): return int(input())
def iln(): return list(map(int, input().split()))

tax_rate_a = 8
tax_rate_b = 10

A, B = iln()
# A, B = [2, 2]
# A, B = [8, 10]
# A, B = [19, 99]

orig_price_a = int(A * 100 / tax_rate_a)
orig_price_b = int(B * 100 / tax_rate_b)

print(orig_price_a, orig_price_b)
print(int(Decimal(orig_price_a) * Decimal(0.08)), int(Decimal(orig_price_b) * Decimal(0.10)))

if orig_price_a == orig_price_b  or int(Decimal(orig_price_a) * Decimal(0.08)) == int(Decimal(orig_price_b) * Decimal(0.10)):
    print(orig_price_a)
else:
    print(-1)

Submission status: Wrong Answer

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

a_list = []
b_list = []

tmp_a = A
tmp_b = B

while tmp_a < A+1 and tmp_b < B+1:
    a_list.append(int(tmp_a / 0.08))
    b_list.append(int(tmp_b / 0.1))

    tmp_a += 0.01
    tmp_b += 0.01

for i in a_list:
    for j in b_list:
        if i == j:
            print(i)
            exit()
print(-1)

Submission status: Wrong Answer

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


def calc_a(n):
    return n // 0.08


def calc_b(n):
    return n / 0.1


estimate = int(min(calc_a(a), calc_b(b)))
ans = 0
for i in range(estimate, estimate*2):
    if math.floor(estimate * 0.08) == a and math.floor(estimate * 0.1) == b:
        print(estimate)
        exit()

print(-1)

Submission status: Wrong Answer

Solution code:
[A, B] = list(map(int, input().split()))
a = int(12.5 * A)
b = int(10 * B)
if a > b:
  a_dash = int(a * 0.1)
  if a_dash == B:
    ans = a
  else:
    ans = -1
elif a < b:
  b_dash = int(b * 0.8)
  if b_dash == A:
    ans = b
  else:
    ans = -1
else:
  ans =a

print(ans)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
N=0
flag=0
while N<100 and flag==0:
  N += 1
  a = math.floor(N * 0.08)
  b = math.floor(N * 0.1)
  #print(N,a,b)
  if a==A and b==B:
    flag = 1
    
if flag==1:
  print(N)
else:
  print('-1')

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
ans = -1
N = math.floor(A/0.08)
M = math.floor(B/0.08)

for i in range(min(N+1,M+1)):
    if math.floor(0.08*i) == A and math.floor(0.10*i) == B:
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
if a < 1 or b < 1:
    print(-1)
else:
    amin = a*100//8 + ((a*100)%8 and 1)
    amax = (a+1)*100//8 + (((a+1)*100)%8 or 1)
    bmin = b*100//10 + ((b*100)%10 and 1)
    bmax = (b+1)*100//10 + (((b+1)*100)%10 or 1)
    A = set(range(amin, amax))
    B = set(range(bmin, bmax))
    if (A & B):
        print(min(A&B))
    else:
        print(-1)

Submission status: Wrong Answer

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

prca = math.ceil(a / 0.08)
prcb = math.ceil(b / 0.1)
base = max(prca, prcb)
print(prca,prcb,base)
while True:
    if int(base * 0.08) < a or int(base * 0.1) < b:
        ans = base + 1
        break
    base -= 1

if int(ans * 0.08) != a or int(ans * 0.1) != b:
    ans = -1
    
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

x = a * 100 / 8
y = (a+1) * 100 / 8
z = b * 100 / 10
w = (b+1) * 100 / 10
    
if z <= x and x <= w and w <= y:
    print(math.ceil(x))
elif x <= z and z <= y and y <= w:
    print(math.ceil(z))
else:
    print(-1)

Submission status: Wrong Answer

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

UE_8 = (A+1)/0.08
SHITA_8 = A/0.08
UE_10 = (B+1)/0.10
SHITA_10 = B/0.10

if UE_8 < SHITA_10 or UE_10 < SHITA_8:
    print(-1)
else:
    i = math.ceil(SHITA_8)
    j = math.floor(UE_8)
    for n in range(int(i),int(j+1),1):
        if i < UE_10 and i >= SHITA_10:
            print(i)
            break
        i+=1

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
c = a*100//8
d = (a+1)*100//8
e = b*100//10
f = (b+1)*100//10
for i in range(d-c):
  if c+i>=e and c+i<f:
    print(c+i)
    break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
from sys import stdin

def main():

    input = stdin.readline

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

    ans_num_A = A * 100 / 8

    if(B == int(ans_num_A) // 10):
        print(int(ans_num_A))
    else:
        print("-1")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a1 = set([int((a + i/100) * 12.5) for i in range(1000)])
b1 = set([int((b + i/1000) * 10) for i in range(1000)])
res = a1 & b1
if res:
    print(min(res))
else:
    print(-1)

Submission status: Wrong Answer

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

if a % 2 != 0 or b % 2 != 0:
   print(-1)
   exit()

x = int(max(a/0.08, b/0.1) * 10 // 10)

while True:
   ta = (x * 0.08 * 10) // 10
   tb = (x * 0.10 * 10) // 10
   if ta == a and tb == b:
      print(x)
      exit()
   else:
      x += 1

Submission status: Wrong Answer

Solution code:
A,B=map(float,input().split())
A_min=int(A/8*100)
A_max=int((A+1)/8*100)
ans=0
flag=False
for i in range(A_min,A_max+1):
    if int(i*0.1)==B:
        ans=i
        flag=True
        break
if flag:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(1001):
    if int(i*0.08)>=A:
        PA = i
        break
    else:
        None

print(PA)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=0
a1=int(a/0.08)
b1=int(b*10)
for i in range(0,10):
    a2=a1+i
    for j in range(0,13):
        b2=b1+j
        d=a2-b2
        if d==0:
            c=a2
            break
    if c>0:
        break
if c==0:
    print("-1")
else:
    print(c)

Submission status: Wrong Answer

Solution code:
def main():
    a, b = map(int, input().split())
    x = int(a / 0.08)
    y = int(b / 0.10)
    if int(x * 0.10) == b:
        print(x)
    else:
        print('-1')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
value = int(A / 0.08)
limit = math.ceil((A + 1) / 0.08)
while value < limit:
    if B == int(value * 0.1):
        print(value)
        break
    value += 1
else:
    print('-1')

Submission status: Wrong Answer

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

AA = A*100//8
BB = B*10
AAA = [i for i in range(AA,(A+1)*100//8)]
BBB = [i for i in range(BB,(B+1)*10)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list and (min(AB_list)<=1000) else -1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b =map(int,input().split())
# mは原価
m = int(a*(100/8))
while int(m*(8/100)) == a:
    if int(m*0.1) == b:
        print(m)
        break
    else:
        m += 1
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
A=math.ceil((a+1)/0.08)-1
B=math.ceil((b+1)/0.1)-1
A_=math.ceil(a/0.08)
B_=math.ceil(b/0.1)
if b>80 or A<B_:
    print(-1)
else:
    print(A_)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
tmp = range(int(y/0.1), int((y+1)/0.1)+1)
ans=-1
for i in range(int(x/0.08), int((x+1)/0.08)+1):
    if i in tmp:
        ans=i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

if b != math.floor(5/4 * a):
    print('-1')
else:
    
    print(math.floor(10 * 5/4 * a))

Submission status: Wrong Answer

Solution code:

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

#maxA = A+0.99
#maxB = B+0.99

maxA = A+1
maxB = B+1

gAmin = A/8 * 100
gAmax = maxA/8 * 100

gBmin = B*10
gBmax = maxB * 10

#print(gAmin)
#print(gAmax)
#print(gBmin)
#print(gBmax)

if gAmax <= gBmin or gBmax <= gAmin:
    ans = -1
elif gAmin <= gBmin:
    ans = gBmin
else:
    ans = gAmin

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math

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

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

print(ans)

Submission status: Wrong Answer

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

A_min = int(A * 25 // 2)
A_max = int((A + 1) * 25 // 2)
B_min = int(B * 100 // 10)
B_max = int((B + 1) * 100 / 10)
# print(B_min, B_max)
A_list = list(range(A_min, A_max + 1))
B_list = list(range(B_min, B_max + 1))

min_ans = -1
for num in A_list:
    if num in B_list:
        min_ans = num
        break
    else:
        continue

print(min_ans)

Submission status: Wrong Answer

Solution code:
from math import floor, ceil

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

x1b = floor(100 * A / 8)
x2b = floor(10 * B)

x1t = floor(100 * (A + 1) / 8 - 0.0001)
x2t = floor(10 * (B + 1) - 0.0001)

if (x2b <= x1t and x1b <= x2t) or (x1b <= x2t and x2b <= x1t):
    print(max(x1b, x2b))
else:
    print('-1')

Submission status: Wrong Answer

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

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

f = 0
for i in range(1,101):
    if a == int(i*0.08) and b == int(i*0.1):
        print(i)
        f = 1
        break

if f == 0:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
a,b = map(lambda x: int(x),input().split())

for i in range(100) :
    a_tax = int((a + i*0.01)* (1/0.08))
    if a_tax < 13 :
        print(-1)
        sys.exit()
    for j in range(100) :
        b_tax = int((b + j*0.01)* (1/0.1))
        if b_tax < 10 :
            print(-1)
            sys.exit()
        if a_tax == b_tax :
            print(int(a_tax))
            sys.exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = list(map(int, input().split(' ')))
e = True
for i in range(11, 1000):
    n8 = math.floor(i * 0.08)
    n10 = math.floor(i*0.1)
    if n8 == a and n10 == b:
        print(i)
        e = False
        break
if e:
    print(-1)

Submission status: Wrong Answer

Solution code:
def find(a, b):
    ax = int(a / 0.08)
    bx = int(b / 0.1)
    for arange in range(12 + 1):
        axn = ax + arange
        for brange in range(10 + 1):
            bxn = bx + brange
            if axn == bxn:
                return axn
    return -1


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

Submission status: Wrong Answer

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

for i in range(8):
    j=b
    j+=i 
    if int(j*0.08)==a:
        ans=j
        break
if ans!=0:
    print(ans)
else :
    print(-1)

Submission status: Wrong Answer

Solution code:
def get_max_min(n, p):
    return [int(p*n), int(p*(n+1))]
  
data = input()
A, B = [int(i) for i in data.split()]

a_data = get_max_min(A, 1/0.08)
b_data = get_max_min(B, 10)

result = -1

if (a_data[1] < b_data[0]) or (b_data[1] < a_data[0]):
    result = -1
elif a_data[0] <= b_data[0] <= a_data[1]:
    result = b_data[0]
elif b_data[0] <= a_data[0] <= b_data[1]:
    result = a_data[0]
else:
    result = -1
    
print(result)

Submission status: Wrong Answer

Solution code:
import math

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

#x=A/0.08
y=B/0.10

ans=100
max_y=( int(y) + 10 )%100
for i in range(1,max_y):
  v_08 = math.floor(i * 0.08)
  v_10 = math.floor(i * 0.1)
  
  if v_08==A and v_10==B:
    ans=min(ans,i)

print(ans)

Submission status: Wrong Answer

Solution code:
import math
a=input().split()
A,B=int(a[0]),int(a[1])
p=math.floor(A/0.08)
p1=math.floor(B/0.10)
if(p==p1):
  print(p)
else:
  print(-1)

Submission status: Wrong Answer

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

    resultA = A / 0.08
    resultB = B / 0.1

    #print(resultA)
    #print(resultB)
    answer = -1

    if(round(resultA * 0.08) == A and round(resultA * 0.1) == B):
        answer = resultA
    if(round(resultB * 0.08 == A and round(resultB * 0.1) == B)):
        answer = resultB

    print(int(answer))

    #print(int(answer))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

a=math.floor(A*12.5)
b=math.floor((A+1)*12.5)
c=math.floor(B*10)
d=math.floor((B+1)*10)

if b-a==0:
  if c<=a<=d:
    print(a)
  else:
    print(-1)
else:
  if b<c or a>d:
    print(-1)
  else:
    while a+k<c:
      k+=1
    print(a+k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_min = float(a)/8*100
a_max = float(a+1)/8*100
b_min = float(b)/10*100
b_max = float(b+1)/10*100

o_min = max(a_min, b_min)
o_max = min(a_max, b_max)

import math

if math.ceil(o_min) < o_max:
    print(str(math.ceil(o_min)))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import math

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

for n in range(0, 10):
  x = (A + n/10) / 0.08
  x = math.floor(x)
  if math.floor(x * 0.1) == B:
    print(int(x))
    exit()
print("-1")

Submission status: Wrong Answer

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

ans1 = int(A *100// 8) 
ans2 = int(B *100 // 10)

if ans1 >= ans2:
    ans2_2 = int((B+1) *100 // 10)
    list = [int(ans2)]

    for i in range(ans2+1,ans2_2+1):
        list.append(int(i)) 
    
    if int(ans1) in list:
        print(ans1)
    else:
        print(-1)
else:
    ans1_2 = int((A+1) *100 // 8)
    list = [int(ans1)]

    for i in range(ans1+1,ans1_2+1):
        list.append(int(i)) 
    
    if int(ans2) in list:
        print(ans2)
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
import math

def main():

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

    p = a / 0.08

    if math.floor(p * 0.1) == b:
        print(int(p))
    else:
        print(-1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = sorted([A * 100 // 8, (A+1) * 100 // 8])
y = sorted([B * 100 // 10, (B+1) * 100 // 10])

and_ = set(range(x[0], x[1]+1)) & set(range(y[0], y[1]+1))

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

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
nazos=10*B
if nazos<10:
  print(-1)
  exit()
elif math.floor(nazos*0.08)==A:
  print(nazos)
else:
  while True:
    nazos+=1
    if math.floor(nazos*0.08)==A:
      print(nazos)
      exit()
    if nazos>1000:
      print(-1)
      break

Submission status: Wrong Answer

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

judge = int(d / 0.1)
tax8 = int(c / 0.08)

flag = True

while judge <= tax8 and int(judge*0.1)==d:
  if (int(judge*0.08) == c) and (int(judge*0.1) == d):
    print(judge)
    flag = False
    break
  else:
    judge += 1

if flag:
    print("-1")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
amin = -(-a*25//2)
amax = -(-(a+1)*25//2)
bmin = b*10
bmax = bmin + 10
print(amax)
for i in range(amin, amax):
    for j in range(bmin, bmax):
        if i == j:
            print(i)
            exit()
print(-1)

Submission status: Wrong Answer

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

X = A/0.08
Y = B/0.1

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

Submission status: Wrong Answer

Solution code:
import math
A,B = list(map(int,input().split()))
min = math.floor(A / 0.08)
max = math.floor((A + 1) / 0.08) + 1
ans = -1

for i in range(min,max):
    C = math.floor(i * 0.1)
    if B == C:
        ans = i
        break
print(ans)

Submission status: Wrong Answer

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

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

temp_a1 = 100 * a // 8
temp_a2 = 100 * (a + 1) // 8
temp_b1 = 10 * b
temp_b2 = (10 * (b + 1)) - 1

result = -1
for i in range(int(temp_a1), int(temp_a2)):
    if temp_b1 <= i <= temp_b2:
        result = i
        break

print(result)

Submission status: Wrong Answer

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

x_min = A * 12.5
if x_min.is_integer:
  x_min = int(x_min // 1)
else:
  x_min = int((x_min // 1) + 1)

ans = -1
n = int(x_min)
while True:
  if n // 12.5 != A:
    break
  if n // 10 == B:
    ans = n
    break
  n += 1

print(ans)

Submission status: Wrong Answer

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

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

print(-1)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

a, b = input_nums()

a_rate = 0.08
b_rate = 0.1

al = a / a_rate
ar = (a+1) / a_rate
bl = b / b_rate
br = (b+1) / b_rate

ans = 0
if bl <= al and al < br:
    ans = int(al)
elif bl <= ar and ar < br:
    ans = int(bl)
elif al <= bl and br <= ar:
    ans = int(bl)
else:
    ans = -1

if not ans == -1 and int(ans*0.08) < a:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c = a*100//8
d = (a+1)*100//8
e = b*100//10
f = (b+1)*100//10
for i in range(d-c):
  if c+i-1>=e and c+i-1<f:
    print(c+i-1)
    break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
x1 = 100 * A / 8
x2 = 100 * (A+1) / 8
y1 = 100 * B / 10
y2 = 100 * (B+1) / 10
if x1 <= y1 < x2:
  print(int(y1))
elif y1 <= x1 < y2:
  print(int(x1))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
tmp = range(int(y/0.1), int((y+1)/0.1)-1)
ans=-1
for i in range(int(x/0.08), int((x+1)/0.08)-1):
    if i in tmp:
        ans=i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import math

A, B = map(int, input().split(' '))
A_list = [i/10+A for i in range(0, 10)]
B_list = [i/10+B for i in range(0, 10)]
x, y = 0, 0
a_set = set()
b_set = set()
for a in A_list:
    a_set.add(math.floor(a/0.08))
for b in B_list:
    b_set.add(math.floor(b/0.1))
ans_list = list(a_set & b_set)
if len(ans_list) == 0:
    print(-1)
else:
    print(int(min(ans_list)))

Submission status: Wrong Answer

Solution code:
import math
 
A, B = list(map(int, input().split()))
 
rangeA = [A / 0.08, (A + 1) / 0.08]
rangeB = [B / 0.1, (B + 1) / 0.1]
 
if rangeA[0] <= rangeB[0]:
  if math.ceil(rangeB[0]) <= rangeA[1]:
    print(math.ceil(rangeB[0]))
    exit(0)
else:  # rangeA[0] > rangeB[0]
  if math.ceil(rangeA[0]) <= rangeB[1]:
    print(math.ceil(rangeA[0]))
    exit(0)
print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
N=0
flag=0
while N<100 and flag==0:
  N += 1
  a = math.floor(N * 0.08)
  b = math.floor(N * 0.1)
  print(N,a,b)
  if a==A and b==B:
    flag = 1
    
if flag==1:
  print(N)
else:
  print(-1)

Submission status: Wrong Answer

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

pa = [[] for i in range(110)]
pb = [[] for i in range(110)]

for i in range(1000):
  pa[int(i*0.08)].append(i)
  pb[int(i*0.10)].append(i)
  
na = pa[a]
nb = pb[b]

for ca in na:
  if ca in nb:
    print(ca)
    exit()

print(-1)

Submission status: Wrong Answer

Solution code:
import fractions

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


if fractions.gcd(A, B) == 1:
    print('-1')

print(max(12.5 * A, 10*B))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if (math.floor(a / 8 * 10) != math.floor(b)):
    print('-1')
else:
    r1 = math.floor(a / 8 * 100)
    r2 = math.floor(b * 10)
    if r1 > r2:
        print(r1)
    else:
        print(r2)

Submission status: Wrong Answer

Solution code:
A, B = [int(y) for y in input().split(' ')]
priceA_min = int((A/8) * 100)
priceA_max = int(((A+1)/8) * 100)
found = False
for x in range(priceA_min,priceA_max+1,1):
  if int(x*0.1) == B:
    print(x)
    found = True
    break
if not found:
  print(-1)

Submission status: Wrong Answer

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

A = int((a + 1) / 0.08)
a = int(a / 0.08)

B = int((b + 1) / 0.1)

if A >= B and B >= a:
    print(a)
elif B >= A and A >= b:
    print(b)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
A,B = [int(i) for i in input().split()]
emax = int((A + 1) / 0.08)
emin = int(A / 0.08)
tmax = int((B + 1) / 0.1)
tmin = int(B / 0.1)

if emin < tmax and emin >= tmin:
    print(int(emin))
elif tmin < emax and tmin >= emin:
    print(int(tmin))
else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(1001):
    if int(i*0.08)>=A:
        PA = i
        break
    else:
        None

if B+1 > PA*0.1 >= B:
    print(PA)

else:
    print(-1)

Submission status: Wrong Answer

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

p1 = int(a*100//8)
p2 = int(b*100//10)
#print(p1, p2)
for x in range(p2, p1+1):
    A = int(x*8//100)
    B = int(x*10//100)
    #print(x, A, B)
    if a==A and b==B:
        print(x)
        exit()
print(-1)