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 sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
def S(): return sys.stdin.readline().rstrip()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 998244353
INF = float("inf")
sys.setrecursionlimit(10**6+10)
input = sys.stdin.readline

A,B = MI()
for i in range(1000):
    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
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
def S(): return sys.stdin.readline().rstrip()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 998244353
INF = float("inf")
sys.setrecursionlimit(10**6+10)
input = sys.stdin.readline

A,B = MI()
for i in range(1000):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
p = math.ceil((a+b)/0.18)
print(p if p < (a+b+2)/0.18 and p != 0 else -1)

Submission status: Wrong Answer

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

na = int(a/0.08)
nb = int(b/0.10)

aa = int(nb * 0.08)
bb = int(na *0.1)

if a == aa:
    print(str(nb))
elif b == bb:
    print(str(na))
else:
    print('-1')

Submission status: Wrong Answer

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

na = int(a/0.08)
nb = int(b/0.10)

nn = na - nb

if nn < 0 and nn > -10:
    print(str(na))
elif nn >= 0 and nn < 10:
    print(str(na))
else:
    print('-1')

Submission status: Wrong Answer

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

for x in range(0,101):
  if (0.1*x)//1 == B and (0.08*x)//1 == A:
    print(x)
    exit(0)
print(-1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())
mn = max(100 * a, 80 * b)
mx = min(100 * a + 99, 80 * b + 72)
print(mn // 8 if mn <= mx else -1)

Submission status: Wrong Answer

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

x = a * 100 / 8
if int(x) < x:
    x = int(x)+1
else:
    x = int(x)
y = b * 100 / 10
if int(y) < y:
    y = int(y)+1
else:
    y = int(y)

while x * 10 // 100 < b and x * 8 // 100 == a:
    x += 1
    
if x * 10 // 100 == b:
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

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

x = a * 100 / 8
if int(x) < x:
    x = int(x)+1
else:
    x = int(x)
y = b * 100 / 10
if int(y) < y:
    y = int(y)+1
else:
    y = int(y)

if x * 10 // 100 != b:
    print(-1)
else:
    print(x)

Submission status: Wrong Answer

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

x = (a * 100 // 8) + 1
y = (b * 100 // 10) + 1

if x * 10 // 100 != b:
    print(-1)
else:
    print(int(x))

Submission status: Wrong Answer

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

x = a * 100 / 8
y = b * 100 / 10

if x * 10 // 100 != b:
    print(-1)
else:
    print(int(x))

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split(" "))
x_min = a / 0.08
x_max = (a + 1) / 0.08
y_min = b / 0.10
y_max = (b + 1) / 0.10


lower = math.ceil(max([x_min, y_min]))
upper = math.floor(min([x_max, y_max]))
if lower <= upper:
    print(lower)
else:
    print("-1")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
list = []
A,B = map(int ,input().split())
for i in range(13,10001):
    if i*0.08 == A and i*0.10 == B:
        print(i)
        break
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
list = []
A,B = map(int ,input().split())
for i in range(13,10001):
    if i*0.08 == A and i*0.10:
        print(i)
        break
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
for x in range(1, 101):
    if x * 8 // 100 == A and x * 10 // 100 == B:
        print(x); exit()

print(-1)

Submission status: Wrong Answer

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

for i in range(100+1):

    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
fulla = int(a*12.5)
ans = -1
while int(fulla/12.5) == a:
  if fulla//10==b:
    ans = fulla
    break
  fulla += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
fulla = int(a*12.5)
ans = -1
while fulla//12.5 == a:
  if fulla//10==b:
    ans = fulla
    break
  fulla += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
fulla = int(a*12.5)
hifulla = int((a+1)*12.5)
ans = -1
for i in range(fulla,hifulla):
  if i//10==b:
    ans = i
    break
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
fulla = int(a*12.5)
hifulla = int((a+1)*12.5)
ans = -1
for i in range(fulla,hifulla+1):
  if i//10==b:
    ans = i
    break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

import math
a,b = LI()
tax8 = [i for i in range(math.ceil(100/8*a), int(100/8*(a+1)))]
tax10 = [i for i in range(math.ceil(100/10*b), int(100/10*(b+1)))]
print(tax8,tax10)
c = max(tax8[0], tax10[0])
if c in tax8 and c in tax10:
    print(c)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

a,b = LI()
tax8 = [i for i in range(int(100/8*a), int(100/8*(a+1)))]
tax10 = [i for i in range(int(100/10*b), int(100/10*(b+1)))]
# print(tax8,tax10)
c = max(tax8[0], tax10[0])
if c in tax8 and c in tax10:
    print(c)
else:
    print(-1)

Submission status: Wrong Answer

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

x = A / 0.08
#print(x)

y = B / 0.1
#print(y)

if x == y:
#    print(int(x))
    exit()

if y < x:
#    print("y < x")
    while y < x:
        y += 1
        z = y * 0.1
    if z >= B + 1:
        print(-1)
        exit()
    else:
        print(int(y))
        exit()

if y > x:
#    print("y > x")
    while y > x:
        x += 1
        z = x * 0.08
    if z >= A + 1:
        print(-1)
        exit()
    else:
        print(int(x))
        exit()

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

a,b = LI()
tax8 = int(100/8*a)
tax10 = int(100/10*b)
# print(tax8,tax10)
print(max(tax8,tax10) if tax8==tax10 else -1)

Submission status: Wrong Answer

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

x = A / 0.08
#print(x)

y = B / 0.1
#print(y)

if x == y:
    print(int(x))
    exit()

if y < x:
    while y < x:
        y += 1
        z = y * 0.1
    if z >= B + 1:
        print(-1)
        exit()
    else:
        print(int(x))
        exit()

if y > x:
    while y > x:
        x += 1
        z = x * 0.08
    if z >= A + 1:
        print(-1)
        exit()
    else:
        print(int(y))
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a,b=map(int,input().split())
for i in range(1,1001):
    if i*0.08-(8*i)%100/100==a and i*0.1-(10*i)%100/100==b:
        print(i)
        sys.exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import sys
a,b=map(int,input().split())
for i in range(1000):
    if i*0.08-(8*i)%100/100==a and i*0.1-(10*i)%100/100==b:
        print(i)
        sys.exit()
print(-1)

Submission status: Wrong Answer

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

Xmin = math.ceil(A / 0.08)
Xmax = math.floor((A + 1) / 0.08)
Ymin = math.ceil(B / 0.1)
Ymax = math.floor((B + 1) / 0.1)

if (Xmin > Ymin):
    if (Xmin <= Ymax):
        print(Xmin)
        sys.exit(0)
else:
    if (Ymin <= Xmax):
        print(Ymin)
        sys.exit(0)
print("-1")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
k=[]
o=[]
p=[]
for i in range(1,101):
    if int(i*0.08)==a:
        k.append(i)
for j in range(1,101):
    if int(j*0.1)==b:
        o.append(j)
for t in range(len(k)):
    for u in range(len(o)):
        if k[t]==o[u]:
            p.append(k[t])
if p==[]:
    print(-1)
else:
    print(min(p))

Submission status: Wrong Answer

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

N_list = [i for i in range(1, 1251)]
for i in N_list:
  for j in N_list:
    if 0.08*i == A and 0.1*j == B:
      print(i)
      exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math

A,B = (int(x) for x in input().split())
result = False
y = int(A * 12.5)
z = int((A+1)*12.5+1)
#if B >= A:

for h in range(y,z):
    #print(h)
    if result == True:
        break

    for i in range(B*10 ,(B+1)*10):
       
        if i == h:
            result = True
            break
       
if result == True:
    print(i)
else:
    print(-1)

Submission status: Wrong Answer

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

c =0 
for n in range(0,10000):
    taxa = n*0.08
    taxb = n*0.1
    if a == taxa and b == taxb:
        print(n)
        break
    else:
        c += 1
if c > 9999:
    print(-1)

Submission status: Wrong Answer

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

c =0 
for n in range(0,10000):
    taxa = n*0.08
    taxb = n*0.1
    if a == taxa and b == taxb:
        print(n)
        break
    else:
        c += 1
if c > 999:
    print(-1)

Submission status: Wrong Answer

Solution code:
def gcd(m,n):
    x = max(m,n)
    y = min(m,n)
    if x%y == 0:
        return y
    else:
        while x%y!=0:
            z = x%y
            x = y 
            y = z
        else:
            return z
import math
a, b = map(int, input().split())
A = math.floor(a/0.08)
B = math.floor((a/0.8)/0.1)


c = gcd(A, B)
if c == 1:
    print(-1)
else:
    print(c)

Submission status: Wrong Answer

Solution code:
A,B = (int(x) for x in input().split())
result = False
price1 = int(A / 0.08)

for i in range(B*10 ,(B+1)*10):
    #print(i)
    if price1 == i:
        result = True
        break
if result == True:
    print(price1)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

per8 = int(a / 0.08)
per10 = int(b / 0.1)

if math.floor(per8/10) == math.floor(per10/10):
    print(max(per8, per10))
else:
    print(-1)

Submission status: Wrong Answer

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

for price in range(1, 1000):
#    print(price)
    if A == price*8//100 and B == price*10//100:
        print(price)
        sys.exit()
print(-1)

Submission status: Wrong Answer

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

for price in range(1, min([A//8*100, B//10*100])+1):
#    print(price)
    if A == price//100*8 and B == price//100*10:
        print(price)
        sys.exit()
print(-1)

Submission status: Wrong Answer

Solution code:
"""
a = int(x*0.08)
a <= x*0.08 < a+1
a/0.08 <= x < (a+1)/0.08

b = int(x*0.1)
b <= x*0.1 < b+1
b/0.1 <= x < (b+1)/0.1
"""

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
a,b = [int(i) for i in readline().split()]

a_lower = int(a/0.08)
a_upper = int((a+1)/0.08)

for i in range(a_lower, a_upper+1):
    if b/0.1 <= i < (b+1)/0.1:
        print(i)
        break
    else:
        continue
    break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
"""
a = int(x*0.08)
a <= x*0.08 < a+1
a/0.08 <= x < (a+1)/0.08

b = int(x*0.1)
b <= x*0.1 < b+1
b/0.1 <= x < (b+1)/0.1
"""

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
a,b = [int(i) for i in readline().split()]

a_lower = int(a/0.08)
a_upper = int((a+1)/0.08)

b_lower = int(b/0.1)
b_upper = int((b+1)/0.1)

for i in range(a_lower, a_upper+1):
    if b_lower < i <= b_upper:
        print(i)
        break
    else:
        continue
    break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
"""
a = int(x*0.08)
a <= x*0.08 < a+1
a/0.08 <= x < (a+1)/0.08

b = int(x*0.1)
b <= x*0.1 < b+1
b/0.1 <= x < (b+1)/0.1
"""

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
a,b = [int(i) for i in readline().split()]

a_lower = int(a/0.08)
a_upper = int((a+1)/0.08)

b_lower = int(b/0.1)
b_upper = int((b+1)/0.1)

for i in range(a_lower, a_upper+1):
    if b_lower <= i <= b_upper:
        print(i)
        break
    else:
        continue
    break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=q
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)

a,b = readInts()
for x in range(10*b-1,10*b+10):
	if math.floor(x*0.08)==a:
		print(x)
		exit()

print(-1)

Submission status: Wrong Answer

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

    for i in range(int(B/0.1), int(A/0.08)+1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            print(i)
            return

    print(-1)
    
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
for x in range(1,200):
    if math.floor(x*0.08)==a and math.floor(x*0.10)==b:
        print(x)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

a , b = map(int, input().strip().split())
x = math.floor(a / 0.08)
y = math.ceil((a + 1) / 0.08)
ans = -1

for i in range(1250):
  if math.floor(i * 0.1) == b:
    ans = i
    break

print(ans)

Submission status: Wrong Answer

Solution code:
import math

a , b = map(int, input().strip().split())
x = math.floor(a / 0.08)
y = math.ceil((a + 1) / 0.08)
ans = -1

for i in range(x, y):
  if math.floor(i * 0.1) == b:
    ans = i
    break

print(ans)

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
s=[]
t=[]
s.append(range(math.ceil(12.5*a),int(12.5*a+12.5)+1))
t.append(range(10*b, 10*b+10))
s_t_and= list(set(s)&set(t))
s_t_and.sort()
if s_t_and==[]:
  print('-1')
else:
  print(s_t_and[0])

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
i=1
while i<=10000:
  if (int((i*0.08)==A)) and (int((i*0.1)==B)):
    print(i)
    exit()
  i+=1
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
 
i=1
while i<=10000:
  if (int(i*0.08==A)) and (int(i*0.1==B)):
    print(i)
    exit()
  i+=1
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
 
i=1
while i<=10000:
  if i*0.08==A and i*0.1==B:
    print(i)
    exit()
  i+=1
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
 
i=1
while i<=10000:
  if i*0.08==A and i*0.1==B:
    print(i)
    quit()
  i+=1
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
 
i=1
while i<=10000:
  if A*0.08==i and B*0.1==i:
    print(i)
    quit()
  i+=1
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
 
i=0
while i<10000:
  if A*0.08==i and B*0.1==i:
    print(i)
    quit()
  i+=1
print(-1)

Submission status: Wrong Answer

Solution code:
ratio_8,ratio_10 = map(int,input().split())
max_price = int((ratio_8+1)/0.08) if ratio_8 % 0.08 != 0 else int((ratio_8+1)/0.08) + 1
ratio_8_list = [i for i in range(int(ratio_8/0.08),max_price)]
price = -1
for num in ratio_8_list:
  if int(num*0.1) == ratio_10:
    price = num
    break
print(price) if price >=0 else print("-1")

#print(ratio_8_list[-1]*0.08,ratio_8_list[-1]*0.1)

Submission status: Wrong Answer

Solution code:
ratio_8,ratio_10 = map(int,input().split())
ratio_8_list = [i for i in range(int(ratio_8/0.08),int((ratio_8+1)/0.08))]
price = -1
for num in ratio_8_list:
  if int(num*0.1) == ratio_10:
    price = num
    break
print(price) if price >=0 else print("-1")

#print(ratio_8_list[-1]*0.08,ratio_8_list[-1]*0.1)

Submission status: Wrong Answer

Solution code:
ratio_8,ratio_10 = map(int,input().split())
ratio_8_list = [i for i in range(int(ratio_8/0.08),int((ratio_8+1)/0.08)+1)]
price = -1
for num in ratio_8_list:
  if int(num*0.1) == ratio_10:
    price = num
    break
print(price) if price >=0 else print("-1")

Submission status: Wrong Answer

Solution code:
ratio_8,ratio_10 = map(int,input().split())
ratio_8_list = [i for i in range(int(ratio_8/0.08),int((ratio_8+1)/0.08)+1)]
price = -1
for num in ratio_8_list:
  if int(num*0.1) == ratio_10:
    price = num
    break
print(price)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def tax8(n):
    return int(n*(25/2))
    
def tax10(n):
    return int(n*(10/1))

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

ans = -1

x = []
for i in range(1,a+1):
    if tax8(i) == a:
        x.append(i)
        
y = []
for i in range(1,b+1):
    if tax10(i) == b:
        y.append(i)
        
for i in x:
    if i in y:
        ans = i
        break
    
print(ans)

Submission status: Wrong Answer

Solution code:
def tax8(n):
    return int(n*(1.08))
    
def tax10(n):
    return int(n*(1.1))

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

ans = -1

x = []
for i in range(1,a+1):
    if tax8(i) == a:
        x.append(i)
        
y = []
for i in range(1,b+1):
    if tax10(i) == b:
        y.append(i)
        
for i in x:
    if i in y:
        ans = i
        break
    
print(ans)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
a = math.ceil(a / 0.08)
b = int(b / 0.1)
tmp_a = set([i for i in range(a, a+13)])
tmp_b = set([i for i in range(b, b+10)])
if len(tmp_a & tmp_b) == 0:
    print(-1)
else:
    print(min(tmp_a & tmp_b))

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if A%2==0:
  a={i for i in range(int(A/0.08),int((A+1)/0.08)+1)}
else:
  a={i for i in range(int(A/0.08)+1,int((A+1)/0.08))}   
 

b={j for j in range(int(B/0.1),int((B+1)/0.1))}
c=a&b
if c==set():
  print(-1)
else:
  d=list(c)
  print(d[0])

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a = float(a)
b = float(b)
for i in range(10000):
	tmp = float(i)
	if tmp * 0.08 == a and tmp * 0.1 == b:
		print(i)
		exit(0)
	if tmp * 0.08 == b and tmp * 0.1 == a:
		print(i)
		exit(0)
print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a = float(a)
b = float(b)
for i in range(10000):
	tmp = float(i)
	if tmp * 0.08 == a and tmp * 0.1 == b:
		print(i)
		exit(0)
print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a = float(a)
b = float(b)
for i in range(-7000, 7001, 1):
	if float(i) * 0.08 == a and float(i) * 0.1 == b:
		print(i)
		exit(0)
print(-1)

Submission status: Wrong Answer

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

for i in range(1,101):
    va = int(i * 1.08)
    vb = int(i * 1.1)
    if(va == a and vb == b):
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

at = -(-a//0.08)
aat= -((-a-1)//0.08)
bt = -(-b//0.1)
bbt= -(-(b+1)//0.1)
if bbt < at or bt > aat:
    print(-1)
else:
    print(int(min(at,bbt)))

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
ak = []
bk = []
for k in range(-int((-A/0.08)//1),-int(-(A/0.08+12.5)//1)):
  ak.append(k)
for k in range(-int((-B/0.10)//1),-int(-(B/0.10+10.0)//1)):
  bk.append(k)
print(ak)
print(bk)
ans = min(set(ak) & set(bk)) if len(set(ak) & set(bk)) > 0 else -1
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
ak = []
bk = []
for k in range(int(-(-A/0.08)),int(A/0.08+12.5)):
  ak.append(k)
for k in range(int(-(-B/0.10)),int(B/0.10+10.0)):
  bk.append(k)
ans = min(set(ak) & set(bk)) if len(set(ak) & set(bk)) > 0 else -1
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
ak = []
bk = []
for k in range(int(-(-A/0.08)),int(A/0.08+12.5)):
  ak.append(k)
for k in range(int(-(-B/0.10)),int(B/0.10+10.0)):
  bk.append(k)
ans = min(set(ak) & set(bk)) if len(set(ak) & set(bk)) > 0 else -1

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
ub , lb = int(A / 8 * 100), int(B / 10 * 100)
if ub < lb:
    print(-1)
else:
    for i in range(1,101):
        if math.floor(i * 0.08) == A:
            if math.floor(i * 0.1) == B:
                print(i)
                break
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
ub , lb = int(A / 8 * 100), int(B / 10 * 100)
if ub < lb:
    print(-1)
else:
    for i in range(lb, ub+1):
        if math.floor(i * 0.08) == A:
            if math.floor(i * 0.1) == B:
                print(i)
                break
    else:
        print(-1)

Submission status: Wrong Answer

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

nmin = int(max(a/0.08, b/0.1))
nmax = int(min((a+1)/0.08, (b+1)/0.1))
list = []
for x in range(nmin, nmax+1):
    list.append(x)
if list == []:
    print(-1)
else:
    print(min(list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
C = -int(min([-A*12.5,-B*10]))
if 10*B<= C <10*(B+1) and 12.5*A<= C< 12.5*(A+1):
  print(C)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
C = -int(min([-A*12.5,-B*10]))
if 10*B<= C <10*(B+1) and 12.5*B<= C< 12.5*(B+1):
  print(C)
else:
  print(-1)

Submission status: Wrong Answer

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

for i in range(1001):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
    else:
        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
    
    if (kmina <= kminb) and (kminb < kmaxa):
        print(kminb)    
    elif (kminb <= kmina) and (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:
A, B = map(int, input().split())

before = B * 10
not_found = True

for i in range(20):
  res = before + i
  tmp = (before + i) * 8 // 100
  if tmp == A:
    print(res)
    not_found = False
    break

if not_found:
  print(-1)

Submission status: Wrong Answer

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

before = B * 10
not_found = True

for i in range(14):
  res = before + i
  tmp = int((before + i) * 0.08)
  if tmp == A:
    print(res)
    not_found = False
    break

if not_found:
  print(-1)

Submission status: Wrong Answer

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

before = B * 10
not_found = True

for i in range(13):
  res = before + i
  tmp = int((before + i) * 0.08)
  if tmp == A:
    print(res)
    not_found = False
    break

if not_found:
  print(-1)

Submission status: Wrong Answer

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

before = B * 10

for i in range(13):
  res = before + i
  tmp = int((before + i) * 0.08)
  if tmp == A:
    print(res)
    break

Submission status: Wrong Answer

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

def main():
    A, B = map(int, open(0).read().split())

    ans_A = []
    for i in range(math.floor(12.5 * A), math.floor(12.5 * A + 12.5 + 1)):
        ans_A.append(i)
    ans_B = []
    for i in range(math.floor(10*B), math.floor(10*B + 10 + 1)):
        ans_B.append(i)
    ans = set(ans_A) & set(ans_B)
    if len(ans) == 0:
        print(-1)
    else:
        print(min(list(ans)))


main()

Submission status: Wrong Answer

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

def main():
    A, B = map(int, open(0).read().split())

    ans_A = []
    for i in range(int(12.5 * A), int(12.5 * A + 12.5 + 1)):
        ans_A.append(i)
    ans_B = []
    for i in range(int(10*B), int(10*B + 10 + 1)):
        ans_B.append(i)
    ans = set(ans_A) & set(ans_B)
    if len(ans) == 0:
        print(-1)
    else:
        print(min(list(ans)))


main()

Submission status: Wrong Answer

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

def main():
    A, B = map(int, open(0).read().split())

    ans_A = []
    for i in range(int(12.5 * A), int(12.5 * A + 12.5)):
        ans_A.append(i)
    ans_B = []
    for i in range(int(10*B), int(10*B + 10)):
        ans_B.append(i)
    ans = set(ans_A) & set(ans_B)
    if len(ans) == 0:
        print(-1)
    else:
        print(min(list(ans)))


main()

Submission status: Wrong Answer

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

if x > 0 and y > 0 and x == y:
  print(x)
else:
  print(-1)

Submission status: Wrong Answer

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

if x > 0 and y > 0 and x == y:
  print(x)
elif x > 0 and y > 0 and x != y:
  print(min(x,y))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
li = []
max = math.ceil(a*100/8)

for i in range(1, max+1):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        li.append(i)

for item in li:
    print(item)
    exit()
print(-1)