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 sys
import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
a,b= map(int,input().split())
ans=math.floor(a/0.08)
ju=math.floor(b/0.1)
li=[]
li1=[]

i=0
for i in range(101):
  if a==math.floor(i*0.08):
    li.append(i)
  if b==math.floor(i*0.1):
    li1.append(i)

li.sort()
li1.sort()

if len(li1)>0:
  ans=min(li1)
if len(li)>0:
  ju=min(li)
for i in range(len(li1)):
  if ju==li1[i]:
    print(ju)
    sys.exit()
for i in range(len(li)):
  if ans==li[i]:
    print(ans)
    sys.exit()
print('-1')

Submission status: Wrong Answer

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

mid_a = 12.5 * a
mid_b = 10 * b

a_range = [i for i in range(round(mid_a), round(mid_a + 12 + 1)) if i > 0]
b_range = [i for i in range(round(mid_b), round(mid_b + 9 + 1)) if i > 0]

seki = list(set(a_range) & set(b_range))

if seki:
    print(seki[0])
else:
    print(-1)

Submission status: Wrong Answer

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

ans = []

for i in range(0, 10):
    for j in range(0, 10):
        a = A + (0.1 * i)
        b = B + (0.1 * j)
        a = a * 12.5
        b = b * 10
        #print(a, b)
        if int(a) == int(b):
            ans.append(int(a))
#print(ans)
print(min(ans)) if ans else print(-1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())
flag = 0
# 計算
for i in range(1, 100+1):
  if int(i * 0.08) == a and int(i * 0.1) == b: 
    flag = 1
    break

# 出力
if flag == 0:
  print(-1)
elif flag == 1:
  print(i)

Submission status: Wrong Answer

Solution code:
import math

a = list(map(int, input().split()))
b = -1
for i in range(1000):
    x = math.floor(i*0.08)
    y = math.floor(i*0.1)
    if a[0] == x and a[1] == y:
        b = i
        break

print(b)

Submission status: Wrong Answer

Solution code:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
a, b = (int(i) for i in input().split())  

p = []
answer=-1
for i in range(1,101):
    if int(i*0.08) == a:
        p.append(i)

for i in p:
    if int(i*0.1) == b:
        answer = i
        break

print(answer)

Submission status: Wrong Answer

Solution code:
import math
a, b = (int(i) for i in input().split())
x = a / 0.08
flag = False
for i in range(8):
    if (math.floor(x * 0.1) == b):
        flag = True
        break
    x = x + i
if flag:
    print(int(x))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil

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

a_btm = ceil(a*100/8)
a_top = (a+1)*100//8

b_btm = ceil(b*100/10)
b_top = (b+1)*100//10

ans = -1
for aa in range(a_btm,a_top):
    for bb in range(b_btm,b_top):
        if aa == bb:
            ans = aa
            break
    break

print(ans)

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split(' '))
flg = False
for i in range(1000):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        flg = True
        break
if flg==False:
  print(-1)

Submission status: Wrong Answer

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

if(A<=100 and B<=100):
    X = round(A/0.08)
    Y = round(B/0.1)
    C = round(min(X,Y))
    if(round(C*0.08)==A and round(C*0.1)==B):
        print(C)
    else:
        print(-1)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a1 = set([int((a + i/10) * 12.5) for i in range(10)])
b1 = set([int((b + i/10) * 10) for i in range(10)])
res = a1 & b1
if res:
    print(min(res))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
ans = -1
for i in reversed(range(1,111)):
  if int(i*1.08)-i == a and int(i*1.10)-i == b:
    ans = i
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a_max = (a + 1)/0.08
a_min = a / 0.08
b_max = (b + 1)/0.1
b_min = b / 0.1
u = 0
for i in range(int(b_max) + 1):
    if a_min <= i <= a_max and b_min <= i <= b_max:
        print(i)
        break
    else:
        u += 1
if u == int(b_max) + 1:
    print(-1)

Submission status: Wrong Answer

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

for i in range(10^10):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

if (a * 1.25) < b:
    print (-1)
else:
    print (int(a/0.08))

Submission status: Wrong Answer

Solution code:
from math import floor

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

res = -1
for price in range(1, 101):
    if floor(price*0.08) == A and floor(price*0.1) == B:
        res = price
        break

print(res)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
Pa=a/0.08
Pb=b/0.1
li=[]
if Pa*0.1>=b and Pa*0.1<b+1:
    li.append(int(Pa))
if Pb*0.08>=a and Pb*0.08<a+11:
    li.append(int(Pb))
if len(li)>0:
    print(min(li))
if len(li)==0:
    print(-1)

Submission status: Wrong Answer

Solution code:
def iin(): return int(input())
def iln(): return list(map(int, input().split()))

tax_rate_a = 8
tax_rate_b = 10

A, B = iln()
# A, B = [2, 2]
# A, B = [8, 10]
# A, B = [19, 99]

orig_price_a = int(A * 100 / tax_rate_a)
orig_price_b = int(B * 100 / tax_rate_b)

print(orig_price_a, orig_price_b)
print(int(orig_price_a * 0.08), int(orig_price_b * 0.10))

if int(orig_price_a * 0.08) == int(orig_price_b * 0.10) or orig_price_a == orig_price_b:
    print(orig_price_a)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

a, b = input_nums()

a_rate = 0.08
b_rate = 0.1

al = a / a_rate
ar = (a+1) / a_rate
bl = b / b_rate
br = (b+1) / b_rate

ans = 0
if bl <= al and al < br:
    ans = int(al)
elif bl <= ar and ar < br:
    ans = int(bl)
elif al <= bl and br <= ar:
    ans = int(bl)
else:
    ans = -1

if int(ans*0.08) < a:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
a=input().split()
A,B=int(a[0]),int(a[1])
p=math.floor(A/0.08)
if(math.floor(p*0.1)==B):
  print(p)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import sys
import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
a,b= map(int,input().split())
ans=math.floor(a/0.08)
ju=math.floor(b/0.1)
li=[]
li1=[]

i=0
for i in range(101):
  if a==math.floor(i*0.08):
    li.append(i)
  if b==math.floor(i*0.1):
    li1.append(i)

li.sort()
li1.sort()
print(li)
print(li1)
if len(li1)>0:
  ans=min(li1)
if len(li)>0:
  ju=min(li)
for i in range(len(li1)):
  if ju==li1[i]:
    print(ju)
    sys.exit()
for i in range(len(li)):
  if ans==li[i]:
    print(ans)
    sys.exit()
print('-1')

Submission status: Wrong Answer

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

result_a0 = A / 0.08
result_a1 = (A+1) / 0.08
result_b0 = B / 0.1
result_b1 = (B+1) / 0.1

# print(f"result_a:{result_a0} result_a1:{result_a1} result_b:{result_b0} result_b1:{result_b1}")
# print(f"int: result_a:{int(result_a0)} result_a1:{int(result_a1)} result_b:{int(result_b0)} result_b1:{int(result_b1)}")

### a と b がかぶっていない、または a と b のかぶっている間に整数が存在しないというパターンをフォローしたい
if result_a1 < result_b0 or (int(result_a1 - result_b0) < 1 and int(result_a1) != int(result_b0)): 
    print("-1")
else:
    print(int(min(result_a0, result_b0)))

Submission status: Wrong Answer

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

X = A/0.08
Y = B/0.1

if X == Y:
	print(math.floor(X))
elif X > Y:
	if A == math.floor(X * 0.1):
		print(math.floor(X))
	else:
		print(-1)
else:
	if B == math.floor(X * 0.08):
		print(math.floor(Y))
	else:
		print(-1)

Submission status: Wrong Answer

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

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

temp_a1 = 100 * a // 8
temp_a2 = 100 * (a + 1) // 8
temp_b1 = 10 * b // 10
temp_b2 = (10 * (b + 1)) - 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  = 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):
    print(int(resa))

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

else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
eightpermin = a * 100 // 8
tenpermax = b * 10 - 1

if eightpermin >= tenpermax:
    print(eightpermin)
else:
    print(-1)

Submission status: Wrong Answer

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

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

if max(A / 0.08, B / 0.1) < min(Amax, Bmax):
    print(max(A / 0.08, B / 0.1))
else:
    print(-1)

Submission status: Wrong Answer

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

import math

la = []
lb = []
for i in range(101):
    if math.floor(0.08*i) == A:
        la.append(i)
    else:
        continue

for i in range(101):
    if math.floor(0.1*i) == B:
        lb.append(i)
    else:
        continue

lab = set(la) & set(lb)

if not lab:
    print(-1)
else:
    print(min(lab))

Submission status: Wrong Answer

Solution code:
num = {}

num = input().split()

# print(num)

answer = int(int(num[0]) / 0.08)

kensyo = int(answer * 0.1) == int(num[1])

# print(kensyo)

if kensyo:
  print(int(int(num[0]) / 0.08))
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+1))
Y = set(range(y_min, y_max+1))

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    flag = False
    for i in range(1, 101):
        tax8 = math.floor(i * 0.08)
        if tax8 == a:
          for j in range(i, 101):
              tax10 = math.floor(j* 0.10)
              if tax10 == b and i == j:
                  ans = i
                  flag = True
                  break
        if flag:
            break
    else:
        ans = -1
    
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

A, B = map(int, input().split())
al = math.floor(12.5*A)
ar = math.floor(12.5*(A+1))

bl = 10*B
br = 10*(B+1)

if ar < bl or br < al:
  print("-1")
elif al < bl:
  print(bl)
else:
  print(al)

Submission status: Wrong Answer

Solution code:
import math
def ccc(a, b):

    for i in range(1, 101):
        an = math.floor(i * 0.08)
        bn = math.floor(i * 0.1)
        if an == a and bn == b:
            return i
    return "-1"

def main():
    a , b = map(int , input().split())
    print(ccc(a , b))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A, B = [int(n) for n in input().split()]
XA = 100*A//8
XB = 10*B
r = abs(XA-XB)*0.1
print(-1 if r > 0.9 else max(XA, XB))

Submission status: Wrong Answer

Solution code:
import math
A,B = list(map(int,input().split()))
before_min_A = math.ceil(A * 12.5)
before_min_B = B * 10
if before_min_B <= before_min_A < before_min_B + 10:
    print(before_min_A)
elif before_min_A <= before_min_B < before_min_A + 12.5:
    print(before_min_B)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
import sys
A,B =map(int, input().split())
x = 0
for a in range(A*10,A*10+10):
  for b in range(B*10,B*10+10):
    if a*12.5 == b*10:
      print(b)
      sys.exit()
print(-1)

Submission status: Wrong Answer

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

A = []
B = []
S = []

for i in range(13):
    A.append(int((12.5*a))+i)

for k in range(10):
    B.append((10*b)+k)
    
if len(list((set(A))& set(B))) > 0:
    S = list((set(A))& set(B))
    print(min(S))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
amin = a*100//8 + ((a*100)%8 and 1)
amax = (a+1)*100//8 + (((a+1)*100)%8 or 1)
bmin = b*100//10 + ((b*100)%10 and 1)
bmax = (b+1)*100//10 + (((b+1)*100)%10 or 1)
A = set(range(amin, amax))
B = set(range(bmin, bmax))
if (A & B):
    print(min(A&B))
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

result = -1
for i in range(1, 10000 + 1):
  if i * 0.08 == a and math.floor(i * 0.1) == b:
    result = i
    break
      
print(result)

Submission status: Wrong Answer

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

a_min, a_max = math.ceil(12.5 * a), math.floor(12.5 * (a + 1))
b_min, b_max = math.ceil(10 * b), math.floor(10 * (b + 1))

if a_min <= b_min <= a_max:
    print(b_min)
elif b_min <= a_min <= b_max:
    print(a_min)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<=int(10*b):
  print(-1)
if int(10*(b+1))<=int(25*a/2):
  print(-1)
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
tmpa =  math.floor(A / 0.08)
tmpb = math.floor(B / 0.1)
alst = [tmpa]
blst = [tmpb]

indexa = 1
while True:
    tmp = math.floor((tmpa + indexa) * 0.08)
    if tmp == A:
        alst.append(tmpa + indexa)
        indexa += 1
    else:
        break

indexb = 1
while True:
    tmp = math.floor((tmpb + indexb) * 0.1)
    if tmp == B:
        blst.append(tmpb + indexb)
        indexb += 1
    else:
        break
ans = -1
alst.sort()
blst.sort()
for i in alst:
    if blst.count(i) >= 1:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
a = list(map(int,input().split()))
b = int(np.floor(a[0]/0.08))
c = int(np.ceil((a[0]+1)/0.08))
d = int(np.floor(a[1]/0.1))
e = int(np.ceil((a[1]+1)/0.1))
f=0
if b<d:
    min=b
else :
    min =d
for i in range(min,c+1):
    if i>=b and i<=c:
        if i>=d and i<=e:
            f = i
            break
if f==0:
    print(-1)
else:
    print(f)

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
x = A * 25 / 2
for i in range(13):
  if math.floor(x * 0.1 + i) == B:
    print(int(x))
    break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
a=input().split()
A,B=int(a[0]),int(a[1])
p=int(A/0.08)
if(math.floor(p*0.1)==B):
  print(p)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil
A, B = map(int, input().split(' '))
x0 = ceil(A / 0.08)
x1 = ceil((A+1) / 0.08)
y0 = ceil(B / 0.1)
y1 = ceil((B+1) / 0.1)
if x1 < y0:
  print(-1)
else:
  print(min(max(x0, y0), min(x1, y1)))

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
a_min = a / 0.08
a_max = (a + 1) / 0.08
b_min = b / 0.1
b_max = (b + 1) / 0.1
if a_min > b_min:
  min = a_min
else:
  min = b_min
if a_max < b_max:
  max = a_max
else:
  max = b_max
min = math.ceil(min)
max = math.floor(max)
if min <= max:
  print(min)
else:
  print(-1)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
val=int(a/0.08)
c=b
while True:
    if int(0.1*val)==b:
        print(val)
        break
    if int(val*0.08)>a:
        print(-1)
        break
    val+=1

Submission status: Wrong Answer

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

UE_8 = (A+1)/0.08
SHITA_8 = A/0.08
UE_10 = (B+1)/0.10
SHITA_10 = B/0.10

if UE_8 < SHITA_10 or UE_10 < SHITA_8:
    print(-1)
else:
    i = math.ceil(SHITA_8)
    j = math.floor(UE_8)
    for n in range(i,j+1,1):
        if i < UE_10 and i >= SHITA_10:
            print(i)
        i+=1

Submission status: Wrong Answer

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

def abc158c(a, b):
    cand_a = a * 100 / 8
    range_a = 125
    min_a = int(cand_a)
    if min_a != cand_a:
        min_a += 1
        range_a -= 1
    max_a = min_a + range_a - 1
    min_b = b * 10
    max_b = min_b + 10 - 1
    if max_a < min_b:
        return -1
    elif max_b < min_a:
        return -1
    elif min_a < min_b:
        return min_b
    else:
        return min_a

###
# main
if(__name__ == '__main__'):
    # input
    a, b = map(int, input().split(" "))
    
    accomplishment = abc158c(a, b)
    
    # output
    print(accomplishment)
# else:
    # do nothing

Submission status: Wrong Answer

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

if(A<=100 and B<=100):
    X = (A/0.08)
    Y = (B/0.1)
    C = round(min(X,Y))
    if(round(C*0.08)==A and round(C*0.1)==B):
        print(C)
    else:
        print(-1)
else:
    print(-1)

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
for i in xr:
    for j in yr:
        if i==j:
            print(i)
            flag=True
            break
    if flag:
        break
if not flag:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

a,b=map(int,input().split())
ans=1e9

for i in range(1000):
    if math.floor(i*0.08)==a:
        if math.floor(i*0.1)==b:
            ans=min(ans,i)
            
if ans==1e9:
    print("-1")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:

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

sum_A = int(A/0.08)
sum_B = int(B/0.10)

if sum_A == sum_B:
    print(sum_A)
elif sum_A > sum_B:
    diff = sum_A - sum_B
    if diff >= 10:
        print(-1)
    else:
        print(sum_A)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil
A, B = map(int, input().split(' '))
x0 = ceil(A / 0.08)
x1 = ceil((A+1) / 0.08)
y0 = ceil(B / 0.1)
y1 = ceil((B+1) / 0.1)
print(x0, x1, y0, y1)
if x1 < y0:
  print(-1)
else:
  print(min(max(x0, y0), min(x1, y1)))

Submission status: Wrong Answer

Solution code:
from math import floor
A, B = map(int, input().split())
for x in range(1, 1000):
    if floor(x * 0.08) == A and floor(x * 0.1) == B:
        print(x)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import floor, ceil

# 25a<=p<25(a+1)
# 10b<=p<10(b+1)
# also p must be integer, so the valid range
# must lie around at least one integer value

a, b = map(int, input().split())
inclusive_min = max(12.5*a, 10*b)
exclusive_max = min(12.5*(a+1), 10*(b+1))
if floor(exclusive_max) >= ceil(inclusive_min):
  print(ceil(inclusive_min))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
def main():

    A, B = map(int, input().split())
    v_A = int(A / 0.08)
    v_B = int(B / 0.1)
    v_A2 = int((A+1) / 0.08)
    v_B2 = int((B+1) / 0.1)

    A_cand = [i for i in range(v_A, v_A2+1)]
    B_cand = [i for i in range(v_B, v_B2+1)]

    ab_cand = set(A_cand) & set(B_cand)
    if len(ab_cand) == 0:
        print(-1)
    else:
        print(min(ab_cand))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

xa_max = (a+1)/0.08
xa_min = a/0.08

xb_max = (b+1)/0.1
xb_min = b/0.1

if xb_min < xa_max and xa_min<=xb_min:
  print(int(xb_min))
elif xb_min<=xa_min and xa_min<xb_max:
  print(int(xa_min))
else:
  print("-1")

Submission status: Wrong Answer

Solution code:
import numpy as np
a = list(map(int,input().split()))
b = int(np.floor(a[0]/0.08))
c = int(np.ceil((a[0]+1)/0.08))
d = int(np.floor(a[1]/0.1))
e = int(np.ceil((a[1]+1)/0.1))
f=0
if b<d:
    min=b
else :
    min =d
for i in range(min,b+1):
    if i>=b and i<=c:
        if i>=d and i<=e:
            f = i
            break
if f==0:
    print(-1)
else:
    print(f)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
max_a=a+0.99999999999
min_a=a
max_b=b+0.99999999999
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:
    print(min_b*100//10)
else :
    print(min_a*100//8)

Submission status: Wrong Answer

Solution code:
import math

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

Aset = set([i for i in range(math.floor(A/0.08), math.ceil((A+1)/0.08))])
Bset = set([i for i in range(math.floor(B/0.10), math.ceil((B+1)/0.10))])

ABset = Aset & Bset

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

Submission status: Wrong Answer

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

mina = int(a/0.08)
minb = int(b/0.1)

la = []
lb = set()

flag = True
while flag == True:
    if int(mina * 0.08) == a:
        la.append(mina)
        mina += 1
    else:
        break
while flag == True:
    if int(minb * 0.1) == b:
        lb.add(minb)
        minb += 1
    else:
        break
for i in la:
    if i in lb:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

ans=-1
for i in range(1,B*10+1):
    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 sys
input = sys.stdin.readline

A, B = map(int, input().split(' '))
A_list = [i/10+A for i in range(0, 10)]
B_list = [i/10+B for i in range(0, 10)]
x, y = 0, 0
a_set = set()
b_set = set()
for a in A_list:
    a_set.add(a/0.08)
for b in B_list:
    b_set.add(b/0.1)
ans_list = list(a_set & b_set)
if len(ans_list) == 0:
    print(-1)
else:
    print(int(min(ans_list)))

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int,input().split())
ansA = int(a / 0.08)
ansB = int(b / 0.1)
if ansA < ansB:
  rr = range(ansA, ansB + 1)
elif ansA > ansB:
  rr = range(ansB, ansA + 1)
else:
  print(ansA)
  exit()
  
for i in rr:
  if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

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

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

#配列作成
al = list(range(price_a, price_aplus))
bl = list(range(price_b, price_bplus))

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

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

Submission status: Wrong Answer

Solution code:

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

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


while(int(an*0.08)==a):
    alist.append(an)
    an+=1
    

while(int(bn*0.1)==b):
    blist.append(bn)
    bn+=1
     

for i in alist:
    if i in blist:
        ans = i
        break
    
print(ans)

Submission status: Wrong Answer

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

xa = int(a/0.08)
xb = int(b/0.1)

flag = True
maxi = max(xa,xb)
mini = min(xa,xb)
for i in range(mini,maxi+1):
    if (int(0.08*i) == a) and (int(0.1*i) == b):
        print(i)
        flag = False
        break
        
if flag == True:
    print('-1')

Submission status: Wrong Answer

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

for price in range(1, 101):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        print(price)
        exit()
print(-1)

Submission status: Wrong Answer

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

result_a0 = A / 0.08
result_a1 = (A+1) / 0.08
result_b0 = B / 0.1
result_b1 = (B+1) / 0.1

# print(f"result_a:{result_a0} result_a1:{result_a1} result_b:{result_b0} result_b1:{result_b1}")
# print(f"int: result_a:{int(result_a0)} result_a1:{int(result_a1)} result_b:{int(result_b0)} result_b1:{int(result_b1)}")

### a と b がかぶっていない、または a と b のかぶっている間に整数が存在しないというパターンをフォローしたい
if result_a1 < result_b0 or (int(result_a1 - result_b0) < 1 and int(result_a1) != int(result_b0)): 
    print("-1")
else:
    print(int(min(result_a0, result_b1)))

Submission status: Wrong Answer

Solution code:
from math import ceil
from math import floor
A, B = map(int, input().split())
a1 = ceil(A/0.08)
b1 = ceil(B/0.10)
a2 = floor((A+1)/0.08)
b2 = floor((B+1)/0.10)
if b2 < a1 or a2 < b1:
  print(-1)
else:
  print(max(a1, b1))

Submission status: Wrong Answer

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

result = -1
for i in range(1, 10000 + 1):
  if i * 0.08 == a and math.floor(i * 0.1) == b:
    result = i
      
print(result)

Submission status: Wrong Answer

Solution code:
import sys
from math import floor, ceil

def input():
    return sys.stdin.readline()[:-1]


A, B = map(int, input().split())
let1 = ceil(A*12.5)
ov1 = floor((A+1)*100/8)
let2 = B*10
ov2 = (B+1)*10
select1 = set([i for i in range(let1 , ov1+1)])
select2 = set([i for i in range(let2 , ov2)])
#print(select1, select2)
sel = select1 & select2
if sel == set():
	print(-1)
else:
	print(min(sel))

Submission status: Wrong Answer

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


X1 = (B/0.10)
X2 = ((B+1)/0.10)
X3 = (A/0.08)
X4 = ((A+1)/0.08)

# print(X1, X2, X3, X4)
if X3<=X1 and X1 < X4 and X4 <= X2:
    print(int(X1))
elif X3<=X1 and X1 <= X2 and X2 <= X4:
    print(int(X1))
elif X1<=X3 and X3 <= X4 and X4 <= X2:
    print(int(X3))
elif X1<=X3 and X3 <= X2 and X2 <= X4:
    print(int(X3))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
MAX = 10001
for i in range(1, MAX):
  if i * 0.08 == a and math.floor(i * 0.1) == b:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
a_min = a / 0.08
a_max = (a + 1) / 0.08
b_min = b / 0.1
b_max = (b + 1) / 0.1
if a_min > b_min:
  min = a_min
else:
  min = b_min
if a_max < b_max:
  max = a_max
else:
  max = b_max
min = math.ceil(min)
max = math.floor(max)
if min <= max:
  print(min)
else:
  print("-1")

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
flag = math.floor(A/0.08)
flag2 = math.floor(B/0.1)
if math.floor(flag2*0.08)==A:
  print(flag2)
elif math.floor(flag*0.1)==B:
  print(flag)
else:
  print(-1)

Submission status: Wrong Answer

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

x=[]

x.append(a/0.08)
x.append((a+1)/0.08)
x.append(b/0.1)
x.append((b+1)/0.1)

if x[0]<= x[2] and x[2]<x[1]:
    print(int(x[2]))
elif x[2]<= x[0] and x[0] < x[3]:
    print(int(x[0]))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = [int(y) for y in input().split(' ')]
priceA_min = int((A/8) * 100)
priceA_max = int(((A+1)/8) * 100)
print(priceA_min, priceA_max)
found = False
for x in range(priceA_min,priceA_max+1,1):
  if int(x*0.1) == B:
    print(x)
    found = True
    break
if not found:
  print(-1)

Submission status: Wrong Answer

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

if int(x*0.1)==b:
    print(x)
else :
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
amin = -(-a*25//2)
amax = amin + 8
bmin = b*10
bmax = bmin + 10
for i in range(amin, amax):
    for j in range(bmin, bmax):
        if i == j:
            print(i)
            exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

# 消費税が8%のときA円になる税抜き価格xの範囲
per8_set = set(range(math.ceil(A / 0.08), math.ceil(A / 0.08)+13))
per10_set = set(range(math.ceil(B / 0.1), math.ceil(B / 0.1)+10))

x = per8_set & per10_set

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