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:
a, b = map(int, input().split())

no_tax_1 = a * 100 // 8
no_tax_2 = a * 100 // 7

while no_tax_1 <= no_tax_2:
    if round(no_tax_1 * 0.1) == b:
        print(no_tax_1)
        exit()
    no_tax_1 += 1
print(-1)

Submission status: Wrong Answer

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

a = 100* a
b = 100 * b
al=-int(-a//8)
ah = int((a+100)//8)
bl=-int(-b//10)
bh = int((b+100)//10)
if bl > al:
    cl = al
    ch = ah
    dl = bl
    dh = bh
else:
    cl = bl
    ch = bh
    dl = al
    dh = ah


#print(cl, ch, dl, dh)
if ch < dl:
    print(-1)
else:
    print(dl)

Submission status: Wrong Answer

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

lsta = list(range(int(12.5*A), int(A/7*100)))

ans = -1

for i in lsta:
    if int(i*0.1)==B:ans=i
    break
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
 
N_A = A / 0.08
N_B = B / 0.1
 
A_list = list()
N = N_A
while N * 0.08 < A+1:
    A_list.append(N)
    N += 1
 
B_list = list()
N = N_B
check = 0
while N * 0.10 < B+1:
    if N in set(A_list):
        check = 1
        print(int(N))
        break
    
    N += 1

if check == 0:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
import math
A, B = map(int, input().split())
if A == math.ceil(B * 8/10):
  print(A*100//8)
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)
    while i <= j:
        if i < UE_10 and i >= SHITA_10:
            print(i)
        i+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A = []
B = []
S = []

for i in range(12):
    A.append((12.5*a)+i)

for k in range(10):
    B.append((10*b)+k)
    
if len(list((set(A))& set(B))) > 0:
    S = list((set(A))& set(B))
    print(min(S))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

val1 = math.floor(a / 0.08)
val2 = math.floor(b / 0.1)
ans = []

for i in range(0, 101):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans.append(i)
if ans:
    print(min(ans))
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c1 = ( A / 0.08 ) ;
c2 = ( (A+1) / 0.08 ) ;
c3 = int ( c2 ) ;

if c2 == c3 :
	c3 = c3 -1 ; 

d1 = ( B / 0.10 ) ;
d2 = ( (B+1) / 0.10 ) ;
d3 = int ( d2 ) ;

if d2 == d3 :
	d3 = d3 -1 ; 

if d3 < c1 or c3 < d1  :
	print ( -1 );
else :
	print ( int ( max ( c1  ,d1 ) ) ) ;

Submission status: Wrong Answer

Solution code:
import math

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

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

print(result)

Submission status: Wrong Answer

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

price = math.ceil(a * 100 / 8)

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
def main():
    A,B = map(int,input().split())
    ansA = math.floor(A/0.08)
    if math.floor(0.1*ansA) == B:
        print(ansA)
        return
    ansB = math.floor(B/0.1)
    if math.floor(0.08*ansB) == A:
        print(ansB)
        return
    print('-1') 


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
#print(a/0.08,(a+1)/0.08)
#print(b/0.1,(b+1)/0.1)
x=max(a/0.08,b/0.1)
y=min((a+1)/0.08,(b+1)/0.1)

if x<y:
    print(int(x))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
for num in range(1,101):
    ai = num//(100/8)
    bi = num//(100/10)
    if (a==int(ai)) and (b==int(bi)):
        print(num)
        exit()
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

blue, red = map(int, input().split())

blueA = math.floor(((blue) / 8) * 100)
blueB = math.floor(((blue+1) / 8) * 100)

redA = math.floor((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:
A, B = map(int,input().split())
a = A / 0.08
b = B / 0.1
ans = int(max(a, b))

aa = int((A+1) / 0.08)
bb = int((B+1) / 0.1) - 1

if ((A+1) / 0.08)%10 == 0:
    aa -= 1
    
if aa < b or bb < a:
    print("-1")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

#print(A,B)

ans = -1

for i in range(10,101):
  ta = math.floor(i * 0.08)
  tb = math.floor(i * 0.1)
  #print(ta,tb)
  if ta == A and tb == B:
    ans = i
    break

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = tuple(map(int, input().split()))
min_a = a / 0.08
max_a = (a + 1) / 0.08
min_b = b / 0.1
max_b = (b + 1) / 0.1

if max_a <= min_b:
    print(-1)
else:
    print(int(max(min_a, min_b)))

Submission status: Wrong Answer

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

a = A//0.08
b = B//0.1
a2 = (A+1)//0.08
b2 = (B+1)//0.1
ans = max(a,b)
if a > b:
    if a > b2:
        ans = -1
else:
    if b > a2:
        ans = -1
print(int(ans))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

a_target1 = a / 0.08
a_target2 = (a + 1) / 0.08

b_target1 = b / 0.1
b_target2 = (b + 1) / 0.1


result_list = []

for i in range(int(a_target1), int(a_target2) - 1):
    if i >= b_target1 and i < b_target2:
        result_list.append(i)

if result_list == []:
    print(-1)
else:
    result = min(result_list)
    print(result)

Submission status: Wrong Answer

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

a_before = a / 0.08

if int(a/0.08) == a/0.08:
    a_min = int(a/0.08)
    a_max = int((a+1)/0.08)
elif int((a+1)/0.08) == (a+1)/0.08:
    a_max = int((1+a)/0.08 - 1)
    a_min = int(a/0.08 + 1)
else:
    a_min = int(a/0.08 + 1)
    a_max = int((a+1) / 0.08)

if int(b/0.1) == b/0.1:
    b_min = int(b/0.1)
    b_max = int((b+1)/0.1)
elif int((b+1)/0.1) == (b+1)/0.1:
    b_max = int((1+b)/0.1 - 1)
    b_min = int(b/0.1 + 1)
else:
    b_min = int(b/0.1 + 1)
    b_max = int((b+1) / 0.1)

if a_min >= b_min:
    if a_min <= b_max:
        print(a_min)
    else:
        print(-1)
elif b_min > a_min:
    if b_min <= a_max:
        print(b_min)
    else:
        print(-1)

Submission status: Wrong Answer

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

if (int(a / 8 * 10) != int(b)):
    print('-1')
else:
    r = int(a / 8 * 100)
    print(r)

Submission status: Wrong Answer

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

a = A / 0.08
b = B / 0.1
print(a, b)

if a / 10 == b / 10 or abs(a / 10 - b/10) <= 1:
    print(int(max(a, b)))
else:
    print('-1')

Submission status: Wrong Answer

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

number1 = int(A*100/8)
number2 = int(B*100/10)

if number1//10 == B:
    if number2*8//100 == A:
        if number1 <= number2:
            print(number1)
        else:
            print(number2)
    else:
        print(number1)
else:
    if number2*8//100 == A:
        print(number2)
    else:
        print(-1)

Submission status: Wrong Answer

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

beforeA = range(int(a * (100 / 8)), int((a+1) * (100 / 8)))
beforeB = range(b * 10, (b+1) * 10)
ans = 990990990
flag = False
for i in beforeA :
    for j in beforeB :
        #print(i, j)
        if i == j :
            flag = True
            ans = min(ans, i)
if flag :
    print(ans)
else :
    print(-1)


#print(beforeA, beforeB)

Submission status: Wrong Answer

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

Idic = {}

ans = -1

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

Submission status: Wrong Answer

Solution code:
Z = list(map(int,input().split()))
c=[]
for i in range(1,101):
  c.append([i*0.08//1,i*0.1//1])

print(c.index(Z)+1 if Z in c else -1)

Submission status: Wrong Answer

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

#X * 0.08 = A
#X * 0.10 = B

#print(A/0.08,B/0.1)
end = int(A/0.08) + 2
start = int(B/0.1) - 2

#print(start,end)

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

Submission status: Wrong Answer

Solution code:
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

def main():
    a,b = map(int,input().split())
    ans = []
    for i in range(10):
        for j in range(10):
            x = (a+i/10)/0.08
            y = (b+j/10)/0.1
            if x==y and x%1==0 and y%1==0:
                ans.append(int(x))
    if len(ans):
        print(min(ans))
    else:
        print(-1)
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

X = round(A/0.08)
Y = round(B/0.1)

print(min(X,Y))

Submission status: Wrong Answer

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

res1 = int(a / 0.08)

if int(res1 * 0.1) == b:
    print(res1)
else:
    print(-1)

Submission status: Wrong Answer

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

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

if int(PA*0.1) == B:
    print(PA)

else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
a = A / 0.08
b = B / 0.1
if math.floor(a * 0.1) == B:
    print(int(a))
elif math.floor(b * 0.08) == A:
    print(int(b))
else:
    print(-1)

Submission status: Wrong Answer

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

x = floor(a / 0.08)
y = floor(b / 0.1)

x, y = min(x, y), max(x, y)
for i in range(x - 1, y + 1):
    if floor(i * 0.08) == a and floor(i * 0.1) == b:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

exp1 = a / 0.08
exp2 = b / 0.10

print(exp1, exp2)

ans = -1
for i in range(ceil(exp1+11), floor(exp2-10), -1):
  if floor(i * 0.08) == a and floor(i * 0.10) == b:
    ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
  a,b=map(int,input().split())
  for i in (-int(-a/0.08),int((a+1)/0.08)):
    if int(i*0.1)==b:
      return i
  return -1
print(main())

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
Pa=int(a/0.08)
Pb=int(b/0.1)
li=[]
if Pa*0.1>=b and Pa*0.1<b+1:
    li.append(Pa)
if Pb*0.08>=a and Pb*0.08<a+11:
    li.append(Pb)
if len(li)>0:
    print(min(li))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import floor
def main():
    A, B = map(int, input().split())
    minX = -1
    aX = int(A * 100 / 8)
    if int(aX * 0.1) == B:
        minX = aX

    bX = int(B * 100 / 10)
    if int(bX * 0.08) == A:
        if minX == -1:
            minX = bX
        else:
            minX = min(aX, bX)
    print(minX)
    

main()

Submission status: Wrong Answer

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

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

na = int(A / 0.08)
npa = int((A + 1) / 0.08)

nb = int(B / 0.1)
npb = int((B + 1) / 0.1)

if na <= npb and nb <= npa:
    print(max(na, nb))
else:
    print(-1)

Submission status: Wrong Answer

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

ans_min = min(int(a*12.5),int(b*10))
ans_max = max(int(a*12.5),int(b*10))

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

print(-1)

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)
else:
  x_min = int(x_min) + 1

x_max = int((A + 1) * 12.5)

ans = -1
for n in range(x_min, x_max + 1):
  if int(n * 0.1) == B:
    ans = n
    break

print(ans)

Submission status: Wrong Answer

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

#こいつは十の位まで正確
N2 = AB[1] * 10

N1 = int(AB[0] / 0.08)
if (N2 <= N1) and (N1 < (N2 + 10)):
    N = 0
    for i in range(10):
        if (math.floor((N2 + i) * 0.08) == AB[0]):
            N = N2 + i
            break
    print(N)
else:
    print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

a = A/0.08
b = B/0.1
a2 = (A+1)/0.08
b2 = (B+1)/0.1
ans = max(a,b)
if a > b:
    if a > b2:
        ans = -1
else:
    if b > a2:
        ans = -1
print(int(ans))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
x=100*a//8
t=x
c=[]
while int(t*0.08)<a+1:
    c+=[t]
    t+=1
y=10*b
t=y
while int(t*0.1)<b+1:
    if t in c:
        print(t)
        break
    else:
        t+=1
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

val1 = math.floor(a / 0.08)
val2 = math.floor(b / 0.1)
ans = []

for i in range(min(val1,val2), max(val1,val2) + 1):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans.append(i)
if ans:
    print(min(ans))
else:
    print(-1)

Submission status: Wrong Answer

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

na = [a / 0.08, (a+1) / 0.08]
nb = [b / 0.1,  (b+1) / 0.1 ]

if nb[1] < na[0] or na[1] < nb[0]:
    print(-1)
elif na[0] <= nb[0] and nb[0] < na[1]:
    print(int(nb[0]))
elif nb[0] <= na[0] and na[0] < nb[1]:
    print(int(na[0]))

Submission status: Wrong Answer

Solution code:
import math

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

x = (A * 100) // 8
y = (B * 100) // 10
ans = max(x, y)

if (ans * 8) // 100 != A or (ans * 10) // 100 != B:
    ans = -1

print(ans)

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 o_min == o_max:
    if o_min - math.floor(o_min) == 0:
        print(str(math.floor(o_min)))
    else:
        print('-1')
elif o_min < o_max:
    if math.ceil(o_min) <= o_max:
        print(str(math.ceil(o_min)))
    else:
        print('-1')
else:
    print('-1')

Submission status: Wrong Answer

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


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

    for i in range(10 * a, 10 * (a + 1)):
        ai = 25 * i // 20
        numbers1.append(ai)

    for i in range(10 * b, 10 * (b + 1)):
        bi = i
        numbers2.append(bi)

    c = set(numbers1) & set(numbers2)

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

a_min=math.ceil(A/0.08)
b_min=math.ceil(B/0.1)
a_list=[]
b_list=[]

for i in range(a_min,a_min+12):
  a_list.append(i)
for j in range(b_min,b_min+10):
  b_list.append(j)

print(a_list)
print(b_list)
  
ans=-1
for item in a_list:
  if item in b_list:
    ans=item
    break
  
print(ans)

Submission status: Wrong Answer

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

uA=int(A/0.08)
tA=int((A+1)/0.08)
uB=int(B/0.1)
tB=int((B+1)/0.1)

if uA>tB or uB>tA:
    print(-1)
else:
    print(max(uA,uB))

Submission status: Wrong Answer

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

if a/(b+1) < 0.8 and 0.8 < (a+1)/b:
    if a/b<0.8:
        print(int(10*b))
    else:
        print(int(12.5*a))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
sup=min((A+1)/1.08,(B+1)/1.1)
inf=max(A/1.08,B/1.1)
inf2=math.ceil(inf)
if inf2<sup:
  print(inf2)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

cnt = -1
for i in range(1, 1000):
    hachi = math.floor(i * 0.08)
    ju = math.floor(i * 0.1)
    if hachi == a and ju == b:
        cnt = i
        break


print(cnt)

Submission status: Wrong Answer

Solution code:
import math
import sys 
a, b = map(int,input().split())
# ans1 = math.ceil(a/0.08)
# ans2 = math.ceil(b/0.1)
# if ans1 == ans2:
#     print(ans1)
# elif ans1 > ans2:

for i in range(1000):
    ans1 = math.floor(i*0.08)
    ans2 = math.floor(i*0.1)
    if (ans1 == a) & (ans2 == b):
        print(i)
        sys.exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b= map(int,input().split())
kagen = a/0.08
kagen2 = b/0.1
kagen3 = max(kagen,kagen2)
jyougen = (a+1)/0.08
jyougen2 = (b+1)/0.1
jyougen3 = min(jyougen,jyougen2)
sita = math.ceil(kagen3)
ue = math.floor(jyougen3)
if sita <= ue:
  print(round(kagen3))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A, B =  [float(i) for i in input().split(' ')]
x1 =  int(A/0.08)
x2 = int(B/0.10)
x1_f = int(float(x1) * 0.1)
x2_f = int(float(x2) * 0.08)
if x1_f == B:
    print(x1)
elif x2_f == A:
    print(x2)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a,b = [int(a.strip()) for a in input().strip().split(' ')]
    min_a = int(12.5*a)
    max_a = int(12.5*(a+1))

    min_b = 10*b
    max_b = 10*(b+1)

    flg = 0
    for i in range(min_a,max_a):
        if i in range(min_b,max_b):
            print(i)
            flg = 1
            break

    if flg == 0:
        print('-1')

Submission status: Wrong Answer

Solution code:
def solve():
    a,b=map(int,input().split())
    start=int(a*12.5)
    end=int(b*9.9)
    if(start>end):
        start,end=end,start
    for i in range(start,end+1):
        if(int(i*0.08)==a and int(i*0.1)==b):
            print(i)
            return
    print(-1)


solve()

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
res = -1
for x in range(1, 1251):
    if math.ceil(x/0.08)==a and math.ceil(x/0.1)==b:
        res = x
        break
print(res)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
b_min = int(b / 0.1)
b_max = int((b + 1) / 0.1)
a_min = int(a / 0.08)
a_max = int((a + 1) / 0.08)
if a_min == b_min:
    print(a_min)
elif b_min < a_min and b_max > a_min:
    print(a_min)
elif a_min < b_min and a_max > b_min:
    print(b_min)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
import math

A, B = map(int, input().split())
min_ans = math.ceil(A / 0.08)

kouho = [min_ans]
to_continue = True
while to_continue:
    min_ans += 1
    if math.floor(min_ans * 0.08) == A:
        kouho.append(min_ans)
    else:
        break

print_flag = False
for i in kouho:
    if math.floor(i * 0.1) == B:
        print_flag = True
        print(i)
        break
    
if print_flag == False:
    print('No')

Submission status: Wrong Answer

Solution code:
import math


def main():
    a, b = map(int, input().split())
    ans_a = (a * 100) // 8
    ans = math.floor(ans_a * 0.1)
    if b == ans:
        print(ans_a)
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

A_down = (25 * A ) //2

A_up = (25 * (A + 1 )) //2
if A % 2 ==1:
    A_up -= 1

B_down = 10 * B
B_up = 10 * (B + 1) - 1 

if A_up < B_down or B_up < A_down:
    print(-1)
else:
    if  A_down < B_up:
        print(A_down)
    else:
        print(B_down)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
cost_A=A/0.08
cost_B=B*10
if cost_A<=cost_B and cost_B < cost_A+1:
    ans=cost_B
elif cost_B<=cost_A and cost_B <cost_A+1:
    ans=math.floor(cost_A)
else:ans=-1
print(ans)

Submission status: Wrong Answer

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

A_price  = 100 / 8 * A
B_price  = 100 / 10 * B
B_price_max_over = 100 / 10 * (B+1)

if A_price in range(int(B_price), int(B_price_max_over)):
    print(int(A_price))
else:
    print('-1')

Submission status: Wrong Answer

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

al=-int(-a/0.08)
ah = int((a+1)/0.08)
bl=-int(-b/0.1)
bh = int((b+1)/0.1)
if bl > al:
    cl = al
    ch = ah
    dl = bl
    dh = bh
else:
    cl = bl
    ch = bh
    dl = al
    dh = ah


#print(cl, ch, dl, dh)
if ch < dl:
    print(-1)
else:
    print(dl)

Submission status: Wrong Answer

Solution code:
s = list(map(int, input().split()))
n = s[0]
a=s[1]
flag=0
if n/0.08>a/0.1:
    ans=int(a/0.1)
    while ans<=n/0.08:
        if ans*0.08==n:
            flag=1
            break
        ans+=1
else:
    ans = int(n/0.08)
    while ans<=a/0.1:
        if ans*0.1 == a:
            flag=1
            break
        ans += 1
if flag==1:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(float,input().split())
a_base_min = int(a * 25 /2)
a_base_max = int((a+1)*25/2)
b_base_min = int(b *10)
b_base_max = int((b+1) *10)

if (b_base_min <= a_base_min) and (a_base_min <= b_base_max):
    print(int(a_base_min))
elif (a_base_min < b_base_min) and (b_base_min <= a_base_min):
    print(int(b_base_min))
else:
    print(-1)

Submission status: Wrong Answer

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

a_sita = A/0.08 
a_ue = (A+1)/0.08 

b_sita = B/0.10
b_ue = (B+1)/0.10

if a_ue < b_sita or b_ue < a_sita:
  print(-1)

else:
  ans = max(a_sita,b_sita)
  print(int(ans))

Submission status: Wrong Answer

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

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

start = int((a * 100)/8)
candidate1 = list(range(start, start + 13))
start = (b * 10)
candidate2 = list(range(start, start + 10))

ans = -1
for i in candidate2:
    if i in candidate1:
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import math
[a, b] = [int(i) for i in input().split()]
eight = math.floor(a / 8 * 100)
ten = math.floor(b / 10 * 100)
if b == math.floor(eight * 0.1):
    print(eight)
elif a == math.floor(ten * 0.08):
    print(ten)
else:
    print(-1)

Submission status: Wrong Answer

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

pa = int(a * 100/8)
pb = int(b * 100/10)

ans1 = None
ans2 = None

for price in range(pb-1, pa+1):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans1 = price

for price in range(pa-1, pb+1):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans2 = price

if ans1 is None and ans2 is None:
    print(-1)
elif ans2 is None:
    print(ans1)
elif ans1 is None:
    print(ans2)
else:
    print(min(ans1,ans2))

Submission status: Wrong Answer

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

max_val = int(math.ceil(A / 0.08))
min_val = int(math.floor(B / 0.1))

for i in range(min_val, max_val + 1):
    if int(i * 0.08) > A or int(i * 0.1) > B:
        break
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit(0)
print(-1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
import math
if 10*(b+1) <= 12.5*a:
  print(-1)
elif 12.5*(a+1) <= 10*b:
  print(-1)
else:
  print(max(math.floor(12.5*a), 10*b))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
 
def check(X):
  global A
  global B
  return (int)(X*0.08) == A and (int)(X*0.1) == B
 
for x in range(1, max(A, B)*11):
  if check(x):
    print(x)
    exit(0)
 
print(-1)

Submission status: Wrong Answer

Solution code:
a,b= map(int, input().split())
z=-1
x=int(a*100/8)
xx=int((a+1)*100/8)
y=int(b*10)
yy=int((b+1)*10)
if xx==(a+1)*100/8:
    xx=xx-1
xxx= [i for i in range(x,xx+1)]
yyy= [i for i in range(y,yy)]
for i in range(len(xxx)):
    if xxx[i] in yyy:
        z=xxx[i]
        break
print(z)

Submission status: Wrong Answer

Solution code:
S = [int(x) for x in input().split()]
A = S[0]
B = S[1]
ans = -1

for i in range(100):
    num = (i+1)
    MotoA = int(num * 0.08)
    MotoB = int(num * 0.1)
    if MotoA == A and MotoB ==B:
        ans = num
        break

print(ans)

Submission status: Wrong Answer

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

ah=(a+1)//0.08
al=ceil(a/0.08)
bh=(b+1)//0.1
bl=ceil(b/0.1)

if ah < al or bh < bl:
    ans = -1
else:
    if (al <= bh and ah >= bl) or (al >= bh and ah <= bl):
        ans = al
    else:
        ans = -1
        
print(ans)

Submission status: Wrong Answer

Solution code:
from math import floor
def main():
    A, B = map(int, input().split())
    minX = -1
    aX = int(A * 100 / 8)
    if int(aX * 0.1) == B:
        minX = aX

    bX = int(B * 100 / 10)
    if int(bX * 0.08) == A:
        minX = min(aX, bX)
    print(minX)
    

main()

Submission status: Wrong Answer

Solution code:
def main():
  a,b=map(int,input().split())
  for i in (int((a+0.08)/0.08),int((a+1)/0.08)):
    if int(i*0.1)==b:
      return i
  return -1
print(main())

Submission status: Wrong Answer

Solution code:
import math

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

ans = -1
for i in range(1, 1000):
    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:
def main():

    A, B = map(int, input().split())
    v_A = int(A / 0.08)
    v_B = int(B / 0.1)

    if int(v_A * 0.08) == A and int(v_B*0.1) == B:
        print(max(v_A, v_B))
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

a_btm = a*100//8
a_top = (a+1)*100//8

b_btm = b*100//10
b_top = (b+1)*100//10

ans = -1
for aa in range(a_btm,a_top):
    for bb in range(b_btm,b_top):
        if aa == bb:
            ans = aa
            break
    break

print(ans)

Submission status: Wrong Answer

Solution code:
import math
def ccc(a, b):

    aaa = a * 12 + (a / 2)

    bbb = math.floor(aaa * 0.1)

    if b == bbb:
        return int(aaa)
    else:
        return "-1"

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

low_B = math.floor(B / 0.1)
high_B = math.floor(10 / 0.1)

is_found = False
for price in range(low,high) :
    # print(price)
    if (low_B <= price and price <= high_B) :
        # TODO high_Bは含んでいいんだっけ。。。
        is_found = True
        print(price)
        break

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

Submission status: Wrong Answer

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

ans = -1

for i in range(0, 10):
    for j in range(0, 10):
        a = A + (0.1 * i)
        b = B + (0.1 * j)
        a = a * (100 / 8)
        b = b * 10
        if a == b:
            ans = int(a)
            break
    else:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
A=[]
B=[]
for i in range(9):
  A.append(a+i/10)
  B.append(b+i/10)
for i in range(len(A)):
  A[i]=A[i]/0.08
  B[i]=B[i]/0.1
ans=[]
for i in range(len(A)):
  for j in range(len(A)):
    if A[i]==B[j]:
      ans.append(A[i])
      break
if ans==[]:
  print(-1)
else:
  print(int(ans[0]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

a = A / 0.08
a = a // 10
a *= 10

result = -1
for i in range(10):
    temp = a + i
    if math.floor(temp*0.08) == A and math.floor(temp*0.1) == B:
        result = int(temp)
        break

print(result)

Submission status: Wrong Answer

Solution code:
import sys
import math
sys.setrecursionlimit(int(1e6))

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

pa = A / 0.08
pb = B / 0.10

if int(pa) == int(pb):
    print(int(pa))
elif int(pa + 0.08) == int(pb):
    print(int(pb))
elif int(pa) == int(pb + 0.1):
    print(int(pa))
elif int(pa+0.08) == int(pb + 0.1):
    print(int(pa+0.08))
else:
    print(-1)