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 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)
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)
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:
eight, tens = [int(x) for x in input().split()]
vals = lambda x, y: (x * y) // 100
for i in range(1, 101):
    if vals(i, 8) == eight and vals(i, 10) == tens:
        print(i)
        break
    else:
        print(-1)
        break

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

print(min(aRange[0], bRange[1]))

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

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(min(i,j))
                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:
import math

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

x = math.ceil(A/0.08)
y = math.ceil(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:
# ABC158 C

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

priceA = int(a / 0.08)
priceB = int(b / 0.1)

if priceA == priceB:
    print(priceA)
else:
    if int(priceB * 0.08) == a and int(priceA * 0.1) == b:
        print(min(priceA, priceB))
    elif int(priceB * 0.08) == a:
        print(priceB)
    elif int(priceA * 0.1) == b:
        print(priceA)
    else:
        print(-1)

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")

Submission status: Wrong Answer

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

ax = int((a * 100) / 8)
ay = int((ax * 10) / 100)

by = int((100 * b) / 10)
bx = round((by * 8) / 100)

if ay == b and bx == a:
  if ax < by:
    print(ax)
  else:
    print(by)
elif ay == b:
  print(ax)
elif bx == a:
  print(by)
else:
  print(-1)

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

A_hi = ((A+1)/0.08) 
A_low = (A/0.08)

B_hi = ((B+1)/0.1) 
B_low = (B/0.1)

round=lambda x:int((x*2+1)//2)

if (B_hi < A_low or A_hi < B_low) or (A_low > 100) or (B_low > 100):
  print(-1)
elif A_low <= B_hi:
  print(round(A_low))
elif B_low <= A_hi:
  print(round(B_low))

Submission status: Wrong Answer

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

amin=int(a/0.08)
amax=int((a+1)/0.08)-1
bmin=int(b/0.10)
bmax=int((b+1)/0.10)-1

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

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**5):
    ans=int(i*0.08)+int(i*0.1)
    if((A+B)==ans):
        print(i)
        break

Submission status: Wrong Answer

Solution code:
import math

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

#税率8%の消費税から元値のリストを作る
#A*12.5（切り上げ）が元値の取りうる最小値
motone_8 = math.ceil(A*12.5)
#最小値から＋12した数に0.08かけてA+1を超えるか
if (motone_8 + 12) * 0.08 > A+1:
    #超えたら該当値は12個
    gaitou_8 = 12
#超えなかったら該当値は13個
else:
    gaitou_8 = 13

#最小値～最小値＋該当値-1までをリストにいれる
gaitou_list_8 = list(range(motone_8,motone_8 + gaitou_8))

#税率10%の消費税から元値のリストを作る
#B*10が元値の取りうる最小値
motone_10 = B*10

#最小値～最小値＋10までをリストにいれる
gaitou_list_10 = list(range(motone_10,motone_10 + 10))


#二つのリストの共通項を見つける
kyotu_list = set(gaitou_list_8) & set(gaitou_list_10)
#print(gaitou_list_8)
#print(gaitou_list_10)
#print(kyotu_list)

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

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 and sA <=sB+10:
        print(sA)
        return
    else:
        print(-1)
        return
        
    
main()

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
    cst = int(cst_a)

print(int(cst))

Submission status: Wrong Answer

Solution code:
A_B = list(map(int, input().split()))
A = A_B[0]
B = A_B[1]

count = 1
while count * 0.08 // 1 != A or count * 0.1 // 1 != B:
    count += 1
    if count // 0.1 > B:
        print(-1)
        exit()

print(count)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a==b:
    if a<=3:
        print(25*a//2)
    else:
        print(-1)
else:
    if -(-25*a//2) <= 10*b and -(-25*a//2) > 9*b:
        print(25*a//2)
    else:
        print(-1)

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(i * 0.1) == b and a <= b:
                print(i)
                exit()

print(-1)

Submission status: Wrong Answer

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

a1 = int(a / 0.08)
b1 = int(b / 0.1)

if type((a+1) / 0.08) == 'float':
  a2 = int((a+1) / 0.08)
else:
  a2 = int((a+1) / 0.08) - 1

if type((b+1) / 0.1) == 'float':
  b2 = int((b+1) / 0.1)
else:
  b2 = int((b+1) / 0.1) - 1


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

Submission status: Wrong Answer

Solution code:
a8, a10 = input().split(' ')
a8 = int(a8)
a10 = int(a10)
 
value1 = int(a8 / 0.08)
value2 = int(a10 / 0.1)
if int(value1 * 0.1) == a10:
  if value1 > value2:
    print(value1)
  else:
    print(value2)
elif int(value2 * 0.08) == a8:
  if value1 > value2:
    print(value1)
  else:
    print(value2)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if B==((5/4)*A)//1:
  for i in range(10):
    if ((10*(B+(i/10)))*(8/100))//1==A:
      print(int(10*(B+(i/10))))
      exit()
else:
  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(i)
    I = 1
  break
if I == 0:
  print(-1)

Submission status: Wrong Answer

Solution code:
# ABC158 C

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

priceA = int(a / 0.08)
priceB = int(b / 0.1)

if priceA == priceB:
    print(priceA)
else:
    if int(priceB * 0.08) == a and int(priceA * 0.1) == b:
        print(min(priceA, priceB))
    elif int(priceB * 0.08) == a:
        print(priceB)
    elif int(priceA * 0.1) == b:
        print(priceA)
    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
for i in range(1, 101):
    if vals(i, 8) == eight and vals(i, 10) == tens:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
cmin = lambda a,b : a if a<b else b
cmax = lambda a,b : a if a>b else b
iin = lambda : int(input())
lin = lambda : list(map(int,input().split()))
rin = lambda n : [int(input()) for _ in range(n)]

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

at = []
for i in range(1,1500):
    if int(i*0.08)==a: at += [i]

bt = []
for i in range(1,1000):
    if int(i*0.1)==b: bt += [i]

ans = set(at) & set(bt)
print(min(ans) if ans else -1)

Submission status: Wrong Answer

Solution code:
N, A = map(int, input().split())
eight = 0
ten = 0
answer = -1
for i in range (1,1000,1):
    eight = i * 0.08
    eight = eight//1
    ten = i* 0.1
    ten = ten//1
    if eight == N and ten == A:
        answer = i
        break
print(answer)

Submission status: Wrong Answer

Solution code:
import math

input_line = list(map(int,input().split()))

price = math.floor(input_line[0] / 0.08)
result_1 = math.floor(price * 0.08)
result_2 = math.floor(price * 0.1)

if result_1 == input_line[0]:
    if result_2 == input_line[1]:
        print(price)
    else:
        print(-1)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
x=math.floor(A/0.08)
y=math.floor(B/0.1)
eight=[x]
ten=[y]
if math.floor(x*0.08)!=A:
    while math.floor(x*0.08)!=A:
        eight.pop(0)
        x+=1
        eight.append(x)
if math.floor(y*0.1)!=B:
    while math.floor(y*0.1)!=B:
        ten.pop(0)
        y+=1
        ten.append(y)
while math.floor(x*0.08)==A:
    x+=1
    eight.append(x)
while math.floor(y*0.1)==B:
    y+=1
    ten.append(y)
eight_set=set(eight)
ten_set=set(ten)
ans_set=eight_set&ten_set
ans=list(ans_set)
if len(ans)>0:
    print(min(ans))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

nums = list(map(int, input().split()))
a = nums[0]
b = nums[1]

c = 10*(10 * a - b)

r = math.floor(c/7)

if math.floor(r*0.08) == a and math.floor(r*0.1) == b:
    print(r)
else:
    print(-1)

Submission status: Wrong Answer

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

X_1 = A / 0.08
X_2 = B / 0.10

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
a1=(a*100)//8
a2=((a+1)*100)//8
b1=b*10
b2=(b+1)*10
if (a*100)%8>0:
    a1+=1
if ((a+1)*100)%8>0:
    a2+=1
la=range(a1,a2)
lb=range(b1,b2)
l=list(set(la) & set(lb))
if len(l)==0:
    print("-1")
else:
  print(l[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 t-b*10==2:
        print(b*10)
    else:
        print("-1")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a, b, = map(int, input().split())
p = (a*100)/8
py = int(a)+1
pa = int(p)
q = (b*100)/10
pz = int(b)-1
pb = int(q)
if (py*100)/8<(pz*100)/10:
  print("-1")
else:
  if pa>=pb:
    print(pa)
  else:
    print(pb)

Submission status: Wrong Answer

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

    ans = -1

    a = A / 0.08
    b = B / 0.1

    if a >= b:
        ans = a

    print(int(ans))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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


my_index = []
for i in range(101):
    if int((i*0.08)) ==a and int((i*0.1))==b:
        my_index.append(i)
    if int((i*0.08)) ==b and int((i*0.1))==a:
        my_index.append(i)

if my_index != []:
    print(min(my_index))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a%2==0:
    aa=a*12.5
else:
    aa=a*12.5+0.5
bb=b*10

if bb<=aa and aa<bb+10:
    print(aa)
else:
    print(-1)

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

    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:
n=list(map(int,input().split()))
import math
A=math.ceil(n[0]/0.08)
B=math.ceil(n[1]/0.1)
C=math.ceil(n[1]+1/0.1)
D=math.ceil(n[0]+1/0.08)
print(A)
print(B)
if A==B or B<<A<<C:
    print(A)
elif A<<B<<D:
    print(B)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
nums = input().split(" ")
A = int(nums[0])
B = int(nums[1])

a1 = round((25*A)/2)
a2 = round((25*(A+1))/2)
b1 = 10 * B

shosu_a = (25*A)/2 - round((25*A)/2)
if shosu_a > 0.5:
  length_a = 14
else:
  length_a = 13

xa = [a1 + i for i in range(length_a)]
xb = [b1 + i for i in range(10)]
       
conc = []
for j in xa:
  for i in xb:
    if int(i) == int(j):
      conc.append(i)
    
if conc == []:
  print(-1)
else:
  print(min(conc))

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int, input().split())
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:
a, b=map(int,input().split())
if (b - a > b * 0.2):
  print('-1')
else:
  xa = a / 0.08;
  xb = b / 0.1;
  if (xa < xb):
    print('{:.0f}'.format(xb))
  else:
    print('{:.0f}'.format(xa))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
        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=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):
    check = math.floor(i*0.08)
    if check == math.floor(ansA*0.1):
        print(i)
        exit()
print(-1)

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 t-b*10==2:
        print(b*10)
    else:
        print(-1)

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:
import math

c=list(map(int, input().split()))
A = c[0]
B = c[1]
able = 1

for i in range(1000):
  if math.floor(i * 0.08 == A ) and math.floor(i * 0.1 == B):
    print(i)
    able = 0
    
if able:
  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(i)
    I = 1
  break
if I == 0:
  print(-1)

Submission status: Wrong Answer

Solution code:
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)+1):
    if int(i*8/100)==A and int(i*0.1)==B:
        ans.append(i)
        break
    else:
        ans.append(-1)
print(min(ans))

Submission status: Wrong Answer

Solution code:
import math

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

min8 = math.ceil(A/0.08)
max8 = math.floor((A+1)/0.08)

min10 = int(B/0.1)
max10 = int((B+1)/0.1)

for i in range(min8, max8+1):
    if min10 <= i < max10:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
aX1 = a/0.08
aX2 = (a+1)/0.08
la = [i for i in range(int(aX1),int(math.ceil(aX2)))]

bX1 = b/0.10
bX2 = (b+1)/0.10
lb = [i for i in range(int(bX1),int(math.ceil(bX2)))]

l=[]
l+=la+lb
if len(l) != len(la)+len(lb):
  print(-1)
else:
  print(max(min(la),min(lb)))

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 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:
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:
        print(i)
        exit()

print(-1)

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 and math.floor(i * 0.1) == b:
        print(i)
        exit()

print(-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'
else:
    ans = a_p
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
### 8%
a1 = a
x_a1 = a / 0.08
a2 = a+1
x_a2 = a2/0.08
### 10%
b1 = b
y_b1 = b / 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:
import math
 
A,B = map(int,input().split())
 
p_a1 = math.floor(A / 0.08)
p_a2 = math.ceil(A / 0.08)
p_b1 = math.floor(B / 0.1)
p_b2 = math.ceil(B / 0.1)
flag = 0
b1 = math.floor(p_a1 * 0.1)
b2 = math.floor(p_a2 * 0.1) 
a1 = math.floor(p_b1 * 0.08)
a2 = math.floor(p_b2 * 0.08)

 
if b1 == B:
  ans = p_a1
  flag += 1
if a1 == A:
  if flag == 0:
    ans = p_b1
    flag += 1
  else:
    if p_a1 > p_b1:
      ans = p_b1
if flag == 0:
  if b2 == B:
    ans = p_a2
    flag += 1
  if a2 == A:
    if flag == 0:
      ans = p_b2
      flag += 1
    else:
      if p_a2 > p_b2:
        ans = p_b2
if flag == 0:
  ans = -1
print(ans)

Submission status: Wrong Answer

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

d = ((100/8) * a)
e = ((100/10) * b)

k = (math.floor(d/10))
l = (math.floor(e/10))

if k == l or d == e:
    print(int(d))
elif k != l:
    print('-1')

Submission status: Wrong Answer

Solution code:
import math

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

for n in range(0, 10):
  for m in range(0, 10):
    if math.floor((A + m/10) / 0.08) == math.floor((B + n/10) / 0.1):
      print(math.floor((B+n/10)/0.1))
      exit()
print("-1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
a1 = math.ceil(a/0.08)
a2 = math.ceil(b/0.1)
a3 = math.ceil((a+1)/0.08)
a4 = math.ceil((b+1)/0.1)

if(max(a1, a2) > min(a3, a4)):print(-1)
else:print(max(a1, a2))

Submission status: Wrong Answer

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

X = math.floor(A/0.08)
Y = math.floor(B/0.1)

flg = True
if X == Y:
	print(X)
else:
	if X > Y:
		xySa = X - Y
		for i in range(xySa+1):
			if math.floor((Y+i) * 0.08) == math.floor((Y+i) * 0.1):
				flg = False
				print(Y+i)
				break
		if flg:
			print(-1)
	else:
		yxSa = Y - X
		for i in range(yxSa+1):
			if math.floor((X+i) * 0.1) == math.floor((X+i) * 0.08):
				flg = False
				print(X+i)
				break
		if flg:
			print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
if a > 4:
  if int((a/4))==int((b/5)):
    print(int(a/0.08))
  else:
    print(-1)
else:
  if int((4/a))==int((5/b)):
    print(int(a/0.08))
  else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(10 ** 7):
    if i * 0.08 == a and math.floor(i * 0.1) == b:
        print(i)
        exit()


print(-1)

Submission status: Wrong Answer

Solution code:
import math

A, B = map(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:
import math
A,B = map(int,input().split())
ans = '-1'
N = math.floor(A/0.08)
M = math.floor(B/0.08)

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, A = map(int, input().split())
eight = 0
ten = 0
answer = -1
for i in range (1,1000,1):
    eight = i * 0.08
    eight = eight//1
    ten = i* 0.1
    ten = ten//1
    if eight == ten:
        answer = i
        break
print(answer)

Submission status: Wrong Answer

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

else:
    print("-1")

Submission status: Wrong Answer

Solution code:
x = list(map(int,input().split(" ")))
a = x[0]
b = x[1]
import math

xa = math.floor( a / 0.08 )
xb = math.floor( b / 0.1 )
xa_1 = math.floor( (a+1) / 0.08 )
xb_1 = math.floor( (b+1) / 0.1 )
# print(xa)
# print(xb)
# print(xa_1)
# print(xb_1)

a_list = []
b_list = []

for i in range(xa,xa_1):
    a_list.append(i)
for i in range(xb,xb_1):
    b_list.append(i)

# print(a_list)
# print(b_list)

a_b_and = set(a_list) & set(b_list)
a_b_list = list(a_b_and)
# print(a_b_list)

if len(a_b_list) >= 1:
    print(a_b_list[0])
else:
    print(-1)

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.ceil((a+1) / 0.08)
bmax = math.ceil((b+1) / 0.1)
#print("{},{}".format(amin, bmin))
#print("{},{}".format(amax, bmax))

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

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

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)
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+13):
    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:
import math

nums = list(map(int, input().split()))
a = nums[0]
b = nums[1]

c = 10*(10 * a - b)

r = math.floor(c/7)

if math.floor(r*0.08) != a or math.floor(r*0.1) != b:
    print(-1)
else:
    print(r)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
A0= int(A / 0.08)
B0= int(B / 0.1)
if (A == int(A0*0.08)) & (B == int(B0*0.1)):
    print(A0)
else:
    print("-1")

Submission status: Wrong Answer

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

X_1 = A / 0.08
X_2 = B / 0.10

max_ = max(X_1, X_2)

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

Submission status: Wrong Answer

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

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

temp_a1 = math.floor(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 = 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(y)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=0
a1=int(a/0.08)
b1=int(b*10)
if a1%25==12:
    a1+=1
    e=14
else:
    e=13
for i in range(0,10):
    a2=a1+i
    for j in range(0,e):
        b2=b1+j
        d=a2-b2
        if d==0:
            c=a2
            break
    if c>0:
        break
if c==0:
    print("-1")
else:
    print(c)

Submission status: Wrong Answer

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

if 25*a/2<=10*b < (25/2)*(a+1)-1:
  ans=10*b
if 10*b<=25*a/2<10*(b+1)-1:
  if a%2==1:
    ans=25*a//2+1
  else:
    ans=25*a//2
else:
  ans="-1"
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:
    print(a)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
if a > b:
    a, b = b, a

x_1 = math.floor(a / 0.08)

max_count = 1
while True:
    zeikomi = math.floor((x_1 + max_count) * 0.08)
    if zeikomi != a:
        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:
A, B = map(int,input().split())

a = int(A / 0.08)

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

Submission status: Wrong Answer

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

eight = int(math.ceil(A / 0.08))
ten = int(math.ceil(B / 0.1))

ans = 10000000000

for i in range(min(ten, eight), max(ten, eight)+1):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans = min(ans,i)


if ans == 100:
    ans = -1
print(ans)

Submission status: Wrong Answer

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

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)
cnt = 0

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

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

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

tax8s = set(range(tax8, tax8p))
tax10s = set(range(tax10, tax10p))
taxl = sorted(list(tax8s & tax10s))

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

print(taxl[0])