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 = 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):
    if bmin <= i and i <= bmax:
        ret = i
        break

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

a,b = map(int,input().split())
c = int(a / 0.08)
d = int(b / 0.1)
status = 0
ans = 0

if c >= d:
    for i in range(1,c+1):
        if 1 <= int(i * 0.08) and 1 <= int(i * 0.1) and int(i * 0.08) == a and int(i * 0.1) == b:
    #        print(i)
            if int(i * 0.08) == a and int(i * 0.1) == b:
                status = 1
                ans = i
                break
            else:
                pass
else:
    for i in range(1,d+1):
        if 1 <= int(i * 0.08) and 1 <= int(i * 0.1) and int(i * 0.08) == a and int(i * 0.1) == b:
    #        print(i)
            if int(i * 0.08) == a and int(i * 0.1) == b:
                status = 1
                ans = i
                break
            else:
                pass


if status == 1:
    print(ans)
else:
    print(-1)

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

import math
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 = math.floor(pre_cnt)
  if cnt == A:
    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())
mina= 100
minb=100
a = set()
b = set()
C = A/0.08
D= B/0.1
E=(A+1)/0.08
F=(B+1)/0.1 
if C.is_integer() ==False:
  C= A//0.08 +1
if D.is_integer() ==False:
  D= B//0.1 +1

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

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

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

Submission status: Wrong Answer

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

x = min([12.5*a, 10*b])

ans = -1

while x <= max([12.5*a, 10*b]):
    x_a = int(0.08*x)
    x_b = int(0.10*x)

    if x_a == a and x_b == b:
        ans = x
        break

    x += 1

print(int(ans))

Submission status: Wrong Answer

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

AA = A*100//8
AF = (A+1)*100//8 + 1 if (A+1)*100%8!=0 else (A+1)*100//8
BB = B*10
AAA = [i for i in range(AA,AF)]
BBB = [i for i in range(BB,(B+1)*10)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list and (12<min(AB_list)<=1000) else -1
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split(" "))
 
x = int(A/0.08)
y = int(B/0.10)

if y>x:
    print(-1)
else:
    if abs(y-x)>=10:
        print(-1)
    else:
        while((int(y*0.10)==B)and y<x):
            y+=1
        print(y)

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(n*0.08) == math.floor(i * 0.08):
    print(i)
    break
    
if n==m:
  print(n)
elif math.floor(n*0.08) != math.floor(n*0.08):
  print(-1)
elif math.floor(n*0.08) != b:
  print(-1)

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())
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)==y*0.08):
      if(y<r):
        r=y
    y+=1

  print(y)

Submission status: Wrong Answer

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

while i * 0.08 <= a:
    if i * 0.08 == a and math.floor(i * 0.1) == b:
        print(i)
        exit()

    i += 1


print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
x=int(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())

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

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

Submission status: Wrong Answer

Solution code:
A, B = (int(x) for x in input().split())
h = []
for i in range(1, 1000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        h.append(i)
h.append(-1)
print(h[0])

Submission status: Wrong Answer

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


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

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(int,input().split(" "))
 
x = int(A/0.08)
y = int(B/0.10)

print(x,y)
if y>x:
    print(-1)
else:
    if abs(y-x)>=10:
        print(-1)
    else:
        while((int(y*0.10)==B)and y<x):
            y+=1
        print(y)

Submission status: Wrong Answer

Solution code:
import math

A, B = map(int, input().split())
results = []

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))
      results.append(math.floor((B+m/10)/0.1))
if len(results) != 0:
  print(min(results))
  exit()
print("-1")

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

Submission status: Wrong Answer

Solution code:
from sys import stdin


def spam(x, AB, per):
    min_ = x + 1
    max_ = x - 1
    while True:
        min_ -= 1
        tmp = int(min_ * per)
        if AB != tmp:
            min_ += 1
            break
    while True:
        max_ += 1
        tmp = int(max_ * per)
        if AB != tmp:
            max_ -= 1
            break
    return min(min_, max_), max(min_, max_)


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    x = spam(int(A / 0.08), A, 0.08)
    y = spam(int(B / 0.1), B, 0.1)

    if x[0] <= y[0] <= x[1]:
        print(y[0])
    elif y[0] <= x[0] <= y[1]:
        print(x[0])
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

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

eight = math.floor(A/0.08)
ten = math.floor(eight*0.1)
if B == ten :
    print(eight)
else :
    print(-1)

Submission status: Wrong Answer

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

x = A*100//8
y = B*100//10

if x == y:
  print(x)

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:
    eight.pop(0)
    x+=1
    eight.append(x)
if 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:
a,b=map(int,input('').split(' '))

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

ala=[]
t=pa
t=t-1
while int(t*0.08)==a:
    ala.append(t)
    t=t-1

afl=al
if len(ala)>=1:
    ala=ala.reverse()
    afl=ala.extend(al)
else:
    afl=al


pb=int(b/0.1)
bl=[]
t=pb
while int(t*0.1)==b:
    bl.append(t)
    t=t+1

bla=[]
t=pb
t=t-1
while int(t*0.10)==b:
    bla.append(t)
    t=t-1

bfl=bl
if len(bla)>=1:
    bla=bla.reverse()
    bfl=bla.extend(bl)
else:
    bfl=bl

match=0
mp=0
ea=0
eb=0
if len(afl)<=len(bfl):
    kai=len(afl)
else:
    kai=len(bfl)

if len(afl)>=1 and len(bfl)>=1:
    for f in range(kai):
        if afl[ea]==bfl[eb]:
            mp=afl[ea]
            match=1
            break
        elif afl[ea]>bfl[eb]:
            eb=eb+1
        elif afl[ea]<bfl[eb]:
            ea=ea+1
else:
    match=0

if match==1:
    print(mp)
else:
    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 and max_a*100/8*10//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:
        if not min_a*100/8*10//10==min_a*100/8:
            print(min_a*100//8+1)
        else:
            print(min_a*100/8)

Submission status: Wrong Answer

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

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

temp_a1 = (100 * a // 8) + 1
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:
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:
a, b = map(int, input().split())
for i in range(1, 101):
    if a != int(i * 0.08) or b != int(i * 0.1):
        continue
    print(i)
    break
else:
    print(-1)

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_a*0.1) == b:
        result = N_a
        N_a -= n
print(result)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

list_8 = []
list_10 = []

for i in range(101):
  list_8.append( math.ceil((i+1) * 12.5) )
  list_10.append( (i+1) * 10 )
  
A, B = map(int, input().split())

A_ = list_8[A] - 1
A = list_8[A-1]
  
B_ = list_10[B] - 1
B = list_10[B-1]

if A_ < B or B_ < A:
  print(-1)
elif B <= A_:
  print(B)
else:
  print(A)

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)

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

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

point = a/0.08
seg_a = (math.ceil(point), math.floor(point + 12.5))

point = b/0.1
seg_b = (point, point + 9)

if seg_b[1] < seg_a[0]:
    print(-1)
else:
    print(int(seg_a[0]))

Submission status: Wrong Answer

Solution code:

a,b = map(int,input().split())
c = int(a / 0.08)
status = 0
ans = 0

for i in range(1,c+1):
    if 1 <= int(i * 0.08) and 1 <= int(i * 0.1) and int(i * 0.08) == a and int(i * 0.1) == b:
#        print(i)
        if int(i * 0.08) == a and int(i * 0.1) == b:
            status = 1
            ans = i
            break
        else:
            pass

if status == 1:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

tax8 = math.floor(a/0.08)
tax10 = math.floor(b/0.1)
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 = list(tax8s & tax10s)

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

print(taxl[0])

Submission status: Wrong Answer

Solution code:
import math

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

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

min10 = int(B/0.1)
max10 = int((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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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


if (D * 1.0 < C * 1.1 <= D * 1.1 < C * 1.2):
    print(int(C))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int, input().split())
a=int(A/0.08+0.5)
b=int(B/0.1)
if a==b:
	print(a)
elif abs(a-b)<=100:
	print(a)
else:
	print('-1')

Submission status: Wrong Answer

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

AA = A*100//8
BB = B*10
AAA = [i for i in range(AA,(A+1)*100//8+1)]
BBB = [i for i in range(BB,(B+1)*10)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list and (12<min(AB_list)<=1000) else -1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

while (cnt*0.08)//1 == a:
  cnt += 1
  
if cnt == tmp:
  if (cnt * 0.1)//1 == b:
    print(cnt)
    exit()
for i in range(tmp, cnt):
  ans = (i * 0.1)//1
  #print(i ,ans)
  if ans == b:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

Solution code:
from sys import stdin


def spam(x, AB, per):
    min_ = x + 1
    max_ = x - 1
    while True:
        min_ -= 1
        tmp = int(min_ * per)
        if AB != tmp:
            min_ += 1
            break
    while True:
        max_ += 1
        tmp = int(max_ * per)
        if AB != tmp:
            max_ -= 1
            break
    return min_, max_


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    x = spam(int(A / 0.08), A, 0.08)
    y = spam(int(B / 0.1), B, 0.1)

    if x[0] <= y[0] <= x[1]:
        print(y[0])
    elif y[0] <= x[0] <= y[1]:
        print(x[0])
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

b_list = []
for i in range(10):
  b_list.append(b+i)

for i in b_list:
  pre_cnt = i*0.08
  cnt = math.floor(pre_cnt)
  if cnt == A:
    print(i)
    exit()

print(-1)

Submission status: Wrong Answer

Solution code:
import math
 
blue, red = map(int, input().split())
 
blueA = math.ceil(((blue) / 8) * 100)
blueBB = ((blue+1) / 8) * 100
blueB = math.floor(((blue + 1) / 8) * 100)
if blueBB == blueB:
    blueB -=1
 
redA = math.ceil((red / 10) * 100)
redBB = ((red+1) / 10) * 100
redB = math.floor(((red + 1) / 10) * 100) - 1
if redBB == redB:
    redB -= 1

'''
print(blueA)
print(blueB)
print(redA)
print(redB)
'''

if blueA <= redA:
    if blueB >= redA:
        print(redA)
    else:
        print("-1")
else:
    if redB >= blueA:
        print(blueA)
    else:
        print("-1")

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)

if (A+1)%0.08==0:
  X2=X2-1

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

if (B+1)%0.08==0:
  Y2=Y2-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 = (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):#Aと
        print(i)
        break
    
    if(i == 100):
        print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(float, input().split())
if math.floor(a / 0.08) == math.floor(b / 0.1):
  print(math.floor(a / 0.08))
elif a == b:
  for i in [(b + 0.1), (b + 0.2), (b + 0.3), (b + 0.4), (b + 0.5), (b + 0.6), (b + 0.7), (b + 0.8), (b + 0.9)]:
    if math.floor(a / 0.08) == math.floor(i / 0.1):
      print(math.floor(i / 0.1))
      break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

list_8 = []
list_10 = []

for i in range(101):
  list_8.append( math.ceil((i+1) * 12.5) )
  list_10.append( (i+1) * 10 )
  
A, B = map(int, input().split())

A_ = list_8[A]
A = list_8[A-1]
  
B_ = list_10[B]
B = list_10[B-1]

if A_ < B or B_ < A:
  print(-1)
elif B <= A_:
  print(B)
else:
  print(A)

Submission status: Wrong Answer

Solution code:
import math


def main():
    a, b = map(int, input().split())
    if a >= 20:
        price = b * 10
        tax = math.floor(price * 0.08)
        if a == tax:
            print(price)
        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_a:
            if ary_b.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:
a, b = map(int, input().split())

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

a2 = int((a+1) / 0.08)
b2 = int((b+1) / 0.1)

    
print(a1, b1, a2, b2)

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

Submission status: Wrong Answer

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
ans=-1
for i in range(1,1000):
    #print(int(i*0.08))
    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:
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:
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
    if x == A:
        print(VA)
    else:
        print(-1)      
elif VA < VB:
    x = (VB * 0.8)//1
    if x == B: print(VB)
    else:
        print(-1)
else:
    print(VA)

Submission status: Wrong Answer

Solution code:
# C - Tax Increase
a, b = map((int),(input().split()))

eight = (100 * a) / 8
ten = (100 * b) / 10

if eight > ten:
    if b == (int)(eight * 0.1):
        print((int)(eight))
    else:
        print(-1)
elif ten > eight:
    if a == (int)(ten * 0.08):
        print((int)(ten))
    else:
        print(-1)
else:
    print((int)(ten))

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)
    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 = int(x*0.1)
# if (check == b) :
#     print(x)
# else :
#     print(-1)


x = round(a/0.08)
y = round(b/0.1)
d = x - y
if d == 0 :
    print(x)
elif x%d == 0 and y%d == 0 :
    print(x)
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)

if c % 7 == 0 :
    print(-1)

else:
    print(math.floor(c/7))

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

x = int(A/0.08)
y = int(B/0.10)

if y>x:
    if abs(y-x)>=5:
        print(-1)
    else:
        while((int(x*0.08)==A)and x<y):
            x+=1
        if x==y:
            print(x)
        else:
            print(-1)
else:
    if abs(y-x)>=10:
        print(-1)
    else:
        while((int(y*0.10)==B)and y<x):
            y+=1
        if y==x:
            print(y)
        else:
            print(-1)

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:
    if a > b:
        print(a) 
    else:
        print(b)
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)//1==((25/2)*A)//1:
      print((10+i)*B)
      exit()
else:
  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)+10):
    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())

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

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


if (D * 1.0 < C * 1.1 < D * 1.1 < C * 1.2):
    print(int(C))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
x1=(25*a)/2
x2=10*b
print(-1 if x1//10 != x2//10 else math.floor(x1))

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
if cnt == tmp:
  cnt += 1
#print(tmp, cnt)
for i in range(tmp, cnt):
  ans = int((i * 0.1)//1)
  #print(i ,ans)
  if ans == b:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

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

AA = A*100//8
BB = B*10
AAA = [i for i in range(AA,(A+1)*100//8+1)]
BBB = [i for i in range(BB,(B+1)*10+1)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list and (12<min(AB_list)<=1000) else -1
print(ans)

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

xa = [a1 + i for i in range(13)]
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

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
        elif math.floor(b * 0.08) == A and math.floor(b * 0.1) == B:
            ret = b
        else:
            ret = max(a, b) +1
        print(ret)

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)

if ansA == ansB:
    print(ansA)
    exit()
for i in range(ansB,ansA+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:
A, B = [int(x) for x in input().split()]

res_a = int(A / 0.08)
res_b = int(B / 0.1)

if res_a == res_b:
    print(res_a)
else:
    max_res = max(res_a, res_b)
    max_res_a = int(max_res * 0.08)
    max_res_b = int(max_res * 0.1)
    if max_res_a == A and max_res_b == B:
        print(max_res)
    else:
        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 == A:
        print(VA)
    else:
        print(-1)      
elif VA < VB:
    x = (VB * 0.8)//1
    print('VB', x)
    if x == B: print(VB)
    else:
        print(-1)
else:
    print(VA)

Submission status: Wrong Answer

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

before_A = A/0.08
before_B = B/0.1

if A > B:
    print(-1)
else:
    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:
import math

s = input()

ss = s.split(" ")

TAX_A = 0.08
TAX_B = 0.1

A = int(ss[0])
B = int(ss[1])



ans = 10000
re = False
for i in range(1000,0,-1):
  tax_a = math.floor( i * TAX_A ) 
  tax_b = math.floor( i * TAX_B )
  if tax_a == A and tax_b == B:
    if i < ans :
      print("update ans:" ,i)
      ans = i
      re = True

if re == True:
  print( ans )
else:
  print(-1)