Problem:


Score : 300 points

Problem Statement

Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)

Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.

If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.

Constraints

1 \leq A \leq B \leq 100

A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

If there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.

Sample Input 1

2 2

Sample Output 1

25

If the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:

When the consumption tax rate is 8 percent: \lfloor 25 \times 0.08 \rfloor = \lfloor 2 \rfloor = 2 yen.

When the consumption tax rate is 10 percent: \lfloor 25 \times 0.1 \rfloor = \lfloor 2.5 \rfloor = 2 yen.

Thus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.

Sample Input 2

8 10

Sample Output 2

100

If the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:

When the consumption tax rate is 8 percent: \lfloor 100 \times 0.08 \rfloor = 8 yen.

When the consumption tax rate is 10 percent: \lfloor 100 \times 0.1 \rfloor = 10 yen.

Sample Input 3

19 99

Sample Output 3

-1

There is no price before tax satisfying this condition, so print -1.



Sample input:
2 2


Sample output:
25

Submission status: Wrong Answer

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

if b-a >= 2 :
    if b/a > 1.25 :
        cst = -1
    else :
        cst = int((b-a)/0.02)

else :
    if b/a > 1.25 :
        cst = -1
    else :
        cst_a = a / 0.08
        cst_b = b / 0.1
        if cst_a < cst_b :
            cst = int(cst_a)
        elif cst_a > cst_b :
            cst = int(cst_b)

print(int(cst))

Submission status: Wrong Answer

Solution code:
n=list(map(int,input().split()))
import math
A=int(math.ceil(n[0]/0.08))
B=int(n[1]/0.1)
C=int((n[1]+1)/0.1)
D=int(math.ceil((n[0]+1)/0.08))

if A<<C and B<<D:
    if A==B:
        print(A)
    if A>>B:
        print(A)
    if A<<B:
        print(B)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
ans = '-1'

for n in range(1, 1000):
    if n // (1/0.08) == A and n // (1/0.1) == B:
        ans = n
        break

print(ans)

Submission status: Wrong Answer

Solution code:
A,B = (int(x) for x in input().split())
for i in range(1,101):
    Ahan = int(i * 0.08)
    Bhan = int(i * 0.10)
    if (Ahan == A and Bhan == B):
        print(i)
        break
    
    if(i == 100):
        print(-1)
        break

Submission status: Wrong Answer

Solution code:
import math as mt
K = input().split(" ")
A = int(K[0])
B = int(K[1])
a = float(A*12.5)
t = float((A+1)*12.5)
t1 = mt.ceil(t)
b = B*10
a1 = mt.ceil(a)
A_data = []
B_data = []
for i in range(b,b+10):
    A_data.append(i)
for i in range(a1,a1+t1):
    B_data.append(i)
A_set = set(A_data)
B_set = set(B_data)
AB_set = A_set & B_set
if AB_set:
    P = min(AB_set)
    print(P)
else:
    print(-1)

Submission status: Wrong Answer

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

tax8 = int(A / 0.08)
tax10 = int(B / 0.1)
window = [min(tax8, tax10), max(tax8, tax10)]

for i in range(window[0], window[1] + 1):
    for j in range(window[0], window[1] + 1):
        if int(i * 0.08) == int(j * 0.08) and int(i * 0.08) == A and int(j * 0.1) == B:
            print(i)
            exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int, input().split())
if a==0 and b==0:
    print(0)
    exit()
if a==1 and b == 1:
    print(13)
    exit()
if a==0 and b == 1:
    print(12)
    exit()
x=math.ceil(25/2*a)
if int(x*0.08)==a and int(x*0.1)==b:
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
taxs = input().split(" ")

a = int(taxs[0])
b = int(taxs[1])

product = a / 0.08
product = int(product + 0.5)
bpred = int(product * 0.1)

if( bpred == b ):
  print( product )
else:
  print( -1 )

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(floor(rangeMin+0.5))

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int, input().split())
if a==0 and b==0:
    print(0)
    exit()
if a==1 and b == 1:
    print(13)
if a==0 and b == 1:
    print(12)
x=math.ceil(25/2*a)
if int(x*0.08)==a and int(x*0.1)==b:
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
eight, tens = [int(x) for x in input().split()]
vals = lambda x, y: (x * y) // 100
found = False
for i in range(1, 101):
    if vals(i, 8) == eight and vals(i, 10) == tens:
        print(i)
        found = True
        break
if not found:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
ans_a = 0
ans_b = 0
"""
if math.floor((a/0.08) *0.1) == b:
    ans_a = b/0.1
elif math.floor((b/0.1) *0.08) == a:
    ans_b = a/0.08
"""
if math.ceil((a-1)/0.08) <= b/0.1 and math.floor((a+1)/0.08) >= b/0.1:
    ans_a = a/0.08
if math.ceil((b+1)/0.1) <= a/0.08 and math.floor((b+1)/0.1) >= a/0.8:
    ans_b = b/0.1
if ans_a>ans_b and ans_b!=0 :
    print(ans_a)
elif ans_a<ans_b and ans_a!=0 :
    print(ans_b)
elif ans_a==0 or ans_b ==0:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
def main():
    A,B = map(int, input().split())
    sA=math.floor(A/0.08)
    sB=math.floor(B/0.1)
    if sA <= sB:
        if sA+12 >= sB+10:
            print(sB)
            return
        elif sA+12 < sB+10 and sA+12 >= sB:
            print(sB)
            return
        else:
            print(-1)
            return
    elif sA > sB :
        if sA <=sB+10:
            print(sA)
            return
        else:
            print(-1)
            return
main()

Submission status: Wrong Answer

Solution code:
a, b = input().split() # a = result * 0.08, b = result * 0.1
a, b = int(a), int(b)
 
result_a = int(a / 0.08)
result_b = int(b / 0.1)
 
if result_a < 0 or result_b < 0:
  print(-1)
elif result_a > result_b:
  c = int(result_a * 0.1)
  if b == c:
    print(result_a)
  else:
    print(-1)
else:
  c = int(result_b * 0.08)
  if a == c:
    print(result_b)
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
sampleA=A*100/8
sampleB=B*10
sampleA=int(sampleA)
sampleB=int(sampleB)
ans=[]
for i in range(max(sampleA,sampleB),max(sampleA,sampleB)+100):
    if int(math.floor(i*8/100))==A and int(math.floor(i*0.1))==B:
        ans.append(i)
        break
    else:
        ans.append(-1)
print(min(ans))

Submission status: Wrong Answer

Solution code:
a,b=map(float,input().split())
a=a*100/8
b=b*100/10
print(int(max(a,b)))

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
x_1 = math.floor(a / 0.08)

max_count = 1
while True:
    zeikomi = math.floor((x_1 + max_count) * 0.08)
    if zeikomi != a or math.floor(zeikomi * 0.1) != b:
        break
    max_count += 1

for i in range(max_count + 1):
    value = x_1 + i
    if math.floor(value * 0.1) == b:
        print(value)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math
[a, b] = [int(i) for i in input().split()]
eight = range(math.floor(a / 8 * 100), math.floor((a+1) / 8 * 100))
ten = range(math.floor(b / 10 * 100), math.floor((b+1) / 10 * 100))

st = set(eight) & set(ten)
if st:
    print(sorted(list(st))[0])
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
def resolve():
    a, b = map(int, input().split())
    left, right = 0, 1020
    while left < right:
        mid = (left + right) // 2
        eight = math.floor(mid * 0.08)
        ten = math.floor(mid * 0.1)
        if a == eight and ten == b and eight <= ten:
            pre_e = math.floor((mid-1) * 0.08)
            pre_t = math.floor((mid-1) * 0.1)
            while pre_e == a and pre_t == b:
                pre_e = math.floor((mid - 1) * 0.08)
                pre_t = math.floor((mid - 1) * 0.1)
                if pre_e == a and pre_t == b:
                    mid -= 1
            return print(mid)
        elif a <= eight:
            right = mid
        elif a > eight:
            left = mid + 1
    return print(-1)

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

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

# 切り上げ
amin = math.ceil(a / 0.08)
bmin = math.ceil(b / 0.1)
# 切り捨て
amax = math.floor((a+1) / 0.08)
bmax = math.floor((b+1) / 0.1)
#print("{},{}".format(amin, bmin))
#print("{},{}".format(amax, bmax))

ret = -1
for i in range(amin, amax+1, 1):
    if bmin <= i and i <= bmax:
        ret = i
        break

print("{}".format(ret))

Submission status: Wrong Answer

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

tax8 = int(A / 0.08)
tax10 = int(B / 0.1)
window = [min(tax8, tax8), max(tax8, tax10)]

for i in range(window[0], window[1] + 1):
    for j in range(window[0], window[1] + 1):
        if int(i * 0.08) == int(j * 0.08) and int(i * 0.08) == A and int(j * 0.1) == B:
            print(i)
            exit()
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
T8_1 = A / 0.08
T8_2 = (A+1) / 0.08 - 0.001
T10_1 = B / 0.10
T10_2 = (B+1) / 0.10 - 0.001
import math
T8 = list(range(math.ceil(T8_1), math.floor(T8_2)+1))
T10 = list(range(math.ceil(T10_1), math.floor(T10_2)+1))
S_list = list(set(T8) & set(T10))
if not S_list:
    print('-1')
else:
    print(S_list[0])

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if 1<=A<=B<=100:
    A_a=A+1
    B_b=B+1
    A_1=A*(100/8)
    B_1=B*(100/10)
    A_1a=A_a*(100/8)
    B_1b=B_b*(100/10)
    if (A_1<B_1b)and(B_1<A_1a):
        if A_1<B_1:
            A_2=int(A_1)
            print(A_2)
        else:
            B_2=int(B_1)
            print(B_2)
    else:
        print("-1")
else:
    None

Submission status: Wrong Answer

Solution code:
line = input().rstrip().split(' ')
a = int(line[0])
b = int(line[1])

ta = int(a / 0.08)
tb = int(b / 0.1)

if ta == tb:
    print(ta)
else:
    ta_max = (a + 1) / 0.08
    tb_max = (b + 1) / 0.1

    if ta_max < tb or tb_max < ta:
        print(-1)
    elif ta < tb and tb < ta_max:
        print(tb)
    else:
        print(ta)

Submission status: Wrong Answer

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

P = A / 0.08
PX = (A+1) / 0.08

PP = B / 0.1
PPX = (B+1) /0.1 

if PP <= P and P < PPX: print(P)
elif P <= PP and PP < PX: print(PP)
else:print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=(int(x) for x in input().split())
x = int(A) / 0.08
y = int(B) / 0.1

if math.floor(x) == math.floor(y):
    print(math.floor(x))
else:
    print("-1")

Submission status: Wrong Answer

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

pa=int(a/0.08)
t=pa-100
al=[]
for p in range(100):
    if int(t*0.08)==a:
        al.append(t)
    
    t=t+1

t=pa
while int(t*0.08)==a:
    al.append(t)
    t=t+1



pb=int(b/0.10)
t=pb-100
bl=[]
for p in range(100):
    if int(t*0.10)==b:
        bl.append(t)
    
    t=t+1

t=pb
while int(t*0.10)==b:
    bl.append(t)
    t=t+1

if len(al)<=len(bl):
    kai=len(al)
else:
    kai=len(bl)

ea=0
eb=0
match=0
mp=0

for f in range(kai):
    if al[ea]==bl[eb]:
        match=1
        mp=al[ea]
        break
    elif al[ea]>bl[eb]:
        eb=eb+1
    elif al[ea]<bl[eb]:
        ea=ea+1

if match==1:
    print(mp)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

X = A / 0.08
Y = B / 0.1

if X > Y:
    Z = X * 0.2

    if Y + Z == X:
        print(X)
    else:
        print(-1)
else: 
    Z = Y * 0.2
    
    if X + Z == Y:
        print(Y)
    else:
        print(-1)

Submission status: Wrong Answer

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

a = A / 0.08
b = B / 0.10

if A == int(a * 0.08) and B == int(a * 0.10):
    print(int(a))
elif A == int(b * 0.08) and B == int(b * 0.10) :
    print(int(b))
else :
    print('-1')

Submission status: Wrong Answer

Solution code:
import math

"""
p = int(input())
s1,s2 = p*0.08, p*0.1
print("消費税:", s1,s2)
print("消費税_切捨:", round(s1),round(s2))
a,b = round(s1/0.08), round(s2/0.1)
ar,br = math.floor(s1)/0.08, math.floor(s2)/0.1
print("定価_精密: ", a, b)
print("定価_切捨: ", ar, br)
"""

a,b = map(int,input().split())
pr1,pr2 = int(math.floor(a)/0.08), int(math.floor(b)/0.1)

#print(str(pr1)[-1],str(pr2)[-1])

if str(pr1)[:-1] != str(pr2)[:-1]:
	print(-1)

else: print(int(max(pr1, pr2)))
#print("定価_切捨: ", pr1, pr2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,101):
    if math.floor(i * 0.08) == a:
        for j in range(1,101):
            if math.floor(j * 0.1) == b and a <= b:
                print(i)
                exit()

print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

x = math.floor(A/0.08)
y = math.floor(B/0.1)

if(math.floor(x*0.1)!=B):
  print("-1")

else:
  while(y<=x):
    if(math.floor(y*0.1)==math.floor(y*0.08)):
      if(y<r):
        r=y
    y+=1

  print(r)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
if A / 8 * 100 == B * 10: print(B * 10)
else:
  a = []
  b = []
  for i in range(10):
    if ((A + (0.1 * i)) * 100 / 8).is_integer():
      a.append((A + (0.1 * i)) * 100 / 8)
    b.append((B + (0.1 * i)) * 10)
  ans = list(set(a) & set(b))
  
  print(round(ans[0]) if len(ans) > 0 else -1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
u = min(int(a / 0.08), int(a / 0.1))
t = max(int(a / 0.08), int(a / 0.1))
r = False
for i in range(u, t + 1):
    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())
T8_1 = A / 0.08
T8_2 = (A+1) / 0.08 - 0.001
T10_1 = B / 0.10
T10_2 = (B+1) / 0.10 - 0.001
import math
T8 = list(range(math.ceil(T8_1), math.floor(T8_2)+1))
T10 = list(range(math.ceil(T10_1), math.floor(T10_2)+1))
print(T8)
print(T10)
S_list = list(set(T8) & set(T10))
if not S_list:
    print('-1')
else:
    print(S_list[0])

Submission status: Wrong Answer

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

if (fractions.gcd(A,B)==1):
    print(-1)
    sys.exit()
for i in range(10**100):
    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 = list(map(int, input().split(' ')))
a = 0.08
b = 0.10

x_min = math.floor(A / a)
x_max = math.floor((A+1) / a)
y_min = math.floor(B / b)
y_max = math.floor((B+1) / b)

X = set(range(x_min, x_max))
Y = set(range(y_min, y_max))

r = X & Y
R = min(r) if len(r) > 0 else -1
if len(r) == 1 and R == 0:
  R = -1
  
print(R)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
i = 0
while a >= i * 0.08:
    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())
### 8%
a1 = a
x_a1 = -(-a1/0.08)
a2 = a+1
x_a2 = a2/0.08
### 10%
b1 = b
y_b1 = -(-b1 / 0.1)
b2 = b+1
y_b2 = b2 / 0.1
### 判定
if y_b1 <= x_a1 < y_b2:
  print (x_a1)
elif x_a1 <= y_b1 < x_a2:
  print (y_b1)
else:
  print(-1)

Submission status: Wrong Answer

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

Amax = (A+1) / 0.08
Bmax = (B+1) / 0.1
Ansmin = max(A / 0.08, B / 0.1)

if Ansmin < min(Amax, Bmax):
    print(int(Ansmin))
else:
    print(int(-1))

Submission status: Wrong Answer

Solution code:
import math

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

x = math.ceil(A/0.08)
y = math.floor(B/0.1)

if(math.floor(x*0.1)!=B):
  print("-1")

else:
  while(y<=x):
    if(math.floor(y*0.1)==math.floor(y*0.08)):
      if(y<r):
        r=y
    y+=1

  print(r)

Submission status: Wrong Answer

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

vlaue_a_1 = 12.5*a
value_b_1 = int(0.1*vlaue_a_1)
ans_a = 0

if b == int(value_b_1):
    ans_a = vlaue_a_1
else:
    ans_a = -1

vlaue_b_2 = 10*b
value_a_2 = int(0.08*vlaue_b_2)
ans_b = 0

if a == int(value_a_2):
    ans_b = vlaue_b_2
else:
    ans_b = -1




if ans_a != -1:
    if int(int(ans_a)*0.08) == 0:
        while True:
            if int(int(ans_a)*0.08) <= 0:
                ans_a += 1
            else:
                break
if ans_b != -1:
    if int(int(ans_b)*0.08) == 0:
        while True:
            if int(int(ans_b)*0.08) <= 0:
                ans_b += 1
            else:
                break

if ans_a != -1:
    if int(ans_a*0.08) != a and int(ans_b*0.1) != b:
        ans_a = -1
        ans_b = -1
if ans_b != -1:
    if int(ans_a*0.08) != a and int(ans_b*0.1) != b:
        ans_a = -1
        ans_b = -1


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:
def floor(n):
    if int(n) < n:
        return n + 1
    else:
        return int(n)

def get_max_min(n, p):
    return [floor(p*n), int(p*(n+1))]
  
data = input()
A, B = [int(i) for i in data.split()]
 
a_data = get_max_min(A, 1/0.08)
b_data = get_max_min(B, 10)
 
result = -1
 
# if (a_data[1] < b_data[0]) or (b_data[1] < a_data[0]):
#     result = -1
if a_data[0] <= b_data[0] < a_data[1]:
    result = b_data[0]
elif b_data[0] <= a_data[0] < b_data[1]:
    result = a_data[0]
else:
    result = -1
    
print(result)

Submission status: Wrong Answer

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

if b-a >= 2 :
    if b/a > 1.25 :
        cst = -1
    else :
        cst = int((b-a)/0.02)

else :
    cst_a = a / 0.08
    cst_b = b / 0.1
    if cst_a < cst_b :
        cst = int(cst_a)
    elif cst_a > cst_b :
        cst = int(cst_b)

print(int(cst))

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
if(math.ceil(a/0.08) < math.ceil(b/0.1)):
    print(-1)
else:
    print(math.ceil(a/0.08))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=list(map(int,input().split()))
a=int(n[0]/(0.08))
b=int(n[1]/(0.1))
if abs(b-a)<10:
    if int(b/10)==int(a/10):
        print(a)
    else:
        print(-1)
else:
    print(-1)

Submission status: Wrong Answer

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

ansA = math.floor(25/2*A)
ansB = math.floor(10*B)
mini = min(ansA,ansB)
maxi = max(ansA,ansB)

if ansA == ansB:
    print(ansA)
    exit()
for i in range(mini,maxi+1):
    check1 = math.floor(i*0.08)
    check2 = math.floor(maxi*0.1)
    if check1 == check2:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

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

tax8 = math.floor(a/0.08)
tax10 = math.floor(b/0.1)


if math.floor(tax8 * 0.08) != a or math.floor(tax10 * 0.1) != b:
    print(-1)
    exit(0)

cnt = 0
while True:
    cnt = cnt + 1
    if math.floor((tax8 + cnt) * 0.08) != a:
        tax8max = tax8 + cnt - 1
        break

cnt = 0
while True:
    cnt = cnt + 1
    if math.floor((tax8 - cnt) * 0.08) != a:
        tax8min = tax8 - cnt + 1
        break

cnt = 0
while True:
    cnt = cnt + 1
    if math.floor((tax10 + cnt) * 0.1) != b:
        tax10max = tax10 + cnt - 1
        break

cnt = 0
while True:
    cnt = cnt + 1
    if math.floor((tax10 - cnt) * 0.1) != b:
        tax10min = tax10 - cnt + 1
        break

tax8s = set(range(tax8min, tax8max))
tax10s = set(range(tax10min, tax10max))
taxl = sorted(list(tax8s & tax10s))

if taxl == []:
    print(-1)
    exit(0)

print(taxl[0])

Submission status: Wrong Answer

Solution code:
import math

a,b=map(int,input().split())
if a%2==0:
    s=a*12.5
    s=math.floor(s)
    if s-b*10==5:
        print(s)
    elif b*10-s==5:
        print(b*10)
    elif b*10==s:
        print(s)
    else:
        print(-1)
else:
    t=a*12.5 +0.5
    if t-b*10==3 or t-b*10==8:
        t=math.floor(t)
        print(t)

    elif b*10-t==7 or b*10-t==2:
        print(b*10)
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

a_low = int(a/0.08)
if a_low < 1:
  a_low = 1
a_up = int((a+0.999999999)/0.08)
if a_up < 1:
  a_up = 1
a_list = list(np.arange(a_low, a_up+1))

b_low = int(b/0.1)
if b_low < 1:
  b_low = 1
b_up = int((b+0.999999999)/0.1)
if b_up < 1:
  b_up = 1
b_list = list(np.arange(b_low, b_up+1))

#print(a_low)
#print(a_list)

#print(b_low)
#print(b_list)

if a_low in b_list:
  print(a_low)
elif b_low in a_list:
  print(b_low)
else:
  print('-1')

Submission status: Wrong Answer

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

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

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

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

print(result)

Submission status: Wrong Answer

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

aRange = [math.floor(a * (100 / 8)), math.floor(a * (100 / 8) + 9)]
bRange = [math.floor(b * (100 / 10)), math.floor(b * (100 / 10) + 9)]

if aRange[1] < bRange[0] or aRange[0] > bRange[1]:
    print(-1)
    exit()

if aRange[0] <= bRange[0]:
    print(bRange[0])
else:
    print(aRange[0])

Submission status: Wrong Answer

Solution code:
#C
A, B = list(map(int, input().split()))
ans1min = A/0.08
ans1max = (A+1)/0.08
ans2min = B/0.1
ans2max = (B+1)/0.1

#print(ans1min)
#print(ans2min)
if ans1min >= ans2min and ans1min < ans2max:
    print(int(ans1min))
elif ans1min <= ans2min and ans2min < ans1max:
    print(int(ans2min))
else:
    print('-1')

Submission status: Wrong Answer

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

a_tax_min = a* 12.5
b_tax_min = b * 10
a_tax_max = (a+1) * 12.5
b_tax_max = (b+1) * 10

if b_tax_min <= a_tax_min and a_tax_min <= b_tax_max and b_tax_max <= a_tax_max :
    if a_tax_min.is_integer() :
        print(int(a_tax_min))
    else :
        print(int(a_tax_min) + 1)
else :
    print(-1)

Submission status: Wrong Answer

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

a = int((A * 108 / 8) * 100 / 108)
b = int((B * 110 / 10) * 100 / 110)
a, b = min(a, b), max(a, b)

for i in range(a, b+1):
    check_a = int(i * 1.08)
    check_b = int(i * 1.1)
    if check_a-A == check_b-B and 0 < check_a-A:
        print(i)
        exit()
    elif check_a-A == check_b-B and 0 >= check_a-A:
        print(-1)
        exit()

print(-1)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
I = 0
b = B/0.1
 
b_list = []
for _ in range(10):
  b_list.append(b+_)
 
for i in b_list:
  pre_cnt = i*0.08
  cnt = int(pre_cnt)
  if cnt == A:
    print(int(i))
    I = 1
  break
if I == 0:
  print('-1')

Submission status: Wrong Answer

Solution code:
aa, bb = map(int,input().split())
a = aa / 0.08
b = bb / 0.1
c = []
if (a-int(a))<0.5:
    for i in range(12):
        for j in range(9):
            if int(a)+i == int(b)+j:
                c.append(int(a)+i)
            else:
                pass
else:
    for i in range(13):
        for j in range(9):
            if int(a)+i == int(b)+j:
                c.append(int(a)+i)
            else:
                pass
if c==[]:
    print(-1)
elif (int(a)+i)<=0:
    print(-1)
else:
    print(*c[:1])

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
a_p = math.ceil(a / 0.08)
a_q = math.floor((a+1) / 0.08)
b_p = math.ceil(b / 0.1)
b_q = math.floor((b+1) / 0.1)
if a_p <= b_p <= a_q:
    ans = b_p
elif a_q < b_p:
    ans = -1
elif b_q < a_p:
    ans = -1
else:
    ans = a_p
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
mina= 100
minb=100
a = set()
b = set()
C = A/0.08
D= B/0.1
E=(A+1)/0.08
F=(B+1)/0.1 
if C.is_integer() ==False:
  C= A//0.08 +1
if D.is_integer() ==False:
  D= B//0.1 +1

if E.is_integer() ==False:
  E= (A+1)//0.08 

if F.is_integer() ==False:
  F= (B+1)//0.1

C=int(C)
D=int(D)
E=int(E)
F=int(F)
for i in range(C,E+1):
  a.add(i)
for i in range(D,F+1):
  b.add(i)
c = a&b
d = list(c)
d.sort()
if len(d) ==0:
  print(-1)
else:
  print(d[0])

Submission status: Wrong Answer

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

x = -1

xa = 0
xb = 0

a_arr = []
b_arr = []

for temp_a in range(101):
    xa = temp_a * 0.08
    if xa // 1 == a:
        a_arr.append(temp_a)

        for temp_b in range(101):
            xb = temp_b * 0.1
            if xb // 1 == b:
                b_arr.append(temp_b)


for aa in a_arr:
    if aa in b_arr:
        print(aa)
        exit(0)

print('-1')

Submission status: Wrong Answer

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

Amax = (A+1) / 0.08
Bmax = (B+1) / 0.1
Ansmin = max(A / 0.08, B / 0.1)

if Ansmin < min(Amax, Bmax):
    print(int(Ansmin))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:

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

an = int(a/0.08)
alist = []
bn = int(b/0.1)
blist=[]
ans = "-1"

while(int(an*0.08)<=a):
    alist.append(an)
    an+=1
    
while(int(bn*0.1)<=b):
    blist.append(bn)
    bn+=1

for i in alist:
    if i in blist:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

Solution code:
import math
A, B = list(map(int, input().split(' ')))
a = 0.08
b = 0.10

x_min = math.floor(A / a)
x_max = math.ceil((A+1) / a)
y_min = math.floor(B / b)
y_max = math.ceil((B+1) / b)

X = set(range(x_min, x_max))
Y = set(range(y_min, y_max))

r = X & Y
R = min(r) if len(r) > 0 else -1
if len(r) == 1 and R == 0:
  R = -1
  
print(R)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
ans = 0
flag = False;
for i in range(1,201):
	a = int(i*0.08)
	b = int(i*0.1)
	if((a==A) and (b==B)):
		ans = i
		flag =True
		break
if(flag == False):
	print(-1)
else:
	print(ans)

Submission status: Wrong Answer

Solution code:
import math
def resolve():
    a, b = map(int, input().split())
    left, right = 0, 1010
    while left < right:
        mid = (left + right) // 2
        eight = math.floor(mid * 0.08)
        ten = math.floor(mid * 0.1)
        if a == eight and ten == b:
            pre_e = math.floor((mid-1) * 0.08)
            pre_t = math.floor((mid-1) * 0.1)
            while pre_e == a and pre_t == b:
                pre_e = math.floor((mid - 1) * 0.08)
                pre_t = math.floor((mid - 1) * 0.1)
                if pre_e == a and pre_t == b:
                    mid -= 1
            return print(mid)
        elif a <= eight:
            right = mid
        elif a > eight:
            left = mid + 1
    return print(-1)

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math

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

if a == 0 and b == 0:
    print(-1)


def tax_increase(a, b):
    tax8 = 12.5
    tax10 = 10

    price8 = math.floor(a * tax8)
    price10 = math.floor(b * tax10)

    # price8を10%で表せるか
    x = math.floor(price8 * 0.1)

    # price10を8%で表せるか
    y = math.floor(price10 * 0.08)

    if x == b:
        if price8 <= price10:
            print(price8)
        else:
            print(price10)

    elif y == a:
        print(price10)
    else:
        print("-1")


tax_increase(a, b)
"""
for i in range(100):
    for j in range(100):
        tax_increase(i, j)"""

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if 1<=A<=B<=100:
    A_a=A+1
    B_b=B+1
    A_1=A*(100/8)
    B_1=B*(100/10)
    A_1a=A_a*(100/8)
    B_1b=B_b*(100/10)
    if (A_1<B_1b)and(B_1<A_1a):
        A_2=int(A_1)
        print(A_2)
    else:
        print("-1")
else:
  None

Submission status: Wrong Answer

Solution code:
AA, BB = map(int, input().split())
AA_o = AA/0.08
BB_o = BB/0.1
AAA = AA+1
BBB = BB+1
AAA_o = AAA/0.08
BBB_o = BBB/0.1

if AA_o > int(AA_o):
    AA_o = int(AA_o)+1
else:
    AA_o = int(AA_o)

if AAA_o > int(AAA_o):
    AAA_o = int(AAA_o)+1
else:
    AAA_o = int(AAA_o)
    
if BB_o > int(BB_o):
    BB_o = int(BB_o)+1
else:
    BB_o = int(BB_o)

if BBB_o > int(BBB_o):
    BBB_o = int(BBB_o)+1
else:
    BBB_o = int(BBB_o)
    
if BB_o > AAA_o:
    print(-1)
else:
    print(max(AA_o,BB_o))

Submission status: Wrong Answer

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

for i in range(10, 10001):
    x = (a * 100) // 8
    y = (b * 10) // 1
    if y <= x and y <= x <= y+9:
        print(x)
        break
    elif x <= y and x <= y <= x+7:
        print(y)
        break
    elif i == 1000:
        print(-1)

Submission status: Wrong Answer

Solution code:
import math
def main():
    a, b = map(int, input().split())
    x = math.ceil(a / 0.08) -1
    while x < math.ceil(a/0.08)+1:
        x+=1
        if int(x*0.08) == a:
            if int(x*0.1) == b:
                return x
    return -1



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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
import sys

#数値の入力
# スペース区切りの入力
A, B = map(int, input().split())

x = A / 0.08
y = B / 0.1

x_up = math.ceil(x)

for i in range(10):
    if(y+i == x_up):
        print(math.floor(y+i))
        sys.exit()

print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

x = math.ceil(A/0.08)
y = math.floor(B/0.1)

print(x)
print(y)

if(math.floor(x*0.1)!=B):
  print("-1")

else:
  while(y<=x):
    if(math.floor(y*0.1)==math.floor(y*0.08)):
      if(y<r):
        r=y
    y+=1

  print(r)

Submission status: Wrong Answer

Solution code:
import math

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

X_1 = A / 0.08
X_2 = B / 0.10

if (math.floor(X_1 * 0.08) == A) and (math.floor(X_1 * 0.1) == B):
    print(math.floor(X_1))
elif (math.floor(X_2 * 0.08) == A) and (math.floor(X_2 * 0.1) == B):
    print(math.floor(X_2))
else:
    print(-1)