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:
aa, bb = map(int,input().split())
a = aa / 0.08
b = bb / 0.1
c = []
if (a-int(a))>0.5:
    for i in range(13):
        for j in range(9):
            if int(a)+i == int(b)+j:
                c.append(int(a)+i)
            else:
                pass
else:
    for i in range(12):
        for j in range(9):
            if int(a)+i == int(b)+j:
                c.append(int(a)+i)
            else:
                pass
if c==[]:
    print(-1)
elif (int(a)+i)<=0:
    print(-1)
else:
    print(*c[:1])

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

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 

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

match=0
mp=0
ea=0
eb=0
if len(al)<=len(bl):
    kai=len(al)
else:
    kai=len(bl)

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

if match==1:
    print(mp)
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 math

a, b = map(int, input().split())
price = -1
aPrice = a / 0.08
bPrice = (b + 0.5) / 0.1

if math.floor(aPrice) == math.floor(bPrice):
    price = math.floor(aPrice)

print(price)

Submission status: Wrong Answer

Solution code:
import math
A,B = input().split(' ')
if int(A) and int(B)<=100:
    for x in range (101):
        if x*0.08==math.floor(int(A)) and x*0.1==math.floor(int(B)):
            print(x)
        elif x==100:
            print('-1')

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
mod = (a*100) % 8
eightpermin = a * 100 // 8

if mod != 0:
    eightpermin += 1

eightpermax = (a+1) * 100 // 8


tenpermax = (b+1) * 10 - 1
tenpermin = tenpermax - 9

if eightpermin == tenpermin:
    print(eightpermin)
elif eightpermin < tenpermin and eightpermax >= tenpermin :
    print(tenpermin)
elif eightpermin > tenpermin and eightpermin <= tenpermax :
    print(eightpermin)
else:
    print(-1)

Submission status: Wrong Answer

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

n0 = math.floor(a / 0.08)
n1 = math.ceil((a+1) / 0.08)
m0 = math.floor( b / 0.1)
m1 = math.ceil((b+1) / 0.1)

if n0 > m0:
    flag = True
    ans = n0
else:
    flag = False
    ans = m0

if flag:
    if ans in range(m0,m1+1):
        print(ans)
    else:
        print(-1)
else:
    if ans in range(n0,n1+1):
        print(ans)
    else:
        print(-1)

Submission status: Wrong Answer

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

import math

ans = []

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

al = math.ceil(a / 0.08)
ar = math.ceil((a + 1)/ 0.08) + 1

bl = math.ceil(b / 0.10)
br = math.ceil((b + 1)/ 0.10) + 1

ae = list(range(al, ar))
be = list(range(bl, br))

ee = set(ae) & set(be)
if len(ee) == 0:
    print(-1)
else:
    print(min(ee))

Submission status: Wrong Answer

Solution code:
a,b= map(int, input().split())
aa = a + 0.9
bb = b + 0.9

aaa = set(range(int(a/0.08),int(aa/0.08)))
bbb = set(range(int(b/0.1), int(bb/0.1)))


x = list(aaa.intersection(bbb))

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

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
diff = b - a
if diff > 100:
    print(-1)
else:
    min = diff * 50
    max = (diff + 1) * 50
    flg = 0
    for i in range(min, max + 1, 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:
def input_int_list():
    return [int(thing) for thing in input().split(" ")]
def No():
    print(-1)
    exit()
def eight(x):
    return x*0.08//1
def ten(x):
    return 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:
A, B = map(int, input().split())

Araw = A/0.08
Braw = B/0.10

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

Submission status: Wrong Answer

Solution code:
import math
a, b = 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(max(aRange[0], bRange[0]))

Submission status: Wrong Answer

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

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

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

print(min_ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def resolve():
    A, B = map(int, input().split())  

    # max
    X_MAX = int(100 / 0.08)
    Y_MAX = int(100 / 0.10)

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


    for i in range(Y_MAX):
        if int(i * 0.08) == A and int(i * 0.10) == B:
            print(i)
            return

    '''
    while x < X_MAX:
        y = int(B / 0.10)
        print("x: " + str(x))
        if x == y:
            print(x)
            return
        while y < Y_MAX:
            print(" y: " + str(y))
            y = y * 2
            if x == y:
                print(x)
                return
        x = x * 2
    '''
    print('-1')


if __name__ == "__main__":
    resolve()

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
b2 = 10 * (B + 1)

length_a = a2 - a1
length_b = b2 - b1

if length_b == 0:
  print(-1)
else:
  if length_a == 0:
    xa = [a1]
  else:
    La = length_a + 1
    xa = [a1 + i for i in range(La)]
    if length_b == 1:
      xb = [b1]
    else:
      Lb = length_b
      xb = [b1 + i for i in range(Lb)] 
    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:
# -*- 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])

#print(tax_8_candidate)
#print(tax_10_candidate)

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

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

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 * 8 / 100) == A and int(i / 10) == B:
        h.append(i)
if h != []:
    print(h[0])
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
a = int(A * 0.08)
b = int(B * 0.1)
#print(a,b)
if a < b:
    a_2 = a + 12
    if a_2 > b:
        print(b)
    else:
        print(-1)
elif b < a:
    b_2 = b + 10
    if b_2 > a:
        print(a)
    else:
        print(-1)
else:
    print(a)

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.9)/0.08)
a_list = list(np.arange(a_low, a_up+1))

b_low = int(b/0.1)
b_up = int((b+0.9)/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:
a, b = map(int, input().split())

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

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

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

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
non_taxed_A = A / 0.08 
non_taxed_B = B / 0.1

if non_taxed_A > non_taxed_B:
    for m in range(int(non_taxed_B),int(non_taxed_A)+1):
        if int(m*0.08) == int(m*0.1):
            print(m)
            exit()
elif non_taxed_A == non_taxed_B:
    print(int(non_taxed_A))
    exit()
else:
    for m in range(int(non_taxed_A),int(non_taxed_B)+1):
        if int(m*0.08) == int(m*0.1):
            print(m)
            exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a2 = round(a * 13.5)
b2 = round(b * 11)
a3 = round(b2 * 0.926)
b3 = round(a2 * 0.909)
a22 = a2-a
b22 = b2-b
if a22 == b22:
  print(a22)
elif a2-a == b3:
  print(b3)
elif b2-b == a3:
  print(a3)
else:
  print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math

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

def tax_increase(a, b):
    tax8 = 12.5
    tax10 = 10

    price8 = math.floor(a * tax8)
    price10 = math.floor(b * tax10)

    # price8を10%で表せるか
    x = math.floor(price8 * 0.1)

    # price10を8%で表せるか
    y = math.floor(price10 * 0.08)

    if x == b:
        print(price8)
    elif y == a:
        print(price10)
    else:
        print("-1")


tax_increase(a, b)

Submission status: Wrong Answer

Solution code:
from math import ceil

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

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

b_btm = b*10
b_top = (b+1)*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:
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(hantei)

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

if math.floor(N_a*0.08) == a and math.floor(N_b*0.1) == b:
    result = N_a
print(result)

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
A=math.ceil((a+1)/0.08)-1
B=math.ceil((b+1)/0.1)-1
A_=math.ceil(a/0.08)
B_=math.ceil(b/0.1)
C=math.floor(B*0.1)-math.floor(B*0.08)
if b>80 or A<B_ or b-a>C:
    print(-1)
else:
    print(A_)

Submission status: Wrong Answer

Solution code:
from sys import stdin


def spam(x, AB, per):
    min_ = x
    max_ = x
    while True:
        min_ -= 1
        tmp = min_ * per
        if tmp < AB:
            min_ += 1
            break
    while True:
        max_ += 1
        tmp = max_ * per
        if (AB + 1) < 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)
    # print(x)
    # print(y)
    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(float,input().split())
A_min=int(A/8*100)+1
A_max=int((A+1)/8*100)
ans=0
flag=False
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)

Submission status: Wrong Answer

Solution code:
import math
 
blue, red = map(int, input().split())
 
blueA = math.ceil(((blue) / 8) * 100)
blueB = math.floor(((blue+1) / 8) * 100)-1
 
redA = math.ceil((red / 10) * 100)
redB = math.floor(((red+1) / 10) * 100)-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:
#C
import sys
a,b=map(int,input().split())
for i in range(1,1000):
    if int(i*0.08)==a and int(i*0.1)==b:
        ans=i
        break
    if i==999:
        ans=-1

print(ans)

Submission status: Wrong Answer

Solution code:
import math

a,b=map(int,input().split())
if a%2==0:
    s=a*12.5
    s=math.floor(s)
    if s-b*10==5:
        print(s)
    elif b*10-s==5:
        print(b*10)
    elif b*10==s:
        print(s)
    else:
        print("-1")
else:
    t=a*12.5 +0.5
    if t-b*10==3:
        t=math.floor(t)
        print(t)

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

Submission status: Wrong Answer

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

for i in range(0, 10):
  test_A = A + (i/10)
  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:
A,B = map(int,input().split())
a = int(A * 0.08)
b = int(B * 0.1)
print(a,b)
if a < b:
    a_2 = a + 12
    if a_2 > b:
        print(b)
    else:
        print(-1)
elif b < a:
    b_2 = b + 10
    if b_2 > a:
        print(a)
    else:
        print(-1)
else:
    print(a)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if B==((5/4)*A)//1:
  print(10*B)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
N=0
flag=0
while N<100 and flag==0:
  N += 1
  a = N * 0.08 // 1
  b = N * 0.1 // 1
  #print(N,a,b)
  if a==A and b==B:
    flag = 1
    
if flag==1:
  print(N)
else:
  print(-1)

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 x <= y and y <= x+6:
        print(y)
        break
    elif y <= x and x <= y+8:
        print(x)
        break
    elif i == 1000:
        print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
def ans(A,B):
	for i in range(1,101):
		if int(math.floor(i*0.1))==B:
			if int(math.floor(i*0.08))==A:
				return i
	return '-1'
print(ans(A,B))

Submission status: Wrong Answer

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

price_8 = -int(-a/0.08)
price_10 = -int(-b/0.1)

start = min(price_8, price_10)
end = max(price_8, price_10)
flg = True
for price in range(start, end+1):
    if floor(price*0.08)==a and floor(price*0.1)==b:
        print(price)
        flg = False 
        break
if flg:
    print(-1)

Submission status: Wrong Answer

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

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

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

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

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

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

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

Submission status: Wrong Answer

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

X1=A/0.08
X2=(A+1)/0.08

Y1=B/0.1
Y2=(B+1)/0.1


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

Submission status: Wrong Answer

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

al = math.ceil(a / 0.08)
ar = math.floor((a + 1)/ 0.08) + 1

bl = math.ceil(b / 0.10)
br = math.floor((b + 1)/ 0.10) + 1

ae = list(range(al, ar))
be = list(range(bl, br))

ee = set(ae) & set(be)
if len(ee) == 0:
    print(-1)
else:
    print(min(ee))

Submission status: Wrong Answer

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

e = (A*100)//8
t = B*10

ee = e
tt = t
# while True:
#   ee -= 1
#   if (ee*8)//100 == A:
#     continue
#   else:
#     ee += 1
#     break

if ee < t:
  startval = t
  stopval = ee
else:
  startval = ee
  stopval = t

ans = 0
if ee != t:
  for ii in range(startval,stopval,-1):
    if (ii * 10)//100 == B and (ii * 8)//100 == A:
      ans = ii
else:
  ans = ee
if ans == 0:
  ans = -1
print(ans)

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 = 1000
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:
      ans = i
      re = True

if re == True:
  print( ans )
else:
  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:
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:
inp = input().split(" ")
A, B = (int(inp[0]), int(inp[1]))
kouhoB = []
if A % 2 == 1:
    kouhoA = list(range(int(A * 12.5 + 1), int((A + 1) * 12.5)))
else:
    kouhoA = (list(range(int(A * 12.5), int((A + 1) * 12.5 + 1))))
num = B*10
while num <= B*10+9:
    kouhoB.append(num)
    num += 1
dottimo = list(set(kouhoA) & set(kouhoB))
if len(dottimo) >= 1:
    print(list(set(kouhoA) & set(kouhoB))[0])
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:
    print(-1)
else:
  if int(priceB * 0.08) == A :
    print(priceB)
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
ans = []
for i in range(10):
    a = int((A+i*0.1)/0.08)
    for j in range(10):
        b = int((B+j*0.1)/0.1)
        if a == b:
            print(a)
            exit()

Submission status: Wrong Answer

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


num = 0
flag = 0

#print(x)

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

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

Submission status: Wrong Answer

Solution code:
import math


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

a1 = math.floor(a / 0.08)
a2 = math.floor(((a+1) / 0.08))-1

b1 = math.floor(b / 0.1)
b2 = math.floor(((b+1) / 0.1))-1

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

Submission status: Wrong Answer

Solution code:
from math import floor

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

for i in range(1000):
    if floor(i * 0.08) == A and floor(i * 0.1) == B:
        print(i)
        exit()
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.9)/0.08)
a_list = list(np.arange(a_low, a_up))

b_low = int(b/0.1)
b_up = int((b+0.9)/0.1)
b_list = list(np.arange(b_low, b_up))

#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:
# -*- coding: utf-8 -*-
import math
import sys
a,b=map(int, input().split())

x = math.floor(a/0.08)
#1の位が1-9
y = math.floor(b/0.1)

xx = x
if math.floor((x + 1) * 0.08) == a:
    xx = x + 1
elif math.floor((x - 1 ) * 0.08) == a:
    x = x - 1

for i in range(y,y+10):
    for j in range(x, xx+1):
        if i == j:
            print(i)
            sys.exit(0)
print(-1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math


def solve(A: int, B: int):
    price_a = math.floor(A * 100 / 8)
    price_b = math.ceil(B * 100 / 10)
    start, end = (price_a, price_b) if price_a < price_b else (price_b, price_a)

    for p in range(start, end+1):
        if math.floor(p * 8/100) == A and math.floor(p * 10/100) == B:
            return p
    return -1


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    print(solve(A, B))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
f = int(a/0.08)
if f==b//0.1:
    print(f)
    exit()
for i in range(10):
    k = i*0.1
    if int(f*k)==b:
        print(f)
        exit()
print(-1)

Submission status: Wrong Answer

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

price_8 = -int(-a/0.08)
price_10 = -int(-b/0.1)

start = min(price_8, price_10)
end = max(price_8, price_10)

for price in range(start, end+1):
    if floor(price*0.08)==a and floor(price*0.1)==b:
        print(price)
        break
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

va=(a/0.08)
vb=(b/0.1)

if(int(vb*0.08)>a):
    print(-1)
else:
    while(int(va*0.1)!=b):
        va+=1
    print(int(va))

Submission status: Wrong Answer

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

low =  math.floor(A / 0.08)
high = math.floor((A+1) / 0.08)

low_B = math.floor(B / 0.1)
high_B = math.floor((B+1) / 0.1)

# print(low,high)
# print(low_B,high_B)
is_found = False
for price in range(low,high) :
    # print(price)
    if (low_B <= price and price < high_B) :
        is_found = True
        print(price)
        break

if (not is_found) :
    print("-1")

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

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

p = int(A / 0.08)
q = int(B / 0.1)

min = -1

if p < q:
    for i in range(p, q+1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            min = i
            break
else:
    for i in range(q, p+1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            min = i
            break

print(min)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
x = (round(a/0.08)) 
y = (round(b/0.1))
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())

ans1 = int(A *100// 8) 
ans2 = int(B *100 // 10)

if ans1 == ans2:
    print(ans1)

elif ans1 > ans2:
    ans2_2 = int((B+1) *100 // 10)
    list = [int(ans2)]

    for i in range(ans2+1,ans2_2):
        list.append(int(i)) 
    
    if int(ans1) in list:
        print(ans1)
    else:
        print(-1)
elif ans1 < ans2:
    ans1_2 = int((A+1) *100 // 8)
    list = [int(ans1)]

    for i in range(ans1+1,ans1_2):
        list.append(int(i)) 
    
    if int(ans2) in list:
        print(ans2)
    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 <= C + (C*0.02) ):
    print(int(C))
else:
    print(-1)

Submission status: Wrong Answer

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

for x in range(1,101):
    if int(x*2/25)==A and int(x/10)==B:
        print(x)
        exit()
print(-1)

Submission status: Wrong Answer

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

a=math.floor(A*12.5)
c=B*10
d=(B+1)*10
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:
import math

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

aa = A / 0.08
bb = B / 0.1


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

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
for i in range(1, 101):
    if a == math.floor(i * 0.08):
        for j in range(1, 101):
            if b == math.floor(j * 0.1):
                if i == j:
                    print(j)
                    break
        else:
            continue
        break
else:
    print(-1)

Submission status: Wrong Answer

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

a = int(A*12.5)
b = B*10
ans = -1

if a < b:
    for i in range(a, b+2):
        if (int(i*0.1) == B) and (int(i*0.08) == A):
            ans = i

else:
    for i in range(b, a+2):
        if (int(i*0.1) == B) and (int(i*0.08) == A):
            ans = i

print(ans)