Problem:


Score : 300 points

Problem Statement

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

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

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

Constraints

1 \leq A \leq B \leq 100

A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

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

Sample Input 1

2 2

Sample Output 1

25

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

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

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

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

Sample Input 2

8 10

Sample Output 2

100

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

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

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

Sample Input 3

19 99

Sample Output 3

-1

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



Sample input:
2 2


Sample output:
25

Submission status: Wrong Answer

Solution code:
import math

a, b = list(map(int, input().split()))
result = -1
end_flag = False
for i in range(1, 1000):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 1000):
                y = math.floor(j * 0.1)
                if i == j:
                    if int(y) == b:
                        result = i
                        end_flag = True
                        break
print(result)

Submission status: Wrong Answer

Solution code:
import math;
a,b = map(int,input().split())
x = []
y = []
ans = -1
x.append(a*25//2)
x.append((a+1)*25//2-1)
y.append(b*10)
y.append((b+1)*10-1)
if min(x) < max(y) and min(y) < max(x) and min(y) <= min(x):
  ans = min(x)
elif min(x) < max(y) and min(y) < max(x) and min(x) < min(y):
  ans = min(y)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

def get_min_int(f):
  if type(f) == 'int':
    return f
  else:
    return math.ceil(f)
 
def get_max_int(f):
  return math.floor(f)

min_x_a = get_min_int(a / 0.08)
max_x_a = get_max_int((a+1) / 0.08)

min_x_b = get_min_int(b / 0.1)
max_x_b = get_max_int( (b+1) / 0.1)

length_a = max_x_a - min_x_a + 1
list_a = [ min_x_a + i for i in range(length_a)]

length_b = max_x_b - min_x_b + 1
list_b = [ min_x_b + i for i in range(length_b)]

results = set(list_a) & set(list_b)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A = int((a + 1) / 0.08)
a = int(a / 0.08)

B = int((b + 1) / 0.1)
b = int(b / 0.1)

if A >= B and B > a:
    if a > b:
        print(a)
    else:
        print(b)
elif B >= A and A > b:
    print(b)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
def main():
    a, b = map(int, input().split())
    x = 13
    while x <= int(a/0.08):
        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:
A, B = map(int, input().split())
ans = -1

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

print(n)

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
price_A = (A * 100) // 8
price_B = B * 10
ans1 = -1
ans2 = -1
ans = -1

if price_A // 10 == B:
    ans1 = price_A
if (price_B*8) // 100 == A:
    ans2 = price_B
    
if ans1 != -1 and ans2 != -1:
    ans = min(ans1, ans2)
elif ans1 == -1 and ans2 != -1:
    ans = ans2
elif ans1 != -1 and ans2 == -1:
    ans = ans1

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

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 + n/10) / 0.08) == math.floor((B + m/10) / 0.1):
      print(math.floor((B+m/10)/0.1))
      exit()
print("-1")

Submission status: Wrong Answer

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

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

a = int(A*100/8)
b = int(B*100/10)
c = int(math.ceil(A*100/8))
d = int(math.ceil(B*100/10))

x = int(a*0.10)
y = int(b*0.08)
z = int(c*0.10)
Z = int(d*0.08)

list = []

if x == B:
    list.append(a)
if y == A:
    list.append(b)
if z == B:
    list.append(c)
if Z == A:
    list.append(d)

if len(list) > 0:
    print(sorted(list)[0])
else:
    print(-1)

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

ia = a/(0.08)
la = int(ia*0.08)
while la==a:
    ia += 1
    la = int(int(ia)*0.08)
ia -= 1
lla =int(ia)

ia = a/(0.08)
la = int(ia*0.08)
while la==a:
    ia -= 1
    la = int(int(ia)*0.08)
ia = int(ia+1)

ib = b/(0.1)
lb = int(ib*0.1)
while lb==b:
    ib += 1
    lb = int(int(ib)*0.1)
ib -= 1
llb = int(ib)

ib = b/(0.1)
lb = int(ib*0.1)
while lb==b:
    ib -= 1
    lb = int(int(ib)*0.1)
ib = int(ib+1)

sa = set(range(ia,lla+1))
sb = set(range(ib,llb+1))
ans = sa & sb
print(min(ans) if ans else -1)

Submission status: Wrong Answer

Solution code:
import math

a, b = list(map(int, input().split()))
result = -1
end_flag = False
for i in range(1, 101):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 101):
                y = math.floor(j * 0.1)
                if i == j:
                    if int(y) == b:
                        result = j
                        end_flag = True
                        break
print(result)

Submission status: Wrong Answer

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

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

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

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

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
for i in range(0,10):
    a2=a1+i
    for j in range(0,13):
        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())
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(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(float,input().split())
for i in range(1,1001):
    if math.floor(i*(1.08))-i==a and math.floor(i*(1.08))-i==b:
        print(i)
        break
    elif i==1000:
        c=-1
        print(c)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
a = A / 0.08
b = B / 0.1
#print(a,b)
if a > b:
    if int(a * 0.1) == B:
        print(a)
    else:
        print(-1)
elif b > a:
    if int(b * 0.08) == A:
        print(b)
    else:
        print(-1)
else:
    print(a)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

if 10*B == 25*A/2 :
    print(10*B)
else :
    print(-1)

Submission status: Wrong Answer

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

Araw = A/0.08
Braw = B/0.10

if Araw <= Braw + 9 or Araw + 11.25 <= Braw:
  for i in range(10):
    if int((Braw+i) * 0.08) == A:
      print(int(Braw+i))
      break
      
    if int((Braw-i) * 0.08) == A:
      print(int(Braw-i))
      break

else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

aa = math.ceil(A / 0.08)
bb = math.ceil(B / 0.1)


if aa > bb:
    if int(aa * 0.08) != A or int(aa * 0.1) != B:
        print('-1')
    else:
        print(aa)
else:
    if int(aa * 0.08) != A or int(aa * 0.1) != B:
        print('-1')
    else:
        print(bb)

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 = int((a + 1) / 0.08)
    tb_max = int((b + 1) / 0.1)

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

Submission status: Wrong Answer

Solution code:
import math

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

def get_min_int(f):
  if type(f) == 'int':
    return f
  else:
    return math.ceil(f)
 
def get_max_int(f):
  if type(f) == 'int':
    return f
  else:
    return math.floor(f)

min_x_a = get_min_int(a / 0.08)
max_x_a = get_max_int((a+1) / 0.08)

min_x_b = get_min_int(b / 0.1)
max_x_b = get_max_int( (b+1) / 0.1)

length_a = max_x_a - min_x_a + 1
list_a = [ min_x_a + i for i in range(length_a)]

length_b = max_x_b - min_x_b + 1
list_b = [ min_x_b + i for i in range(length_b)]

results = set(list_a) & set(list_b)

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

Submission status: Wrong Answer

Solution code:
import math

def main():
  a, b = list(map(int, input().split()))
  
  for i in range(a, 1000):
    if not math.floor(i * 0.08) == a:
      continue
    if not math.floor(i * 0.1) == b:
      continue
    return i
  
  return -1
  
print(main())

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
ans=0
flag=False
for i in range(b*10,(b+1)*10+1):
    x=i*8
    if 100*(a+1)>x>=100*a:
        flag=True
        ans=i
        break
print(ans if flag else -1)

Submission status: Wrong Answer

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

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

print(minA, minB, maxA, maxB)

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
price_a = int(A / 0.08)
price_b = int(B / 0.1)
if price_a == price_b:
  print(price_a)
  exit()
else:
  p1 = min(price_a, price_b)
  if int(p1 * 0.08) == int(p1 * 0.1):
    print(p1)
    exit()
  p2 = max(price_a, price_b)
  if int(p2 * 0.08) == int(p2 * 0.1):
    print(p2)
    exit()
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=[]
ten=[]
if math.floor(x*0.08)==A:
    eight.append(x)
if math.floor(y*0.1)==B:
    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:
a, b = list(map(int, input().split()))

tmp = int((a*12.5) // 1)
cnt = tmp

while (cnt*0.08)//1 == a:
  cnt += 1


for i in range(tmp, cnt):
  ans = int((i * 0.1)//1)

  if ans == b:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A, B = map(int, input().split())

X=int(A/0.08)
Y=int(B/0.1)

A1=int(X*0.08)
B1=int(X*0.1)
A2=int(Y*0.08)
B2=int(Y*0.1)



if A1==B1:
    Z1=X
else:
    Z1=0

if A2==B2:
    Z2 = Y
else:
    Z2 = 0


if Z1>0 and Z2>0:
    if Z1>Z2:
        ZZ=Z1
    else:
        ZZ=Z2
else:
    ZZ=Z1+Z2

if X==Y:
    ZZ = X

if ZZ==0:
    ZZ=-1

print(ZZ)

Submission status: Wrong Answer

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

amin,amax,bmin,bmax = 0,0,0,0

amin = a/0.08
amax = math.floor((a + 0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999)/0.08)
bmin = b/0.1
bmax = math.floor((b + 0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999)/0.1)

alist = np.arange(amin,amax,1)
blist = np.arange(bmin,bmax,1)
matched_list = []
src_set = set(alist)
tag_set = set(blist)
anslist = list(src_set & tag_set)

if len(anslist)==0:
    print('-1')
else:
    if int(min(anslist)) <= -1:
        print('-1')
    else :
        print(int(min(anslist)))

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[1]:
    print(min(aRange[0], bRange[1]))
else:
    print(max(aRange[1], bRange[0]))

Submission status: Wrong Answer

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

x = int(A * (100/8))
y = int(B * (100/10))

if x == y:
    print(x)
elif int(x * (10/100)) == A:
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

a, b = list(map(int, input().split()))
result = -1
end_flag = False
for i in range(1, 101):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 101):
                y = math.floor(j * 0.1)
                if i == j:
                    if int(y) == b:
                        result = i
                        print(i)
                        print(j)
                        end_flag = True
                        break
print(result)

Submission status: Wrong Answer

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

a=math.floor(A*12.5)
b=math.floor(B*12.5)
c=B*10
d=(B+1)*10


if d<=a or b<=c:
  print(-1)
else:
  if a<=c:
    print(c)
  else:
    print(a)

Submission status: Wrong Answer

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

if 10*B == 25*A/2 :
    print(10*B)
else :
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
ans = -1
n = 0
while True:
  if n > B: break
  if A == (10 * B + n) * 8 // 100:
    ans = 10 * B + n
  n += 1

print(ans)

Submission status: Wrong Answer

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

for i in range(100) :
    a_tax = int((a + i*0.01)* (12.5))
    if a_tax < 13 or a_tax > 1262:
        continue
    for j in range(100) :
        b_tax = int((b + j*0.01)* (10))
        if b_tax < 10 or b_tax > 1010:
            continue
        if a_tax == b_tax :
            print(int(a_tax))
            sys.exit()
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)-5,max(sampleA,sampleB)+100000):
    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:
a,b=map(int,input().split())

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

ia = a/(0.08)
la = int(ia*0.08)
while la==a:
    ia += 1
    la = int(int(ia)*0.08)
ia -= 1
lla =int(ia)

ia = a/(0.08)
la = int(ia*0.08)
while la==a:
    ia -= 1
    la = int(int(ia)*0.08)
ia = int(ia)+1

ib = b/(0.1)
lb = int(ib*0.1)
while lb==b:
    ib += 1
    lb = int(int(ib)*0.1)
ib -= 1
llb = int(ib)

ib = b/(0.1)
lb = int(ib*0.1)
while lb==b:
    ib -= 1
    lb = int(int(ib)*0.1)
ib = int(ib)+1

sa = set(range(ia,lla+1))
sb = set(range(ib,llb+1))
ans = sa & sb
print(min(ans) if ans else -1)

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
n = math.ceil(a/0.08)
m = math.ceil(b/0.1)


for i in range (m,n+1):
  if math.floor(i * 0.1) == math.floor(i * 0.08):
    print(i)
    break
    
if n==m:
  print(n)
elif math.floor(n*0.08) != b:
  print(-1)

Submission status: Wrong Answer

Solution code:
def main():
    a, b = map(int, input().split())
    x = a / 0.08
    y = b / 0.10
    if int(x * 0.10) == b:
        print(int(x))
    elif int(y * 0.08) == a:
        print(int(x))
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

def main():

    a, b = [int(i) for i in input().split()]

    p = math.ceil(a / 0.08)

    if math.floor(p * 0.1) == b:
        print(p)
    else:
        print(-1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
price_A = (A * 100) // 8
price_B = B * 10
ans1 = -1
ans2 = -1
ans = -1

if price_A // 10 == B:
    ans1 = price_A
if (price_B*8) // 100 == A:
    ans2 = price_B
    
if ans1 != -1 and ans2 != -1:
    ans = min(ans1, ans2)
elif ans1 == -1 and ans2 != -1:
    ans = ans2
elif ans1 != -1 and ans2 == -1:
    ans = ans1
print(ans)

Submission status: Wrong Answer

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

before_A = A/0.08
before_B = B/0.1

if before_A <= before_B:
    ans = before_B
    if int(before_B * 0.08) == A:
        print(int(ans))
    else:
        print(-1)
else:
    ans = before_A
    if int(before_A * 0.1) == B:
        print(int(ans))
    else:
        print(-1)

Submission status: Wrong Answer

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

ca = set(i for i in range(int(-(-a // 0.08)), int(1-(-(a+1) // 0.08))))
cb = set(i for i in range(int(-(-b // 0.1)), int(1-(-(b+1) // 0.1))))
ans = sorted((ca & cb))
if not ans:
    print(-1)
else:
    print(ans[0])

Submission status: Wrong Answer

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

A_min = math.ceil(A * 25 / 2)
A_max = math.ceil((A + 1) * 25 / 2)
B_min = B * 10
B_max = math.floor((B + 1) * 10)
# print(B_min, B_max)
A_list = list(range(A_min, A_max))
B_list = list(range(B_min, B_max))
print(A_list)
print(B_list)

min_ans = -1
for num in A_list:
    if num in B_list:
        min_ans = num
        break
    else:
        continue

print(min_ans)

Submission status: Wrong Answer

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

N2min = AB[1] * 10
N2max = AB[1] * 10 + 9

N1min = int(AB[0] * 12.5)
N1max = int((AB[0] + 0.9) * 12.5)
if (N2min <= N1max) and (N1min <= N2max):
    if (N1min < N2min):
        print(N2min)
    else:
        print(N1min)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
#output <= 1000

nums = [int(e) for e in input().split()]
for i in range(1,1001):
  if ((((i * 8) // 100) == nums[0]) & (((i * 10) // 100) == nums[1])):
    print(i)
  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 = int((by * 8) / 100)

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
x = max(a*12.5, b*10)
if round(x*0.08, 0)==a and round(x*0.1, 0)==b:
  print(int(x))

else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(float,input().split())
A_min=int(A/8*100)+1
A_max=int((A+1)/8*100)+1
ans=0
flag=False
if (A+1)*100%8==0:
    A_max=int((A+1)*100/8)
for i in range(A_min,A_max):
    if int(i*0.1)==B:
        ans=i
        flag=True
        break
if flag:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(100) :
    a_tax = int((a + i*0.01)* (12.5))
    if a_tax < 13 and a_tax > 1262:
        continue
    for j in range(100) :
        b_tax = int((b + j*0.01)* (10))
        if b_tax < 10 and b_tax > 1010:
            continue
        if a_tax == b_tax :
            print(int(a_tax))
            sys.exit()
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 (A + n/10) / 0.08 == (B + m/10) / 0.1:
      print(math.floor((B+m/10)/0.1))
      exit()
print("-1")

Submission status: Wrong Answer

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

tmp = int((a*12.5) // 1)
cnt = tmp

while (cnt*0.08)//1 == a:
  cnt += 1

print(tmp, cnt)
for i in range(tmp, cnt):
  ans = int((i * 0.1)//1)

  if ans == b:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

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

priceA = int(A / 0.08)
priceB = int(B / 0.1)

if priceA  < priceB :
  if int(priceA * 0.1) == B :
    print(priceA)
  else:
    if int(priceB * 0.08) == A :
      print(priceB)
    else:
      print(-1)
else:
  if int(priceB * 0.08) == A :
    print(priceB)
  else:
    if int(priceA * 0.1) == B :
      print(priceA)
    else:
      print(-1)

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
price_A = (A * 100) // 8
price_B = B * 10
ans1 = -1
ans2 = -1
ans = -1

if price_A // 10 == B:
    ans1 = price_A
if (price_B*8) // 100 == A:
    ans2 = price_B
    
if ans1 != -1 and ans2 != -1:
    ans = min(ans1, ans2)

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    a, b = map(int, input().split())
    x = 0
    while x <= int(a/0.08):
        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:
import math
a, b = (int(i) for i in input().split())
x = math.ceil(a / 0.08)
flag = False
if (math.floor(x * 0.1) == b):
    flag = True
else:
    while math.floor(x * 0.08) == a:
        x = x + 1
        if (math.floor(x * 0.1) == b):
            flag = True
            break
if flag:
    print(int(x))
else:
    print(-1)

Submission status: Wrong Answer

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


num = 0
flag = 0

#print(x)

for i in range(1, 101):
    if A <100 and A>1 and B<100 and B>1:
        x = int(i*0.08)
        y = int(i*0.1)
        if x==A and y==B:
            num = i
            flag = 1
            break

if flag == 1:
    print(num)
else:
    print('-1')

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:
  print(value1)
elif int(value2 * 0.08 == a8):
  print(value2)
else:
  print(-1)

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) - set([0])
R = min(r) if len(r) > 0 else -1
print(R)

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 = B/0.1
max10 = (B+1)/0.1-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


def main():
    a, b = map(int, input().split())
    if a >= 20:
        ans_a = (a * 100) // 8
        ans = math.floor(ans_a * 0.1)
        if b == ans:
            print(ans_a)
        else:
            print(-1)
    else:
        ans = []
        ary_a = [(a * 100 + i * 10) // 8 for i in range(10)]
        ary_b = [(b * 100 + i * 10) // 10 for i in range(10)]
        for n in ary_b:
            if ary_a.count(n) > 0:
                ans.append(n)
        if not ans:
            print(-1)
        else:
            print(min(ans))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
A, B = map(int, input().split())
A_AB_TAXFREE = int(A / 0.08)
B_AB_TAXFREE = int(B / 0.10)
AB_TAXFREE_MAX = max(A_AB_TAXFREE, B_AB_TAXFREE)
AB_TAXFREE_MIN = min(A_AB_TAXFREE, B_AB_TAXFREE)
AB_difference = AB_TAXFREE_MAX -AB_TAXFREE_MIN
for i in range(AB_difference + 1):
  if int((AB_TAXFREE_MIN + i )* 0.08) == A and int((AB_TAXFREE_MIN + i ) * 0.1) == B:
    print(AB_TAXFREE_MIN + i )
    sys.exit()
  else:
    pass
print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
n = math.ceil(a/0.08)
m = math.floor(b/0.1)


for i in range (m,n+1):
  if math.floor(i * 0.1) == math.floor(i * 0.08):
    print(i)
    break
    
if n==m:
  print(n)
elif math.floor(n*0.08) != b:
  print(-1)

Submission status: Wrong Answer

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

VA = int(A / 0.08)
VB = int(B / 0.1)

if VB < VA:
    x = (VA * 0.1)//1
    #print('VA', x)
    if x == B:
        print(VA)
    else:
        print(-1)
            
elif VA < VB:
    x = (VB * 0.8)//1
    #print('VB', x)
    if x == A: print(VB)
    else:
        print(-1)
else:
    print(VA)

Submission status: Wrong Answer

Solution code:
A,B=map(float,input().split())
A_min=int(A/8*100)+1
A_max=int((A+1)/8*100)+1
ans=0
flag=False
if (A+1)*100%8==0:
    A_max=int((A+1)*100/8)
for i in range(A_min,A_max):
    if int(i*0.1)==B:
        ans=i
        flag=True
        break
if int(ans*0.08)!=A:
    ans+=1
if flag:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

A_min = math.ceil(A * 25 / 2)
A_max = math.floor((A + 1) * 25 / 2)
B_min = B * 10
B_max = math.floor((B + 1) * 10)
# print(B_min, B_max)
A_list = list(range(A_min, A_max + 1))
B_list = list(range(B_min, B_max))
# print(A_list)
# print(B_list)

min_ans = -1
for num in A_list:
    if num in B_list:
        min_ans = num
        break
    else:
        continue

print(min_ans)

Submission status: Wrong Answer

Solution code:
import math

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

x = math.floor(A/0.08)

if(math.floor(x*0.1)==B):
  print(x)
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+i)*B==((100+i)/8)*A:
      print((10+i)*B)
      exit()
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
 
max_val = int(math.ceil(A / 0.08))
min_val = int(math.floor(B / 0.1))
 
for i in range(min_val - 1, max_val + 1):
    if int(i * 0.08) > A or int(i * 0.1) > B:
        break
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit(0)
print(-1)

Submission status: Wrong Answer

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

a = math.ceil(A / 0.08)
aPlus1 = math.floor((A + 1) / 0.08)
b = math.ceil(B / 0.1)
bPlus1 = math.floor((B + 1) / 0.1)

if a > aPlus1 or b > bPlus1:
    print('-1')
    sys.exit()

if aPlus1 < b or a > bPlus1:
    print('-1')
    sys.exit()
print(max(a, b))

Submission status: Wrong Answer

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

amin,amax,bmin,bmax = 0,0,0,0

amin = a/0.08
amax = math.floor((a + 0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999)/0.08)
bmin = b/0.1
bmax = math.floor((b + 0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999)/0.1)

alist = np.arange(amin,amax,1)
blist = np.arange(bmin,bmax,1)
matched_list = []
src_set = set(alist)
tag_set = set(blist)
anslist = list(src_set & tag_set)

if len(anslist)==0:
    print('-1')
else:
    print(int(min(anslist)))

Submission status: Wrong Answer

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

VA = int(A / 0.08)
VB = int(B / 0.1)

if VB < VA:
    x = (VA * 0.1)//1
    #print('VA', x)
    if x == B:
        print(VA)
    else:
        print('-1')
            
elif VA < VB:
    x = (VB * 0.8)//1
    #print('VB', x)
    if x == A: print(VB)
    else:
        print('-1')
else:
    print(VA)

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:
        t=math.floor(t)
        print(t)

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

Submission status: Wrong Answer

Solution code:
import math

def main():
  a, b = list(map(int, input().split()))
  
  for i in range(a, 101):
    if not math.floor(i * 0.08) == a:
      continue
    if not math.floor(i * 0.1) == b:
      continue
    return i
  
  return -1
  
print(main())

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
finish = False
for i in range(1, 101):
    if a == int(i * 0.08):
        for j in range(1, 101):
            if b == int(j * 0.1):
                if i < j:
                    break
                if i == j:
                    finish = True
                    break
    if finish:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

eightper = 0.08
tenper = 0.1
ans = -1
for i in range(1,int(100*(1+tenper)+1)):
    if int(i*eightper)==a:
        if int(i*tenper)==b:
            ans=i
            break
print(ans)

Submission status: Wrong Answer

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

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

a_plus = a+1
b_plus = b+1

price_a = int(a*(100/8))
price_aplus = int(a_plus*(100/8))
price_b = int(b*(100/10))
price_bplus = int(b_plus*(100/10))

#配列作成
if is_integer_num(a_plus*(100/8)):
  al = list(range(price_a+1, price_aplus))
else:
  al = list(range(price_a, price_aplus+1))
bl = list(range(price_b, price_bplus))
print(al)
print(bl)

ans = list(set(al) & set(bl))

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

Submission status: Wrong Answer

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