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:
import math
import random
import sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from functools import lru_cache, reduce
from heapq import heapify, heappop, heappush
from itertools import (chain, combinations, combinations_with_replacement,
                       permutations)

MAX_INT = 2**62-1
sys.setrecursionlimit(10**7)

input = sys.stdin.readline


def read_n_int():
    return map(int, input().split())


def main():
    a, b = read_n_int()
    a1, a2 = a/0.08, (a+1)/0.08
    b1, b2 = b/0.1, (b+1)/0.1

    for i in range(int(a1), int(a2)):
        if b1 <= i < b2:
            print(i)
            break
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
import random
import sys

MAX_INT = 2**62-1
sys.setrecursionlimit(10**7)

input = sys.stdin.readline


def read_n_int():
    return map(int, input().split())


def main():
    a, b = read_n_int()
    num1, num2 = a / 0.08, b / 0.1

    s1 = set()
    i = num1
    while a == int(i*0.08):
        s1.add(i)
        i += 1

    i = num2
    s2 = set()
    while b == int(i*0.1):
        s2.add(int(i))
        i += 1

    inter = s1 & s2
    if inter:
        print(min(inter))
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
import random
import sys

MAX_INT = 2**62-1
sys.setrecursionlimit(10**7)

input = sys.stdin.readline


def read_n_int():
    return map(int, input().split())


def main():
    a, b = read_n_int()
    num1, num2 = a / 0.08, b / 0.1
    s1 = set()
    i = 0
    while int(num1*0.08) == int((num1+i)*0.08):
        s1.add(int(num1+i))
        i += 1
    i = 0
    s2 = set()
    while int(num2*0.1) == int((num2+i)*0.1):
        s2.add(int(num2+i))
        i += 1
    # print(s1, s2)
    if s1 & s2:
        print((s1 & s2).pop())
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

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

a_min = math.floor(A * 100 / 8)
a_max = math.ceil((A + 1) * 100 / 8)
b_min = math.floor(B * 100 / 10)
b_max = math.ceil((B + 1) * 100 / 10)

set_a = {i for i in range(a_min, a_max)}
set_b = {i for i in range(b_min, b_max)}
i = set_a.intersection(set_b)
if len(i) > 0:
    print(int(min(i)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

a_min = math.floor(A * 100 / 8)
a_max = math.ceil((A + 1) * 100 / 8)
b_min = math.floor(B * 100 / 10)
b_max = math.ceil((B + 1) * 100 / 10)

set_a = {i for i in range(a_min, a_max)}
set_b = {i for i in range(b_min, b_max)}
i = set_a.intersection(set_b)
if len(i) > 0:
    print(min(i))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

a_min = math.floor(A * 100 / 8)
a_max = math.ceil((A + 1) * 100 / 8)
b_min = math.floor(B * 100 / 10)
b_max = math.ceil((B + 1) * 100 / 10)

set_a = {i for i in range(a_min, a_max + 1)}
set_b = {i for i in range(b_min, b_max + 1)}
i = set_a.intersection(set_b)
if len(i) > 0:
    print(min(i))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

a_min = math.floor(A * 100 / 8)
a_max = math.ceil((A + 1) * 100 / 8)
b_min = math.floor(B * 100 / 10)
b_max = math.ceil((B + 1) * 100 / 10)

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

Submission status: Wrong Answer

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

x1=A/0.08
x2=B/0.1
ans=-1
if math.floor(x1*0.08)==A and math.floor(x1*0.10)==B:
	ans=x1
if math.floor(x2*0.08)==A and math.floor(x2*0.10)==B:
	if ans==-1 or x2<ans:
		ans=x2
print(int(ans))

Submission status: Wrong Answer

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

pa = 0 - -a//0.08
pb = b/0.1
ans = pa

ta = pa//12.5
tb = pa//10

if ta == a and tb == b:
    for i in range(100):
        ans = pa - 1
        if ans//12.5 != a or ans//10 != b:
            ans = ans + 1
            print(int(ans))
            break
else:
    print(-1)

Submission status: Wrong Answer

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

pa = 0 - -a//0.08
pb = b/0.1
ans = pa

ta = pa//12.5
tb = pa//10

print(ta, tb)

if ta == a and tb == b:
    for i in range(100):
        ans = pa - 1
        if ans//12.5 != a or ans//10 != b:
            ans = ans + 1
            print(int(ans))
            break
else:
    print(-1)

Submission status: Wrong Answer

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

pa = 0 - -a//0.08
pb = b/0.1
ans = pa

ta = pa//12.5
tb = pa//10

if ta == a and tb == b:
    for i in range(100):
        ans = pa - 1
        if ans//12.5 != a or ans//10 != b:
            ans = pa + 1
            print(int(ans))
            break
else:
    print(-1)

Submission status: Wrong Answer

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

pa = 0 - -a//0.08
pb = b/0.1

ta = pa//12.5
tb = pb//10

if ta == a and tb == b:
    print(int(pa))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int, input().split())
tax_a = 8/100
tax_b = 10/100
al = A/tax_a
ar=  (A+1)/tax_a
bl = B/tax_b
br=  (B+1)/tax_b
if br < al or ar < bl:
    print(-1)
elif bl<al and ar<br:
    print(math.floor(al))
elif al<bl and br < ar:
    print(math.floor(bl))
elif bl < al < br < ar:
    print(math.floor(al))
elif al < bl < ar < br:
    print(math.floor(bl))
elif ar == bl:
    print(math.floor(ar))
elif al == br:
    print(math.floor(al))
elif al == bl:
    print(math.floor(al))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int, input().split())
tax_a = 8/100
tax_b = 10/100
al = A/tax_a
ar=  (A+1)/tax_a
bl = B/tax_b
br=  (B+1)/tax_b
if br < al or ar < bl:
    print(-1)
elif bl<al and ar<bl:
    print(math.floor(al))
elif al<bl and br < ar:
    print(math.floor(bl))
elif bl < al < br < ar:
    print(math.floor(al))
elif al < bl < ar < br:
    print(math.floor(bl))
elif ar == bl:
    print(math.floor(ar))
elif al == br:
    print(math.floor(al))
elif al == bl:
    print(math.floor(al))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int, input().split())
tax_a = 8/100
tax_b = 10/100
al = A/tax_a
ar=  (A+1)/tax_a
bl = B/tax_b
br=  (B+1)/tax_b
if br < al or ar < bl:
    print(-1)
elif bl<al and ar<bl:
    print(math.floor(al))
elif al<bl and br < ar:
    print(math.floor(bl))
elif bl < al <= br < ar:
    print(math.floor(al))
elif al < bl <= ar < br:
    print(math.floor(bl))
elif al == bl:
    print(math.floor(al))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int, input().split())
tax_a = 8/100
tax_b = 10/100
al = A/tax_a
ar=  (A+1)/tax_a
bl = B/tax_b
br=  (B+1)/tax_b
if br < al or ar < bl:
    print(-1)
elif bl<al and ar<bl:
    print(math.floor(al))
elif al<bl and br < ar:
    print(math.floor(bl))
elif bl < al < br < ar:
    print(math.floor(al))
elif al < bl < ar < br:
    print(math.floor(bl))
elif al == bl:
    print(math.floor(al))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int, input().split())
if A/(8/100) > (B+1)/(10/100) or (A+1)/(8/100) < (B)/(10/100):
    print(-1)
elif A/(8/100) <= (B)/(10/100):
    print(math.floor(B/(10/100)))
elif A/(8/100) <= (B+1)/(10/100):
    print(math.floor(A/(8/100)))
elif (A+1)/(8/100) >= (B)/(10/100):
    print(math.floor())
elif (A+1)/(8/100) >= (B)/(10/100):
    print(math.floor((A)/(8/100)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int, input().split())
if A/(8/100) > (B+1)/(10/100) or (A+1)/(8/100) < (B)/(10/100):
    print(-1)
elif A/(8/100) <= (B+1)/(10/100):
    print(math.floor(A/(8/100)))
elif (A+1)/(8/100) >= (B)/(10/100):
    print(math.floor((B)/(10/100)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int, input().split())
if A/(8/100) > (B+1)/(10/100) or (A+1)/(8/100) < (B)/(10/100):
    print('-1')
elif A/(8/100) <= (B+1)/(10/100):
    print(math.floor(A/(8/100)))
elif (A+1)/(8/100) >= (B)/(10/100):
    print(math.floor((B)/(10/100)))
else:
    print('-1')

Submission status: Wrong Answer

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

for i in range(1000):
    if int(i*0.08) == A and i//10 == B:
        print(i)
        exit()

print(-1)

Submission status: Wrong Answer

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

for i in range(1,2000):
    c=i*8/100
    d=i*8/100
    if(int(c)==a and int(d)==b):
        print(i)
        break
else:print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

a, b = map(int, input().split())
for i in range(1, 10001):
    ax = i*0.08
    bx = i*0.10
    if ax >= a and a > i*0.09:
        if bx >= b:
            print(i)
            sys.exit()
print("-1")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
ali = []
for i in range(10):
    ali.append(10*b + i)
if ali.count(int(12.5*a)) == 1:
    print(int(12.5*a))
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
ali = []
for i in range(10):
    ali.append(10*b + i)
if ali.count(12.5*a) == 1:
    print(int(12.5*a))
else:
    print("-1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = a // 0.08 
if int(x * 0.1) == b:
  print(int(x))
else:
  print(-1)

Submission status: Wrong Answer

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

x = a / 0.08 
if int(x * 0.1) == b:
  print(int(x))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
  
x = a / 0.08 
y = b / 0.1

if x == y :
  print(x)
else:
  print(-1)

Submission status: Wrong Answer

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

for p in range(10, 1010):
  if (8*p//100 == A) and (p//10 == B):
    print(p)
    break

print(-1)

Submission status: Wrong Answer

Solution code:
# A: 8%, B: 10%
A, B = map(int, input().split())

# B < 100 -> maxP = 1000
for p in range(10, 1010):
  if 8*p//100 == A and 10*p//100 == B:
    print(p)
    break

print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

A, B = map(int, input().split())
for i in range(1, 10001):
    per8 = math.floor(i*0.08)
    per10 = math.floor(i*0.1)
    if per8 == A and per10 == B:
        print(i)
print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
price=10*b
c=[]  
while(price<=10*b+10):
  if int(price*0.08)==a:
    c.append(price)
    price=price+1
  else:
    price=price+1
if c==[]:
  print(-1)
else:
  print(min(c))

Submission status: Wrong Answer

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

amin = a//0.08
amax = (a+1)//0.08
bmin = b//0.1
bmax = (b+1)//0.1

if a%0.08 > 0:
	amin += 1
if (a+1)%0.08:
	amax -= 1
if b%0.1 > 0:
	bmin += 1
if (b+1)%0.1 > 0:
	bmax -= 1

if amin <= bmin:
	if bmin <= amax:
		print(bmin)
	else:
		print('-1')
else:
	if amin <= bmax:
		print(amin)
	else:
		print('-1')

Submission status: Wrong Answer

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

amin = a//0.08
amax = (a+1)//0.08
bmin = b//0.1
bmax = (b+1)//0.1

if a%0.08 > 0:
	amin += 1
if (a+1)%0.08:
	amax -= 1
if b%0.1 > 0:
	bmin += 1
if (b+1)%0.1 > 0:
	bmax -= 1

if amin <= bmin:
	if bmin <= amax:
		print(bmin)
	else:
		print(-1)
else:
	if amin <= bmax:
		print(amin)
	else:
		print(-1)

Submission status: Wrong Answer

Solution code:
A,B=[int(i) for i in input().split()]
Anedan=A/0.08
if B==int(Anedan*0.1):
    print(int(Anedan))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
#ABC158C
import sys
a, b = map(int, sys.stdin.readline().split())
#print(a,b)

for num in range(0, 1000):
    A = int(num*0.08)
    B = int(num*0.1)
    #print(A, B, num)
    if a==A and b ==B:
        print(num)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

min_a = math.ceil(a / 0.08)
max_a = int(min_a + 12.5 - 0.0000000001)
min_b = math.ceil(b / 0.1)
max_b = int(min_b + 10 - 0.0000000001)

m = max(min_a, min_b)
M = min(max_a, max_b)
if M >= m:
    print(m)
else:
    print(-1)

Submission status: Wrong Answer

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

min_a = math.ceil(a / 0.08)
max_a = min_a + 12.5 - 0.0000000001
min_b = math.ceil(b / 0.1)
max_b = min_b + 10 - 0.0000000001

m = max(min_a, min_b)
M = min(max_a, max_b)
if M >= m:
    print(m)
else:
    print(-1)

Submission status: Wrong Answer

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

min_a = math.ceil(a / 0.08)
max_a = min_a + 12.5
min_b = math.ceil(b / 0.1)
max_b = min_b + 10
if max_a == int(max_a):
    max_a = max_a - 0.0000000001
if max_b == int(max_b):
    max_b = max_b - 0.0000000001

m = max(min_a, min_b)
M = min(max_a, max_b)
if M >= m:
    if m == int(m):
        print(m)
    else:
        print(math.ceil(m))
else:
    print(-1)

Submission status: Wrong Answer

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

min_a = math.ceil(a / 0.08)
max_a = min_a + 12.5
min_b = math.ceil(b / 0.1)
max_b = min_b + 10
if max_a == int(max_a):
    max_a = max_a - 0.0000000001
if max_b == int(max_b):
    max_b = max_b - 0.0000000001

m = max(min_a, min_b)
M = min(max_a, max_b)
if M >= m:
    print(m)
else:
    print(-1)

Submission status: Wrong Answer

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

min_a = math.ceil(a / 0.08)
max_a = min_a + 12.5
min_b = math.ceil(b / 0.1)
max_b = min_b + 10

m = max(min_a, min_b)
M = min(max_a, max_b)
if M >= m:
    print(m)
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(int((N[0])*(1/0.08)), math.ceil((N[0]+1)*(1/0.08))+1)]
Y = [i for i in range(int((N[1])*(1/0.10)), math.ceil((N[1]+1)*(1/0.10))+1)]
#print(X, Y)
#for i in range(X[0] - 2, X[-1] + 2):
#  print(math.floor(i*0.08))

cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), int((N[0]+1)*(1/0.08))+1)]
Y = [i for i in range(int(N[1]*(1/0.10)), int((N[1]+1)*(1/0.10))+1)]
#print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), math.ceil((N[0]+1)*(1/0.08)))]
Y = [i for i in range(int(N[1]*(1/0.10)), math.ceil((N[1]+1)*(1/0.10)))]
#print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(int((N[0])*(1/0.08)), int((N[0]+1)*(1/0.08))+1)]
Y = [i for i in range(int((N[1])*(1/0.10)), int((N[1]+1)*(1/0.10))+1)]
#print(X, Y)
#for i in X:
#  print(math.floor(i*0.08))

cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(math.ceil((N[0]-1)*(1/0.08)), int((N[0])*(1/0.08))+1)]
Y = [i for i in range(math.ceil((N[1]-1)*(1/0.10)), int((N[1])*(1/0.10))+1)]
#print(X, Y)
#for i in X:
#  print(math.ceil(i*0.08))

cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), math.ceil((N[0]+1)*(1/0.08))+1)]
Y = [i for i in range(int(N[1]*(1/0.10)), math.ceil((N[1]+1)*(1/0.10))+1)]
print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), math.ceil((N[0]+1)*(1/0.08)))]
Y = [i for i in range(int(N[1]*(1/0.10)), math.ceil((N[1]+1)*(1/0.10)))]
print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), math.ceil((N[0])*(1/0.08))+1)]
Y = [i for i in range(int(N[1]*(1/0.10)), math.ceil((N[1])*(1/0.10))+1)]
#print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
import math
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), math.ceil((N[0])*(1/0.08)))]
Y = [i for i in range(int(N[1]*(1/0.10)), math.ceil((N[1])*(1/0.10)))]
#print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
a,b=[int(i) for i in input().split()]
a=[a/0.08,(a+1)/0.08]
b=[b/0.1,(b+1)/0.1]
if a[-1]<=b[0] or b[-1]<=a[0]:
    print(-1)
else:
    print(int(max(a[0],b[0])))

Submission status: Wrong Answer

Solution code:
a,b=[int(i) for i in input().split()]
a=[a/0.08,(a+1)/0.08]
b=[b/0.1,(b+1)/0.1]
if a[-1]<b[0] or b[-1]<a[0]:
    print(-1)
else:
    print(int(max(a[0],b[0])))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
for x in range(100):
    if (int(x*0.08) == a) and (int(x*0.1) == b):
        print(x)
        break
else:
    print("-1")

Submission status: Wrong Answer

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

A = 100 * A
B = 100 * B

a = 0
b = 0
ab = []

for i in range(A, A+1000):
    
    a = i / 8
    
    for j in range(B, B+1000):
        
        b = j /10
        
        if a == b:
            
            ab.append(a)
    
if not ab:
    print("-1")

else:
    print(int(min(ab)))

Submission status: Wrong Answer

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

A = 100 * A
B = 100 * B

a = 0
b = 0
ab = []

for i in range(A, A+999):
    
    a = i / 8
    
    for j in range(B, B+999):
        
        b = j /10
        
        if a == b:
            
            ab.append(a)
    
if not ab:
    print("-1")

else:
    print(int(min(ab)))

Submission status: Wrong Answer

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

Xa_max = (A + 1) / 0.08
Xa_min = (A) / 0.08

Xb_max = (B + 1) / 0.1
Xb_min = (B) / 0.1

# 範囲が被らない場合
if Xa_min >= Xb_max or Xb_min >= Xa_max:
    print(-1)
    exit()

if Xa_min >= Xb_min:
    ans = math.floor(Xa_min)
    if ans >= Xb_max:
        print(-1)
        exit()
else:
    ans = math.floor(Xb_min)
    if ans >= Xa_max:
        print(-1)
        exit()

print(ans)

Submission status: Wrong Answer

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

Xa_max = (A + 0.99999999999) / 0.08
Xa_min = (A) / 0.08

Xb_max = (B + 0.99999999999) / 0.1
Xb_min = (B) / 0.1

# 範囲が被らない場合
if Xa_min > Xb_max or Xb_min > Xa_max:
    print(-1)
    exit()

print(math.floor(max(Xa_min, Xb_min)))

Submission status: Wrong Answer

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

A = 100 * A
B = 100 * B

a = 0
b = 0
ab = []

for i in range(A, A+100):
    
    a = i / 8
    
    for j in range(B, B+100):
        
        b = j /10
        
        if a == b:
            
            ab.append(a)
    
if not ab:
    print("-1")

else:
    print(int(min(ab)))

Submission status: Wrong Answer

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

A = 100 * A
B = 100 * B

a = 0
b = 0

for i in range(A, A+100):
    
    a = i / 8
    
    for j in range(B, B+100):
        
        b = j /10
        
        if a == b:
            
            print(int(a))
            break
    else:
        if i == A +99:
            print("-1")
        else:
            continue
    
    break

Submission status: Wrong Answer

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

x1 = int(a/0.08)
x2 = int(b/0.10)
y1 = x1
y2 = x2
ans = 10**9
for i in range(max(x1,x2)+1):
    if int(i*0.08) == a and int(i*0.10) == b:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
def tax():
    a, b = map(int, input().strip().split())
    p1 = int(a//0.08)
    p2 = int(b//0.1)

    for i in range(p2, p1):
        if int(i*0.1) == b and int(i*0.08) == a:
            print(i)
            return
    print(-1)
    return
tax()

Submission status: Wrong Answer

Solution code:
def tax():
    a, b = map(int, input().strip().split())
    p1 = int(a//0.08)
    p2 = int(b//0.1)

    for i in range(p1,p2):
        if int(i*0.1) == b and int(i*0.08) == a:
            print(i)
            return
    print(-1)
    return
tax()

Submission status: Wrong Answer

Solution code:
def main():
    A, B = map(int, input().split())
    x1 = int(B // 0.1)
    x2 = int(A // 0.08) + 2

    for i in range(x1, x2):
        if int(i*0.08) == A and int(i*0.1) == B:
            print(i)
            return
    else:
        print(-1)
        return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

L = [(int((i+1)*0.08),int((i+1)*0.1)) for i in range(100)]

check = 1

for i in range(100):
    if L[i] == (A,B):
        print(i+1)
        check = 0
        break

if check == 1:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

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

a_low = math.ceil(a/0.08)
a_high = math.floor((a+1)/0.08)

b_low = math.ceil(b/0.1)
b_high = math.floor((b+1)/0.1)

com = np.intersect1d(np.arange(a_low, a_high+1), np.arange(b_low, b_high+1))
if len(com)>0:
    print(int(com[0]))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

a_low = math.ceil(a/0.08)
a_high = math.floor((a+1)/0.08)

b_low = math.ceil(b/0.1)
b_high = math.floor((b+1)/0.1)

if a_high<b_low or b_high<a_low:
  print(-1)
else:
  print(max(a_low, b_low))

Submission status: Wrong Answer

Solution code:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  a, b = map(int, readline().split())
  a2 = floor(a/0.08)
  b2 = floor(b/0.1)
  if a2==b2:
    print(a2)
  else:
    print(-1)
  
  
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
c = 0
d = 0
e = -1

for i in range(1, 101):
    c = int(i*0.08)
    d = int(i*0.1)
    if a==c and b==d:
        e = i
        break

print(e)

Submission status: Wrong Answer

Solution code:
import math

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

c = math.ceil(a/0.08)
d = math.floor(a/0.08+12.5)
e = int(b/0.1)
f = int(e+10)
x = -1

for i in range(c, d+1):
    for j in range(e, f+1):
        if i==j:
            x = i
            break
    else:
        continue
    break

print(x)

Submission status: Wrong Answer

Solution code:
import math

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

c = math.ceil(a/0.08)
d = math.floor(c+12.5)
e = int(b/0.1)
f = int(e+10)
x = -1

for i in range(c, d+1):
    for j in range(e, f+1):
        if i==j:
            x = i
            break
    else:
        continue
    break

print(x)

Submission status: Wrong Answer

Solution code:
import sys

A, B = map(int, sys.stdin.readline().rstrip().split())
c = 1e-1000
d = 1 - c
A_min = int(A * (100 / 8.) + d)
A_max = int((A + d) * (100 / 8.))
B_min = int(B * 10.)
B_max = int((B + d) * 10.)

if min(A_max, B_max) - max(A_min, B_min) >= 0:
    print(max(A_min, B_min))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import sys

A, B = map(int, sys.stdin.readline().rstrip().split())
c = 1e-1000
d = 1 - c
A_min = int(A * (100 / 8.) + d)
A_max = (A + 1) * (100 / 8.)
B_min = int(B * 10.)
B_max = (B + 1) * 10.

if int(min(A_max, B_max) - max(A_min, B_min)) > 0:
    print(int(max(A_min, B_min)))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import sys

A, B = map(int, sys.stdin.readline().rstrip().split())
A_min = A * (100 / 8.)
A_max = (A + 1) * (100 / 8.)
B_min = B * 10.
B_max = (B + 1) * 10.

if int(min(A_max, B_max) - max(A_min, B_min)) > 0:
    print(int(max(A_min, B_min)))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import sys

A, B = map(int, sys.stdin.readline().rstrip().split())
A_min = int(A * (100 / 8.))
A_max = (A + 1) * (100 / 8.)
B_min = int(B * 10.)
B_max = (B + 1) * 10.

if min(A_max, B_max) - max(A_min, B_min) >= 0:
    print(max(A_min, B_min))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import sys

A, B = map(int, sys.stdin.readline().rstrip().split())
A_min = int(A * (100 / 8.))
A_max = int((A + 1) * (100 / 8.))
B_min = int(B * 10.)
B_max = int((B + 1) * 10.)

if min(A_max, B_max) - max(A_min, B_min) > 0:
    print(max(A_min, B_min))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import sys

A, B = map(int, sys.stdin.readline().rstrip().split())
A_min = int(A * (100 / 8.))
A_max = int((A + 1 - 1e-100) * (100 / 8.))
B_min = int(B * 10.)
B_max = int((B + 1 - 1e-100) * 10.)

if min(A_max, B_max) - max(A_min, B_min) > 0:
    print(max(A_min, B_min))
else:
    print('-1')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
x=0
for i in range(1300):
  if int(i*0.08) == a and int(i*0.10) == b:
    print(i)
    x=1
  if x == 0 and i == 1299:
    print("-1")

Submission status: Wrong Answer

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

if taxB <= taxA < taxB + 10:
    print(math.ceil(taxA))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
eight, ten = map(int, input().split())

eight_price = eight / 0.08
ten_price = ten / 0.1

if eight_price >= ten_price:
    bigger = eight_price
    if (bigger // 10) != ten:
        print("-1")
    else:
        print(int(bigger))
else:
    bigger = ten_price
    if (bigger * 8 // 100) != eight:
        print("-1")
    else:
        print(int(bigger))

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
na=math.ceil(a*12.5)
nb=b*10
x=0
for i in range(14):
  nai=na+i
  for j in range(10):
    nbj=nb+j
    if nai == nbj:
      x=1
      y=nai
      break
  if x==1:
    print(y)
    break
  if x==0 and i==13:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
na=int(a*12.5)
nb=b*10
x=0
for i in range(14):
  nai=na+i
  for j in range(20):
    nbj=nb+j
    if nai == nbj:
      x=1
      y=nai
      break
  if x==1:
    print(y)
    break
  if x==0 and i==13:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
na=int(a*12.5)
nb=b*10
x=0
for i in range(16):
  nai=na+i
  for j in range(10):
    nbj=nb+j
    if nai == nbj:
      x=1
      y=nai
      break
  if x==1:
    print(y)
    break
  if x==0 and i==15:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
na=int(a*12.5)
nb=b*10
x=0
for i in range(16):
  nai=na+i
  for j in range(10):
    nbj=nb+j
    if nai == nbj:
      x=1
      y=nai
      break
  if x==1:
    print(y)
    break
  if x==0 and i==13:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
na=int(a*12.5)
nb=b*10
x=0
for i in range(14):
  nai=na+i
  for j in range(10):
    nbj=nb+j
    if nai == nbj:
      x=1
      y=nai
      break
  if x==1:
    print(y)
    break
  if x==0 and i==13:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
na=int(a*12.5)
nb=b*10
x=0
for i in range(8):
  nai=na+i
  for j in range(10):
    nbj=nb+j
    if nai == nbj:
      x=1
      y=nai
      break
  if x==1:
    print(y)
    break
  if x==0 and i==7:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
na=int(a*12.5)
nb=b*10
x=0
for i in range(8):
  nai=na+i
  for j in range(10):
    nbj=nb+j
    if nai == nbj:
      x=1
      y=nai
      break
  if x==1:
    print(y)
    break
  if x==0 and i==7:
    print("-1")

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
amin = math.ceil(a * 100 / 8)
amax = math.floor((a+1) * 100 / 8)
bmin = math.ceil(b * 100 / 10)
bmax = math.floor((b+1) * 100 / 10)

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