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:
#!/bin/bash
''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 \
   /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/g.inp"
exit $?
'''
import sys
import math


def _ia(): return [int(x) for x in sys.stdin.readline().strip().split()]


def main():
    a, b = _ia()
    xa = math.floor(a / 0.08)
    xb = math.floor(b / 0.1)
    xaa = math.floor((a + 1) / 0.08) - 1
    xbb = math.floor((b + 1) / 0.1) - 1
    if xa <= xb and xb <= xaa:
        return xb
    elif xb < xa and xa <= xbb:
        return xa
    else:
        return -1


if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
from math import floor, ceil

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

minx1 = A/0.08
maxx1 = (A+1)/0.08
minx2 = B/0.1
maxx2 = (B+1)/0.1

rangeMin = max(minx1, minx2)
rangeMax = min(maxx1, maxx2)
if rangeMax < rangeMin:
    print(-1)
else:
    print(int(rangeMin))

Submission status: Wrong Answer

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

xa = np.zeros((1000))
xb = np.zeros((1000))

for i in range(1000):
    xa_tmp = math.floor(0.08 * i)
    if xa_tmp == a:
        xa[i] = 1

for i in range(1000):
    xb_tmp = math.floor(0.1 * i)
    if xb_tmp == b:
        xb[i] = 1

#print(xa[:30])
#print(xb[:30])
x = xa + xb

ans = -1
for i in range(1000):
    if x[i] == 2:
        ans = i
        break


print(ans)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
if int(50*(b-a-1))<int(50*(b-a+1)):
  print(int(50*(b-a-1))+1)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
amin = (a*10**2)//8
amax = amin + 8
bmin = (b*10**2)//10
bmax = bmin + 10
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:
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:
    print(a)
else:
    print("-1")

Submission status: Wrong Answer

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

vlaue_a = 12.5*a
value_b = int(0.1*vlaue_a)
ans_a = 0

if b == int(value_b):
    ans_a = vlaue_a
else:
    ans_a = -1

vlaue_b = 10*b
value_a = int(0.08*vlaue_b)
ans_b = 0

if a == int(value_a):
    ans_b = vlaue_b
else:
    ans_b = -1
ans = 0
if ans_a == -1 and ans_b == -1:
    print(int(ans_a))
else:
    if ans_a != -1 and ans_b != -1:
        print(int(min(ans_a, ans_b)))
    elif ans_a != -1:
        print(int(ans_a))
    elif ans_b != -1:
        print(int(ans_b))

Submission status: Wrong Answer

Solution code:
## Problem C
import math
a, b = map(int, input().split())
c = ((a * 25) // 2)
for i in range(c, c+5):
    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:
import math
A, B = map(float, input().split())
a = A/0.08
b = B/0.1
low = math.ceil(max(a,b))
high = math.floor(min(a+1/0.08,b+1/0.1))
if low>high:
    print(-1)
else:
    print(low)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a,b = -a,-b
minA,minB = a // 0.08, b // 0.1
minA,minB = -minA,-minB

maxA,maxB = (a-1) // 0.08, (b-1) // 0.1
maxA,maxB = -maxA-1,-maxB-1

if minA > maxB or minB > maxA:
    print(-1)
else:
    print(int(minA))

Submission status: Wrong Answer

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

xa = int(a/0.08)
xb = int(b/0.1)

if int(xa*0.1) == b:
    print(xa)
elif int(xb*0.08) == a:
    print(xb)
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
from math import floor

a, b = [int(i) for i in input().split()]
diff = b - a
if diff <= (b * 0.2):
    if diff == 0:
        print(floor(a / 0.08))
    else:
        print(floor(b / 0.1))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 157: C (2020/03/07)
import math
A, B = map(int, input().split())
X = math.ceil(A/0.08)
print(A/0.08, X)
if int(X*0.1) == B:
    print(X)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
x=100*a/8
t=int(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 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 <= int(al) and int(al) < br:
    ans = int(al)
elif bl <= int(ar) and int(ar) < br:
    ans = int(bl)
elif al <= bl and br <= ar:
    ans = int(bl)
else:
    ans = -1
print(ans)

Submission status: Wrong Answer

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

k = int(tax_8 / 0.08)
kk = int((tax_8+1) / 0.08)
kkk = int(tax_10 / 0.1)
kkkk = int((tax_10+1) / 0.1)
print(k, kk, kkk, kkkk)

for i in range(min(k, kkk), max(kk, kkkk)):
    if int(i * 0.08) is tax_8 and int(i * 0.1) is tax_10:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
for i in range(990):
    c = int((i + 10) * 0.08)
    d = int((i + 10) * 0.10)
    if c == a and d == b:
        print(i + 10)
        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 and a <= b:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

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

N = int(B*10)

ans = -1

if int(N*0.08) <= A:
    while int(N*0.08) < A:
        N += 1
    ans = N

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) or a == math.floor(ten * 0.08):
    if eight < ten:
        print(eight)
    else:
        print(ten)
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)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
a=A/0.08
b=(A+1)/0.08
c=B/0.1
d=(B+1)/0.1
if b<=c or d<=a:
  print(-1)
else:
  t=max(a,c)
  s=min(b,d)
  if int(t)+1>int(s):
    print(-1)
  else:
    print(int(t)+1)

Submission status: Wrong Answer

Solution code:
ab=list(map(int, input().split()))
a=ab[0]
b=ab[1]
a0=12.5*a
a1=12.5*(a+1)
b0=10*b
b1=10*(b+1)
answer=0
if(a0>=b1):
    answer=-1
elif(a1<=b0):
    answer=-1
else:
    if(a0<a1):
        answer=a0//1
    else:
        answer=b0//1
print(int(answer))

Submission status: Wrong Answer

Solution code:
import math

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

min = int(a / 0.08)
max = int(math.floor((a + 1) / 0.08))
for i in range(min, max):
    if math.floor(i * 0.1) == b:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = [int(x) for x in input().split()]
amax = int((a+1)*12.5)
amin = int(a*12.5)
bmax = int((b+1)*10)
bmin = int(b*10)
hantei = bmin
if amax < bmin:
  hantei = -1
elif bmax < amin:
  hantei = -1
elif bmin < amin:
  hantei = amin
print(hantei)

Submission status: Wrong Answer

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

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

pa = A / 0.08

ans = -1
for p in range(int(pa), int(pa + 0.08)+1):
    if (A == int(p * 0.08)) and (B == int(p * 0.10)):
        ans = p
        break

print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a%2 == 0:
    if (25*a)//2 > 10*b+9 or (25*(a+1))//2  < 10*b:
        print(-1)
    elif (25*a)//2 <= 10*b+9:
        print((25*a)//2)
    else:
        print(10*b)
else:
    if ((25*a)//2)+1 > 10*b+9 or ((25*(a+1))//2)-1  < 10*b:
         print(-1)
    elif ((25*a)//2)+1 <= 10*b+9:
        print(((25*a)//2)+1)
    else:
        print(10*b)

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

print(pa,pb)

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

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

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

minA = A / 0.08
maxA = (A+1) / 0.08
minB = B / 0.1
maxB = (B+1) / 0.1

print(minA, maxA, minB, maxB)

if minB <= minA and minA < maxB: print(int(minA))
elif minA <= minB and minB < maxA: print(int(minB))
elif minB < maxA and maxA < maxB: print(int(maxA)-1)
elif minA < maxB and maxB < maxA: print(int(maxB)-1)
else: print("-1")

Submission status: Wrong Answer

Solution code:
def calc_list(X, z):
  root = X * (100 / z)
  l = [root]
  while True:
    if int((root + 1) * (z / 100)) == X:
      l.append(root + 1)
      root += 1
    else: break

  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
c = list(c)

if len(c) > 0:
  list(c).sort()
  print(int(c[0]))
else:
  print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

price = math.ceil(a / 0.08)
#print(price)
price_ = math.floor(b / 0.1)
#print(price_)
for i in range(price_, price+1):
    #print(math.floor(i * 0.08),math.floor(i * 0.1))
    if math.floor(i * 0.08) == math.floor(i * 0.1):
        print(i)
        exit()
if price == price_:
    print(price)
    exit()
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 = int(i)
        break
    else:
        None

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

else:
    print(-1)

Submission status: Wrong Answer

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

ans8=int(A*100/8)
ans10=int(B*100/10)
#print(ans8)
#print(ans10)

for i in range(ans10,ans8+1):
    ans88=int(i*0.08)
    ans1010=int(i*0.1)
    #print(i)
    #print(ans88)
    #print(ans1010)
    #print("\n")
    if(ans88==A and ans1010==B):
        print(i)
        exit()

print("-1")

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def main():
    tax8, tax10 = map(int, input().split())

    rate8 = 0.08
    rate10 = 0.1
    value8 = tax8 / rate8
    value10 = tax10 / rate10

    price_min = int(min(value8, value10))
    price_max = int(max(value8, value10))

    #print('price_min, price_max', price_min, price_max)

    for price in range(price_min, price_max + 1):
        #print(int(price / (1 - rate8)), int(price / (1 - rate10)))
        if int(price * rate8) == tax8 and int(price * rate10) == tax10:
            print(price)
            return 0
    
    print('-1')

    return 0


if __name__ == '__main__':
    main()

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"

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math


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

    for i in range(1000):
        t8 = math.floor(i * 0.08)
        t10 = math.floor(i * 0.1)

        if t8 == a and t10 == b:
            print(i)
            return

    print(-1)
    
resolve()

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int, input().split())
x = math.ceil(a/0.08)
y = math.ceil(b/0.10)
c = []
if math.floor(x*0.08) == math.floor(x*0.1):
    c.append(x)
if math.floor(y*0.08) == math.floor(y*0.1):
    c.append(y)

print(min(c) if c else x if x == y else -1)

Submission status: Wrong Answer

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

num_1 = int(-(-A // 0.08))
num_2 = int(-(-B // 0.1))

if num_1 // 10 != num_2 // 10:
    print(-1)
else:
    print(max(num_1, num_2))

Submission status: Wrong Answer

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

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_max):
    print(int(b_base_min))
else:
    print(-1)

Submission status: Wrong Answer

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

def main():
    a1, b1 = map(int, input().split())
    a2 = a1 / 0.08
    b2 = b1 / 0.10
    if a2 >= b2:
        if math.floor(a2 * 0.10) == b1:
            print(math.floor(a2))
        else:
            print('-1')
    else:
        if math.floor(b2 * 0.08) == a1:
            print(math.floor(b2))
        else:
            print('-1') 

main()

Submission status: Wrong Answer

Solution code:
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 rangeB[0] <= rangeA[1]:
  	print(int(rangeB[0]))
  else:
    print(-1)
else:  # rangeA[0] > rangeB[0]
  if rangeA[0] <= rangeB[1]:
    print(int(rangeA[0]))
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
mi = lambda : map(int,input().split())

a,b = mi()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A0 = 0
A1 = 0
B0 = 0
B1 = 0

A0 = a / 0.08
A1 = (a+1) / 0.08
B0 = b / 0.1
B1 = (b+1) / 0.1

if A1 < B0 or B1 < A0:
    print('-1')
else:
    if A0 > B0:
        print(int(A0))
    else:
        print(int(B0))

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
x = (math.ceil(a/0.08)) 
y = (math.ceil(b/0.1))
check = math.floor(x*0.1)
if (check == b) :
    print(x)
else :
    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())
A = a/0.08
B = b/0.1
if int(A/10) == int(B/10):
    print(int(A))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil
from math import floor
A, B = map(int, input().split())
a = max(ceil(A/0.08), ceil(B/0.10))
b = min(floor((A+1)/0.08), floor((B+1)/0.10))
if a <= b:
  print(a)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

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

    # [k*0.08] = A
    # [k*0.1] = B
    # B <= k*0.1 <= B+1
    # A <= k*0.08 <= A+1

    m,n = a / 0.08, b/0.1
    
    for i in range(floor(n), ceil(m)+1):
        if floor(i*0.08) == a and floor(i*0.1) == b:
            print(i) 
            return
    print('-1')
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

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

for i in range(1, 101):
  if(math.floor(i*0.08) == A and math.floor(i*0.10) == B and flag == True):
    print(i)
    flag=False

if(flag==True):
  print(-1)

Submission status: Wrong Answer

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

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

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

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

print(result)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
a_origin = math.ceil(a*100/8)
b_origin = math.ceil(b*10)

while True:
    if a_origin == b_origin:
        result = a_origin
        break;
    if a_origin < b_origin:
        a_origin += 1
    else:
        b_origin += 1

    if a_origin > (a+1) * 100/8 or b_origin > (b+1) * 10:
        result = -1
        break

print(result)

Submission status: Wrong Answer

Solution code:
import math

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

min_A = math.ceil(A * 100 / 8)
max_A = math.floor((A + 1) * 100 / 8)
min_B = math.ceil(B * 100 / 10)
max_B = math.floor((B + 1) * 100 / 8)

if (min_A <= min_B and min_B <= max_A):
    ans = min_B
elif (min_B <= min_A and min_A <= max_B):
    ans = min_A
else:
    ans = -1

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

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

print(a_base_min)
print(b_base_min)
print(a_base_max)
print(b_base_max)



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_max):
    print(int(b_base_min))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = list(map(int,input().split()))
before_min_A = math.floor(A * 12.5)
before_min_B = math.floor(B * 10)
if before_min_B <= before_min_A < before_min_B + 10:
    print(before_min_A)
elif before_min_A <= before_min_B < before_min_A + 12.5:
    print(before_min_B)
else:
    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 = (a + i*0.01)* (1/0.08)
    for j in range(100) :
        b_tax = (b + j*0.01)* (1/0.1)
        if a_tax == b_tax :
            print(int(a_tax))
            sys.exit()
print(-1)

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

flg = True
for price in range(1, 101):
    if int(price*0.08) == A and int(price*0.1) == B:
        print(price)
        flg = False
        break

if flg:
    print(-1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    kmina = int((A)/0.08)
    kmaxa = (A + 1)/0.08
    
    kminb = int((B)/0.10)
    kmaxb = (B + 1)/0.10

    # la = kmaxa - kmina
    # lb = kmaxa - kminb
    # if (la < 0)or(lb < 0): print(-1)
    # print(kmina, kminb, kmaxa, kmaxb)
    if min(kmina, kminb) == kmina:
        if ((kminb <= kmina) & (kmina < kmaxb)):
            print(kmina)
        elif ((kmina <= kminb) & (kminb < kmaxa)):
            print(kminb)
        else:
             print(-1)
        
    else : 
        if ((kmina <= kminb) & (kminb < kmaxa)):
            print(kminb)
        elif ((kminb <= kmina) & (kmina < kmaxb)):
            print(kmina)
        else:
             print(-1)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

a_min, a_max = round(12.5 * a), math.floor(12.5 * (a + 1))
b_min, b_max = round(10 * b), math.floor(10 * (b + 1))

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

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()

# x = a * 0.92
# y = b / 0.90
# print(x, y)
x1 = a / 0.08
y1 = b /0.1
x2 = (a+1) / 0.08
y2 = (b+1) /0.1

if ceil(y1) <= int(x1) <= int(y2):
    ans = int(x1)
    print(ans)
elif ceil(x1) <= int(y1) <= int(x2):
    ans = int(y1)
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
ma=12.5*a
mb=10*b
Ma=12.5*(a+1)
Mb=10*(b+1)
if max(ma,mb)<min(Ma,Mb):
  if ma>mb:
    print(int(ma))
  else:
    print(int(mb))
else:
  print('-1')

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 a_max == b_max:
    print(a_max)
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:
a,b = map(int,input().split())
ans = -1
for i in range(1,b):
  if int(i*1.08) == a and int(i*1.10)==b:
    ans = i
    break
    
print(ans)

Submission status: Wrong Answer

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

an = [math.floor(a*(100/8)) , math.ceil((a+1)*(100/8))-1]
bn = [math.floor(b*(100/10)) , math.ceil((b+1)*(100/10))-1]
    
ax = []
bx = []
    
for i in range(an[0],an[1]+1):
    ax.append(i)
    
for i in range(bn[0],bn[1]+1):
    bx.append(i)
    
for i in range(len(ax)):
    for j in range(len(bx)):
        if ax[i] == bx[j]:
            if ans == -1:
                ans = ax[i]
                
print(ans)

Submission status: Wrong Answer

Solution code:
from math import floor
A,B = map(int,input().split(" "))
s = 10*B
t = 10*(B+1)
for tmp in range(s,t+1):
    if floor(tmp*0.08) == A:
        print(tmp)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import sys
import math

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

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) == math.floor(i*0.10):
        print(i)
        sys.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//10
f=(b+1)*100//10
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:
from math import floor

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

pa1 = floor(A * 100 / 8)
pa2 = floor((A * 100 + 99) / 8)
pb1 = floor(B * 100 / 10)
pb2 = floor((B * 100 + 99) / 10)

p1 = max(pa1, pb1)
if p1 > pa2 or p1 > pb2:
    print(-1)
else:
    print(p1)

Submission status: Wrong Answer

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

def main():
    a1, b1 = map(int, input().split())
    a2 = a1 / 0.08
    b2 = b1 / 0.10
    print(a2)
    print(b2)
    if a2 >= b2:
        if math.floor(a2 * 0.10) == b1:
            print(math.floor(a2))
        else:
            print('-1')
    else:
        if math.floor(b2 * 0.08) == a1:
            print(math.floor(b2))
        else:
            print('-1') 

main()

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 = 10 * i // 10
        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 = [int(x) for x in input().split()]

if int(0.08*B) == int(0.1 * A):
    print(A / 0.08)
else:
    print(-1)

Submission status: Wrong Answer

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

a = A / 8 * 100
b = B * 10
ans = []
if a == b: ans.append(round(a))
else:
  if math.floor(a * 0.08) == math.floor(a * 0.1):
    ans.append(round(a))
  if math.floor(b * 0.08) == math.floor(b * 0.1):
    ans.append(round(b))

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

Submission status: Wrong Answer

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

a1 = 0
a2 = 0
if a*100 % 8 == 0:
    a1 = a/0.08
else:
    a1 = a//0.08 + 1

a2 = (a+1)//0.08

b1 = b / 0.1
b2 = (b+1) / 0.1

a1 = int(a1)
a2 = int(a2)
b1 = int(b1)
b2 = int(b2)

al = []
bl = []

for i in range(a1, a2+1):
    al.append(i)
for i in range(b1, b2+1):
    bl.append(i)

ans = set(al) & set(bl)
if len(ans) == 0:
    print(-1)
else:
    print(min(ans))

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
a=A/0.08
b=(A+1)/0.08
c=B/0.1
d=(B+1)/0.1
if b<=c or d<=a:
  print(-1)
else:
  t=max(a,c)
  s=min(b,d)
  if int(t)+1>int(s):
    print(-1)
  else:
    print(int(t))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

res = -1;

for i in range(1,101):
  x = int(i * 0.08);
  y = int(i * 0.1)

  if(A == x and B == y):
    res = i
    break

print(res)

Submission status: Wrong Answer

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

a1 = A/0.08
a2 = (A+1)/0.08
b1 = B/0.1
b2 = (B+1)/0.1
if (a1 - int(a1)) == 0:
  a1 = int(a1)
else:
  a1 = int(a1+1)
if (b1 - int(b1)) == 0:
  b1 = int(b1)
else:
  b1 = int(b1+1)
a2 = int(a2)
b2 = int(b2)

if a1>b1:
  a1,a2,b1,b2 = b1,b2,a1,a2
if b1<=a2:
  print(b1)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    from math import floor
    a, b = map(int, input().split())
    ax = 0
    bx = 0
    for i in range(1,101):
        ax = floor(i * 0.08)
        bx = floor(i * 0.1)
        if ax == a and bx == b:
            print(i)
            return 0
    print(-1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if int(a/0.08) < (b+1)/0.1 and int(b/0.1) < (a+1)/0.08:
    print(max(int(a/0.08), int(b/0.1)))
else:
    print(-1)

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)
    elif B_down <= A_up:
        print(B_down)
    else:
        print(-1)