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())
ans=0
flag=False
for i in range(b*10,(b+1)*10+1):
    x=i*0.08
    if a+1>x>=a:
        flag=True
        ans=i
        break
print(ans if flag else -1)

Submission status: Wrong Answer

Solution code:
num = {}

num = input().split()

# print(num)

answer1 = int(int(num[0]) / 0.08)
answer2 = int(int(num[1]) / 0.1)

kensyo1 = int(answer1 * 0.1) == int(num[1])
kensyo2 = int(answer2 * 0.08) == int(num[0])

# print(kensyo1, kensyo2)

if int(num[0]) < 0 or int(num[1]) < 0:
  print(-1)
elif kensyo1:
  print(int(int(num[0]) / 0.08))
elif kensyo2:
  print(int(int(num[1]) / 0.1))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
import numpy as np

s = input()
num = s.split(" ")
A = int(num[0])
B = int(num[1])

tax_8 = []
tax_10 = []

for i in range(101):
  tax_8.append([math.floor(i*0.08)])
  tax_10.append([math.floor(i*0.1)])

tax_8_np = np.array(tax_8)
tax_10_np = np.array(tax_10)

tax_8_candidate = list(np.where(tax_8_np==A)[0])
tax_10_candidate = list(np.where(tax_10_np==B)[0])

candidate = list(set(tax_8_candidate)&set(tax_10_candidate))

if len(candidate)==0:
  print(-1)
else:
  print(int(np.array(candidate).min()))

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
import math
a = list()
a.append(1000000)
i = A/0.08
j = (A+1)/0.08
while i < j:
    if int(i) == i:
        k = int(i)
        a.append(k)
        i = i+1
    elif int(i) !=i:
        k = int(i+1)
        a.append(k)
        i = i+1

b = list()
b.append(1000000)
p = B/0.10
q = (B+1)/0.10
while p < q:
    if int(p) == p:
        l = int(p)
        b.append(l)
        p = p+1
    elif int(p) !=p:
        l = int(p+1)
        b.append(l)
        p = p+1 
c= set(a) & set(b)
m = min(c)
if m == 1000000:
    print("-1")
else:
    print(m)

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.999) * 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:
A,B=map(float,input().split())
A_min=int(A/8*100)
A_max=int((A+1)/8*100)
ans=0
flag=False
if (A*100/8)%8!=0:
    A_min=A_min+1
if (A+1)*100%8==0:
    A_max=int((A+1)*100/8)-1
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:
a,b=map(int,input().split())
Pas=a/0.08
Pad=(a+1)/0.08
Pbs=b/0.1
Pbd=(b+1)/0.1
if Pad<Pbs or Pbd<Pas:
    ans=-1
if Pas<=Pbs and Pbd<=Pad :
    ans=Pbs
if Pbs<=Pas and Pad<=Pbd:
    ans=Pas
if Pas<=Pbs and Pbs<=Pad and Pad<=Pbd:
    ans=Pbs
if Pbs<=Pas and Pas<=Pbd and Pbd<=Pad:
    ans=Pas
print(int(ans))

Submission status: Wrong Answer

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

C = -(-A//0.08)
D = -(-B//0.1)

if ((D - C) * 0.18 <= 1 ):
    print(int(C))
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, 100):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 100):
                y = math.floor(j * 0.1)
                if int(y) == b:
                    result = i
                    end_flag = True
                    break
print(result)

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.999999999999999999999999999999)/0.08)
bmin = b/0.1
bmax = math.floor((b + 0.99999999999999999999999999999999)/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=map(int,input().split())
if -(-25*a//2) < 11*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())
x=math.floor(A/0.08)
y=math.floor(B/0.1)
eight=[x]
ten=[y]
if math.floor(x*0.08)!=A or math.floor(y*0.1)!=B:
    print(-1)
    exit()
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 = map(int, input().split())

Araw = A/0.08
Braw = B/0.10

if Araw <= Braw + 9 and Araw >= Braw-9:
  for i in range(10):
    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 = map(int,input().split())
x = int(a//0.08) + 1
y = int(b//0.1)
# print(x)
check = round(x*0.1)
if (check == b) :
    print(x)
else :
    print(-1)

Submission status: Wrong Answer

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

for i in range(1300):
    if (int(i * 0.08) == A) and (int(i * 0.10) == B) :
        print(i)
        break
print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
diff = b - a
if diff > 20:
    print(-1)
else:
    x1 = diff * 50
    x2 = (diff + 2) * 50
    flg = 0
    for i in range(x1, x2, 1):
        if(math.floor(i * 0.08) == a):
            if(math.floor(i * 0.1) == b):
                print(i)
                flg = 1
                break
    if flg == 0:
        print(-1)

Submission status: Wrong Answer

Solution code:
#output <= 1000

nums = [int(e) for e in input().split()]
for i in range(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())

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(priceA * 0.1) == B :
    print(priceA)
  else:
    if int(priceB * 0.08) == A :
      print(priceB)
    else:
      print(-1)

Submission status: Wrong Answer

Solution code:
A, B = (int(x) for x in input().split())
s = 0
e = 1000
while s != e:
    c = (s + e) // 2
    x = int(A * 25 / 2)
    y = int(B * 10)
    if max(x, y) <= c:
        e = c
    else:
        s = c + 1
if int(s * 0.08) == A and int(s * 0.1) == B:
    print(s)
else:
    print(-1)

Submission status: Wrong Answer

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

# x = a / 0.08
# x_2 = int(x)
# print(x_2)
# y = b / 0.1
# y_2 = int(y)
# print(y_2)

# if x_2 == y_2:
#     print(int(x_2))
# else:
#     print(-1)

for i in range(1, 101, 1):
    # print(i)
    x = i * 0.08
    x_2 = int(x)
    y = i * 0.1
    y_2 = int(y)
    # print(x)
    # print(y)
    if x_2 == a and y_2 == b:
        # continue
    # if x == y:
        ans = i
        break
    else:
        ans = -1

print(ans)

Submission status: Wrong Answer

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

result = []
for i in range(1, 1000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        result.append(i)

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

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(min(sampleA,sampleB),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())

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

B_hi = int(B/0.08) + 1 
B_low = B_hi - 1

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

Submission status: Wrong Answer

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

price_A_pl = (A * 100+8) // 8
price_B_pl = (B + 10) * 10
ans = -1
ans2 = -1

if price_A // 10 == B:
    ans = price_A
if (price_B*8) // 100 == A:
    ans = price_B
    
if price_A_pl // 10 == B:
    ans2 = price_A_pl
if (price_B_pl*8) // 100 == A:
    ans2 = price_B_pl

if ans2 != -1 and ans != -1:
    ans = min(ans, ans2)
elif ans2 != -1 and ans == -1:
    ans = ans2

print(ans)

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 + i
        if (math.floor(x * 0.1) == b):
            flag = True
            break
if flag:
    print(int(x))
else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(1000) :
    a_tax = int((a + i*0.001)* (12.5))
    if a_tax < 13 :
        continue
    for j in range(1000) :
        b_tax = int((b + j*0.001)* (10))
        if b_tax < 10 :
            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())
a = int(A / 0.08)
b = int(B / 0.1)
a1 = int((A + 1) / 0.08)
b1 = int((B + 1) / 0.1)
for i in range(min(a,b),max(a1,b1)):
  if a<=i and b<=i and a1>i and b1>i:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

Solution code:
#output <= 1000

nums = [int(e) for e in input().split()]
for i in range(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())
A_list=[]
B_list=[]
for i in range(101):
    if int(i*0.08)==A:
        A_list.append(i)
    if int(i*0.1)==B:
        B_list.append(i)
flg=0
for i in A_list:
    if i in B_list:
        print(i)
        flg=1
        break
if flg==0:
    print('-1')

Submission status: Wrong Answer

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

if a%2==0:
  lower1=int(a*100/8)
  upper1=(a+1)*100/8
  if upper1-lower1<1:
    print(-1)
    sys.exit()
  else:
    upper1=int(upper1)-1
  
else:
  lower1=a*(100/8)
  upper1=int((a+1)*100/8)
  if (upper1)-int(lower1)<1:
    print(-1)
    sys.exit()
  else:
    lower1=int(lower1)+1
    if lower1==upper1:
      print(-1)
      sys.exit()
    else:
      pass
  
lower2=(b)*10
upper2=(b+1)*10

lower=max(lower1,lower2)
upper=min(upper1,upper2)
if upper-lower<0:
  print(-1)
else:
  print(lower)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
a,b=map(int, input().split())

y = math.floor(b/0.1)

for i in range(y,y+10):
    if i * 0.08 == a:
        print(i)
        sys.exit(0)
print(-1)

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.99999999999999999)/0.08)
bmin = b/0.1
bmax = math.floor((b + 0.99999999999999999)/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 = map(int,input().split())
import math
a = list()
a.append(1000000)
i = A/0.08
j = (A+1)/0.08
while i < j:
    if int(i) == i:
        k = int(i)
        a.append(k)
        i = i+1
    elif int(i) !=i:
        k = int(i+1)
        a.append(k)
        i = i+1

b = list()
b.append(1000000)
p = B/0.10
q = (B+1)/0.10
while p < q:
    if int(p) == p:
        l = int(p)
        b.append(l)
        p = p+1
    elif int(p) !=p:
        l = int(p+1)
        b.append(l)
        p = p+1 
print(a)
print(b)
c= set(a) & set(b)
m = min(c)
if m == 1000000:
    print("-1")
else:
    print(m)

Submission status: Wrong Answer

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

price_A_pl = (A * 100+8) // 8
price_B_pl = (B + 10) * 10
ans = -1
ans2 = -1

if price_A // 10 == B:
    ans = price_A
if (price_B*8) // 100 == A:
    ans = price_B
    
if price_A_pl // 10 == B:
    ans2 = price_A_pl
if (price_B_pl*8) // 100 == A:
    ans2 = price_B_pl

if ans2 != -1 and ans != -1:
    ans = min(ans, ans2)
elif ans2 == -1 and ans != -1:
    ans = ans2

print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
x_a = int((A-1) * 100 / 8)
x_b = int((B+1) * 100 / 10)
l = [i for i in range(min(x_a, x_b)-1, max(x_a, x_b)+1)]
print(l)
for n in l:
    if int(n * 0.08) == A and int(n * 0.10) == B:
        print(n)
        break
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)
    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 numpy as np

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

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

b_low = int(b/0.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:
import math
a,b = map(int,input().split())
x1=(50*a)/4
x2=10*b
print(-1 if abs(x2-x1)>=10 else math.floor(x1))

Submission status: Wrong Answer

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

while 1:
  to += 100
  c = int(to * 0.08)
  d = int(to * 0.1)
  if c >= a and d >= b:
    
    while 1:
      to -= 1
      c = int(to * 0.08)
      d = int(to * 0.1)
      if c == a and d == b:
        print(to)
        exit()
      elif to % 100 == 0:
        print(-1)
        exit()

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()

x1 = a / 0.08
y1 = b /0.1
x2 = (a+1) / 0.08
y2 = (b+1) /0.1
print(x1, x2, y1, y2)


# exit()
if ceil(y1) <= ceil(x1) < y2:
    ans = ceil(x1)
    # print(ans)
elif ceil(x1) <= ceil(y1) < x2:
    ans = ceil(y1)
    # print(ans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
def check(a, b, x):
    res = x
    while x > 0:
        x = x - 1
        if (int(x*0.08)==a) and (int(x*0.1)==b):
            res = x
    return res

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

c = a/0.08
d = b/0.1

if int(c*0.1) == b:
    ans = check(a, b, int(c))
    print(ans)
elif int(d*0.08) == a:
    ans = check(a, b, int(d))
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math
input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a,b = inn()
p8 = int(a/2)*25+int(a%2)*12
p10 = b*10
p8_ = p8+12
p10_ = p10+9

#print(p8,p10,p8_,p10_)
if p8 == p10:
    print(p8)
elif p8 > p10 and p8 <= p10_:
    print(p8)
elif p10 > p8 and p10 <= p8_:
    print(p10)
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 int(y) == b:
                    result = i
                    end_flag = True
                    break


print(result)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
a = int(A / 0.08)
b = int(B / 0.1)
if a == b:
  print(a)
  exit()
else:
  p1 = max(a, b)
  if int(p1 * 0.08) == int(p1 * 0.1):
    print(p1)
    exit()
  p2 = min(a, b)
  if int(p2 * 0.08) == int(p2 * 0.1):
    print(p2)
    exit()
print(-1)

Submission status: Wrong Answer

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

a_1=int(format(A*12.5 ,'.0f'))
a_2=int(format((A+1)*12.5 ,'.0f'))
la=list(range(a_1,a_2))

b_1=int(format(B*10 ,'.0f'))
b_2=int(format((B+1)*10 ,'.0f'))
lb=list(range(b_1,b_2))

la_lb_and_list = list(set(la) & set(lb))

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

Submission status: Wrong Answer

Solution code:
import math

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

ans = -1

for i in range(1, 1000):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

N_a = math.floor(a/0.08)
N_b = math.floor(b/0.1)

result = -1

for n in range(N_a):
    if math.floor(N_a*0.08) == a and math.floor(N_b*0.1) == b:
        result = N_a
        N_a -= n
print(result)

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 = (i * 0.1)//1
  if ans == b:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
max_a=a+1
min_a=a
max_b=b+1
min_b=b
max_an=max_a*100/8
min_an=min_a*100/8
max_bn=max_b*100/10
min_bn=min_b*100/10
if max_an<=min_bn or max_bn<=min_an:
    print(-1)
elif min_an<=min_bn:
    if min_b*100//10==max_a*100//8:
        print(-1)
    else:
        print(min_b*100//10)
else :
    if max_b*100//10==min_a*100//8:
        print(-1)
    else:
        print(min_a*100//8)

Submission status: Wrong Answer

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

price_A_pl = (A * 100+8) // 8
price_B_pl = (B + 10) * 10
ans = -1
ans2 = -1

if price_A // 10 == B:
    ans = price_A
if (price_B*8) // 100 == A:
    ans = price_B
    
if price_A_pl // 10 == B:
    ans2 = price_A_pl
if (price_B_pl*8) // 100 == A:
    ans2 = price_B_pl

if ans2 != -1 and ans != -1:
    ans = min(ans, ans2)

print(ans)

Submission status: Wrong Answer

Solution code:
import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    par = A / B
    if par < 0.8:
        print("-1")
        exit(0)
    else:
        a = math.ceil(A / 0.08)
        b = math.ceil(B / 0.1)
        # print(a , b)
        if math.floor(a * 0.08) == A and math.floor(a * 0.1) == B:
            ret = a
        else:
            ret = b
        print(ret)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
a = A / 0.08
b = B / 0.1
if math.floor(a * 0.1) == B:
    ans = int(a)
elif math.floor(b * 0.08) == A:
    ans = int(b)
else:
    print(-1)
    exit()
while True:
    if math.floor((ans-1)*0.08) == A and math.floor((ans-1)*0.1) == B:
        ans = ans - 1
    else:
        print(ans)
        exit()

Submission status: Wrong Answer

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

tax8 = 12.5
tax10 = 10

numA = int(A * tax8)
numB = B * tax10
ans = numA

numC = abs(numA - numB)

if numA > numB:
    for i in range(numB+1,numC,1):
        numD = round(i*0.1)
        if numD == A:
            if numD == B:
                ans = i
                break
    ans = -1
elif numA < numB:
    for i in range(numB+1,numC,1):
        numD = round(i*0.08)
        if numD == A:
            if numD == B:
                ans = i
                break
    ans = -1

if A > B:
    ans = -1

#print(numA,numB)
print(ans)

Submission status: Wrong Answer

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

p1 = int(a*100//8)
p2 = int(b*10)
#print(p1, p2)
for x in range(p2, p1+2):
    A = int(x/100*8)
    B = int(x/10)
    #print(x, A, B)
    if a==A and b==B:
        print(x)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a,b = [int(x) for x in input().split()]
if a%2 == 0:
  amax = round((a+1)*12.5)
  amin = a*12.5
else:
  amax = (a+1)*12.5
  amin = round(a*12.5)
bmax = int((b+1)*10)
bmin = int(b*10)
hantei = bmin
if amax <= bmin:
  hantei = -1
elif bmax <= amin:
  hantei = -1
elif bmin < amin:
  hantei = amin
print(int(hantei))

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
 
for i in range(0, 100):
  test_A = A + (i/100)
  if test_A *100 % 8 == 0:
    x = test_A *100 // 8
    break
    
if (x//10) == B:
  print(x)
else:
  print(-1)

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
Pas=a/0.08
Pad=(a+1)/0.08
Pbs=b/0.1
Pbd=(b+1)/0.1
if Pad<Pbs or Pbd<Pas:
    ans=-1
elif Pas<=Pbs and Pbd<=Pad :
    ans=Pbs
elif Pbs<=Pas and Pad<=Pbd:
    ans=Pas
elif Pas<=Pbs and Pbs<=Pad and Pad<=Pbd:
    ans=Pbs
else:
    ans=Pas
print(int(ans))

Submission status: Wrong Answer

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

C = -(-A//0.08)
D = -(-B//0.1)

if ((D - C) * 0.18 <= 0 ):
    print(int(C))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if int(a/(0.08)) == int(b/(0.1)):
    cost = int(a/(0.08))
else:
    inter = abs(int(a/(0.08)) - int(b/(0.1)))
    mn = min(int(a/(0.08)) , int(b/(0.1)))
             
    for i in range(inter+1):
        cost = mn+i
        if int(cost*(0.08))==a:
            if int(cost*(0.1))==b:
                break
        
        if i ==inter:
            cost = -1
print(cost)

Submission status: Wrong Answer

Solution code:
import math
# 税がかかる金額A,B
A, B = map(int, input().split())

# 税抜きの候補
a_min_price = A*100/8
a_over_price = (A+1)*100/8
b_min_price = B*100/10
b_over_price = (B+1)*100/10

# 除外する組み合わせ
# 片方の最大値が最小値を超える
if((a_over_price < b_min_price) or (b_over_price < a_min_price)):
    print(-1)
else:
    if(a_min_price < b_min_price):
        print(math.ceil(b_min_price))
    else:
        print(math.ceil(a_min_price))

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,100+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()))

#res*0.08=a
#res=a/0.08

resa = float(a)/0.08 
resb = float(b)/0.1


if int(resa*0.08) == int(resb*0.1):

    if int(resa) < 1 or int(resb)<1:
        print(-1)
    
    else:
        print(int(resa))

else:
    print(-1)

Submission status: Wrong Answer

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

tax8 = math.floor(a/0.08)
tax8p = math.floor((a + 1)/0.08)
tax10 = math.floor(b/0.1)
tax10p = math.floor((b + 1)/0.1)

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

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

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

print(taxl[0])

Submission status: Wrong Answer

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

import math

ans = 0
for i in range(1000):
  if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
    ans = i
    print(i)
    break
 
if ans == 0:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

aa = A / 0.08
bb = B / 0.1


if math.ceil(aa) > (math.ceil(bb) + 10) or math.ceil(bb) > (math.ceil(aa) + 12.5):
    print('-1')
else:
    if aa > bb:
        print(math.ceil(aa))
    else:
        print(math.ceil(bb))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

a, b = map(int, input().split())
# print(a,b)
# x=-1
# y=-1

xr=[]
yr=[]
for i in range(101):
    if i*0.08//1==a:
        # print("x:{}".format(i))
        x=i
        xr.append(x)
for i in range(101):
    if i *0.1//1==b:
        # print("y:{}".format(i))
        y=i
        yr.append(y)
flag=False

result=[]
for i in xr:
    for j in yr:
        if i==j:
            result.append(i)

if len(result)>0:
    print(result[0])
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
def input_int_list():
    return [int(thing) for thing in input().split(" ")]
def No():
    print(-1)
    exit()
def eight(x):
    return int(x*0.08//1)
def ten(x):
    return int(x*0.1//1)

A,B=input_int_list()

for i in range(1,101):
    if eight(i)==A and ten(i)==B:
        print(i)
        exit()
No()

Submission status: Wrong Answer

Solution code:
import math

string = input()
a = int(string.split()[0])
b = int(string.split()[1])

if int(100 * (a + 1) / 8) < 10 * b:
    print(-1)
elif math.ceil(100 * a / 8) < 10 * b:
    print(10 * b)
elif math.ceil(100 * a / 8) < 10 * (b + 1):
    print(math.ceil(100 * a / 8))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
for x in range(1,101):
    if int(x * 1.08) == a+x and int(x * 1.1) == b+x:
        print(x)
        exit()
print(-1)

Submission status: Wrong Answer

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

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

min = -1

for i in range(int(A / 0.08) + 1):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        min = i
        break

print(min)

Submission status: Wrong Answer

Solution code:
a8, a10 = input().split(' ')
a8 = int(a8)
a10 = int(a10)

value1 = int(a8 / 0.08)
if int(value1 * 0.1) == a10:
  print(value1)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1000):
  left = int(i * 0.08) 
  right = int(i * 0.1)
  if left == a and right == b:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

Solution code:
def main(a,b):
    p_min = int((12.5)*a)
    q_min = 10*b
    if p_min > q_min:
        ans = p_min
        if int(ans/10) == b:
            return ans
        ans = p_min+1
        if int(ans/10) == b:
            return ans
        return -1
    else:
        ans = q_min
        if int(ans/12.5) == a:
            return ans
        ans = q_min+1
        if int(ans/12.5) == a:
            return ans
        return -1

a,b = input().split()
print(main(int(a),int(b)))

Submission status: Wrong Answer

Solution code:
#coding:utf-8
import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    A,B = LMIIS()
    #A:1.08 B:1.1
    from math import ceil,floor
    # print(A/0.08,B/0.1)
    # print(ceil(A/0.08),ceil(B/0.1))
    # A_min = ceil(A/0.08)
    # A_max = ceil((A+1)/0.08)-1
    # B_min = ceil(B/0.1)
    # B_max = ceil((B+1)/0.1)-1
    # print(A_min,A_max,B_min,B_max)
    for i in range(1,101):
        if floor(i *0.08) == A and floor(i *0.1) == B:
            print(i)
            return
    print(-1)

    

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

X1=math.ceil(A/0.08)
X2=math.floor((A+1)/0.08)

Y1=math.ceil(B/0.1)
Y2=math.floor((B+1)/0.1)


if (Y1>X2)or(X1>Y2):
  print(-1)
elif X1>=Y1:
  print(X1)
else:
  print(Y1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if abs(a-b) >10:
    cost = -1
elif int(a/(0.08)) == int(b/(0.1)):
    cost = int(a/(0.08))
else:
    inter = abs(int(a/(0.08)) - int(b/(0.1)))
    mn = min(int(a/(0.08)) , int(b/(0.1)))
             
    for i in range(inter+1):
        cost = mn+i
        if int(cost*(0.08))==a:
            if int(cost*(0.1))==b:
                break
        
        if i ==inter:
            cost = -1
print(cost)

Submission status: Wrong Answer

Solution code:
A,B=map(float,input().split())
A_min=int(A/8*100)
A_max=int((A+1)/8*100)
ans=0
flag=False
if (A*100/8)%8!=0:
    A_min=A_min+1
if (A+1)*100%8==0:
    A_max=int((A+1)*100/8)-1
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)