Problem:


Score : 300 points

Problem Statement

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

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

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

Constraints

1 \leq A \leq B \leq 100

A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

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

Sample Input 1

2 2

Sample Output 1

25

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

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

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

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

Sample Input 2

8 10

Sample Output 2

100

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

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

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

Sample Input 3

19 99

Sample Output 3

-1

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



Sample input:
2 2


Sample output:
25

Submission status: Wrong Answer

Solution code:

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

maxA = A+0.99
maxB = B+0.99

gAmin = A/8 * 100
gAmax = maxA/8 * 100

gBmin = B*10
gBmax = maxB * 10

#print(gAmin)
#print(gAmax)
#print(gBmin)
#print(gBmax)

if gAmax < gBmin or gBmax < gAmin:
    ans = -1
elif gAmin <= gBmin:
    ans = gBmin
else:
    ans = gAmin

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int, input().split())
ans = 0
for zeinuki in range(1000):
    if math.floor(zeinuki*0.08) == a and\
       math.floor(zeinuki*0.1)  == b:
        ans = zeinuki
        break
if ans == 0:
    print("-1")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
ans=-1
for i in range(1,101):
    _A = (i * 8)//100
    _B = (i * 10)//100
    if a == _A:
        if b == _B:
            ans = i
            break

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# @Time    : 2020/3/1 19:59
# @Author  : DIRICHLET
# @File    : main.py
a=[]
def myin(fun=int):
    global a
    a=list(map(fun,input().split()))
#myin(int)
a,b=map(int,input().split())
oner=(a+1)/0.08
if a%2==0:
    oner=round((a+1)/2*25)+1
    onel=a//2*25
else:
    oner=(a+1)/2*25
    onel=round(a/2*25)+1
#*25/2
twol=b*10
if oner>twol and (b+1)*10>oner:
    if onel<=twol:
        print(twol)
    else:
        print(onel)
else:
    print(-1)
#print(a)
#[25,37.5) [20,30)
#[19-20) [99-100) 99.5-18.5=81/0.02=4050
#(231.35,243.75] (985,995]
#

Submission status: Wrong Answer

Solution code:
import sys
import math

a, b = map(int, input().split())
flg = False
upper, downer = 0, 0

downera = math.floor(100/8 * a)
uppera = math.floor(100/8 * (a+1))

downerb = 10 * b
upperb = 10 * (b+1)


if uppera < downerb or upperb < downera:
    print("-1")
    sys.exit()
for i in range(downera, uppera):
    if i >= downerb and i <= upperb:
        print(i)
        sys.exit()

Submission status: Wrong Answer

Solution code:
import math

a,b = map(lambda x: int(x), input().split())


hati_s = a/0.08
hati_l = (a+1)/0.08

ten_s = b/0.1
ten_l = (b+1)/0.1

#print(hati_s,hati_l,ten_s,ten_l)


def intersec(a_min,a_max,b_min,b_max):
    if a_min < b_min:
        if a_max < b_min:
            return [0,0]
        else:
            if a_max < b_max:
                return [b_min,b_max]
            else:
                return [b_min,a_max]
    else:
        if b_max < a_min:
            return [0,0]
        else:
            if b_max < a_max:
                return [a_min,a_max]
            else:
                return [a_min,a_max]


def min_int(pair):
    if pair == [0,0]:
        return -1
    else:
        return math.ceil(pair[0])



tmp = intersec(hati_s,hati_l,ten_s,ten_l)

if math.ceil(tmp[0]) == math.ceil(tmp[1]):
    print(-1)
else:
    print(min_int(tmp))

Submission status: Wrong Answer

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

# S * 0.08 = A + a, S * 0.10 = B + b
#  A < B
# A <= S * 0.08 < A+1 B <= S * 0.10 < B+1

def getS(A, B):
    if A / 0.08 <= B / 0.10:
        start = int(A / 0.08)
        end = int((B + 1) // 0.10 + 1)
        for S in range(start, end):
            if int(S * 0.08) == A and int(S * 0.10) == B:
                return S
        return -1
    elif B / 0.10 < A / 0.08:
        start = int(B / 0.10)
        end = int((A + 1) // 0.08 + 1)
        for S in range(start, end):
            if int(S * 0.08) == A and int(S * 0.10) == B:
                return S
        return -1
    
getS(A, B)

Submission status: Wrong Answer

Solution code:
import numpy as np
import math
s = input().split()
A = int(s[0])
B = int(s[1])
x_A = math.ceil(100/8*A)
x_B = math.ceil(10*B)
if x_A>x_B and A<= x_A*0.08 and x_A*0.08<A+1 and 10*B<=x_B and x_B<10*B+10:
  print(x_A)
elif x_A<=x_B and A<= x_A*0.08 and x_A*0.08<A+1 and 10*B<=x_B and x_B<10*B+10:
  print(x_B)
else:
  print('-1')

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

else:
    print(-1)

Submission status: Wrong Answer

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

    a_ans = [i for i in range(int(a/0.08), int((a+1)/0.08))]
    b_ans = [j for j in range(int(b/0.1), int((b+1)/0.1))]

    ans = set(a_ans) & set(b_ans)

    if ans == set():
        print(-1)
    else:
        print(min(ans))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def calc_list(X, z):

  root = int(X * (100 / z))
  origin = root
  l = [root]
  while True:
    if int((root + 1) * (z / 100)) == X:
      l.append(root + 1)
      root += 1
    else: break
  
  root = origin

  while True:
    if int((root - 1) * (z / 100)) == X:
      l.append(root - 1)
      root -= 1
    else: break

  return set(l)

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

# 8%でA円になる金額を求める
a = calc_list(A, 8)

# 10%でB円になる金額を求める
b = calc_list(B, 10)

# 一致しているものがあればその金額、なければ-1を出力する
c = a & b
if len(c) > 0:
  c = list(c)
  list(c).sort()
  print(int(c[0]))
else:
  print(-1)

Submission status: Wrong Answer

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

judge = int(d / 0.1)
tax8 = int(c / 0.08)

flag = True

while judge <= tax8 and int(judge*0.1)==d:
  if int(int(judge*0.08) == c) and (int(judge*0.1) == d):
    print(judge)
    flag = False
    break
  else:
    judge += 1

if flag:
    print("-1")

Submission status: Wrong Answer

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

a_list = []
b_list = []

tmp_a = A
tmp_b = B

while tmp_a < A+1 and tmp_b < B+1:
    a_list.append(int(tmp_a / 0.08))
    b_list.append(int(tmp_b / 0.1))

    tmp_a += 0.1
    tmp_b += 0.1

for i in a_list:
    for j in b_list:
        if i == j:
            print(i)
            exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math

A, B = list(map(int, input().split()))
x_minA = math.ceil(100 / 8 * A)
x_minB =  10 * B
x_maxA = math.floor(100 / 8 * (A+1))
x_maxB = 10 * (B+1)
if x_minA > x_maxB or x_minB > x_maxA:
  print(-1)
else:
  x = max(x_minA, x_minB)
  while (x * 8 / 100 - A >= 1) and (x / 10 - B >= 1):
    print(x, x * 8 / 100, x / 10)
    x += 1
  print(x)

Submission status: Wrong Answer

Solution code:
import math
A,B= map(int,input().split())
min_x = math.ceil(max(A/8,B/10)*100)
max_x = (min((A+1)/8,(B+1)/10)*100)

if max_x-min_x>=0:
    ans = min_x
else:
    ans = -1
print(ans)

Submission status: Wrong Answer

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

x_min = A * 12.5
if x_min.is_integer:
  x_min = int(x_min)
else:
  x_min = int(x_min) + 1

ans = -1
n = x_min
while True:
  if int(n * 0.08) != A:
    break
  if int(n * 0.1) == B:
    ans = n
    break
  n += 1

print(ans)

Submission status: Wrong Answer

Solution code:
AB = input().split(' ')
A = int(AB[0])
B = int(AB[1])
predictA = round(A/0.08)
staA =predictA
if predictA < A/0.08:
    staA += 1
predict_maxA = round((A+1)/0.08)
if predict_maxA < (A+1)/0.08:
    predict_maxA += 1
predictB = B*10
predict_maxB = (B+1)*10
preA = [x for x in range(predictA,predict_maxA)]
preB = [x for x in range(predictB,predict_maxB)]
pre = preA + preB
res = [x for x in set(pre) if pre.count(x) > 1]
if len(res)>0:
    print(min(res))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
import math
input = sys.stdin.readline

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

for i in range(1000):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        exit()

print("-1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x1 = (25*a)//2
x2 = 10*b

p = []

if (8*x1)//100==a and (10*x1)//100==b:
    p.append(x1)
elif (8*x2)//100==a and (10*x2)//100==b:
    p.append(x2)

if len(p)!=0 and min(p)>0:
    print(min(p))
else:
    print(-1)

Submission status: Wrong Answer

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

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

x1 = a / 0.08

x2 = b / 0.1

r = max(x1, x2)
if int(r * 0.1) == b and int(r * 0.08) == a:
    print(int(r))
else:
    print(-1)

Submission status: Wrong Answer

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

p1 = int(a*100//8)
p2 = int(b*100//10)
#print(p1, p2)
for x in range(p2, p1+1):
    A = int(x*.08)
    B = int(x*.1)
    #print(x, A, B)
    if a==A and b==B:
        print(x)
        exit()
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)

print(x)
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:
from math import floor
A, B = map(int, input().split())
al = [floor(A*100/8)]
bl = [floor(B*10)]
while True:
    a = floor((al[-1] + 1) * 0.08)
    if a > A:
        break
    al.append(al[-1]+1)
while True:
    b = floor((bl[-1] + 1) * 0.08)
    if b > B:
        break
    bl.append(bl[-1]+1)
c = set(al) & set(bl)
if c:
    print(min(c))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
N=0
flag=0
while N<=100 and flag==0:
  N += 1
  a = math.floor(N * 0.08)
  b = math.floor(N * 0.1)
  #print(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())
x=a/0.08
y=b/0.10
print(x,y)

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:
import math
A,B=map(int,input().split())
nazos=9*B
if math.floor(nazos*0.08)==A:
  print(nazos)
else:
  while True:
    nazos+=1
    if math.floor(nazos*0.08)==A:
      print(nazos)
      break
    if nazos>1000:
      print(-1)
      break

Submission status: Wrong Answer

Solution code:

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

for i in range(10):
    if b / 0.1 + i == int(a / 0.08):
        print(int(a / 0.08))
        exit()

print(int(-1))

Submission status: Wrong Answer

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

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

# print(kensyo)

if kensyo:
  print(int(int(num[0]) / 0.08))
else:
  print(-1)

Submission status: Wrong Answer

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

prca = math.ceil(a / 0.08)
prcb = math.ceil(b / 0.1)
base = max(prca, prcb)

while True:
    if int(base * 0.08) < a or int(base * 0.1) < b:
        ans = base - 1
        break
    base -= 1

if int(ans * 0.08) != a or int(ans * 0.1) != b:
    ans = -1
    
print(ans)

Submission status: Wrong Answer

Solution code:
def calc_list(X, z):

  root = int(X * (100 / z))
  origin = root
  l = [root]
  while True:
    if int((root + 1) * (z / 100)) == X:
      l.append(root + 1)
      root += 1
    else: break
  
  root = origin

  while True:
    if int((root - 1) * (z / 100)) == X:
      l.append(root - 1)
      root -= 1
    else: break

  return set(l)

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

# 8%でA円になる金額を求める
a = calc_list(A, 8)

# 10%でB円になる金額を求める
b = calc_list(B, 10)

print(a, b)

# 一致しているものがあればその金額、なければ-1を出力する
c = a & b
if len(c) > 0:
  c = list(c)
  list(c).sort()
  print(int(c[0]))
else:
  print(-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(1, 101):
              tax10 = math.floor(j* 0.10)
              if tax10 == b:
                  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())

a_1 = math.ceil(a/0.08)
a_2 = math.ceil((a+1)/0.08)
b_1 = b * 10
b_2 = (b+1) * 10

if a_1 >=b_2 or b_1 >= a_2:
    print(-1)
else:
    print(min(a_1,b_1))

Submission status: Wrong Answer

Solution code:
import math

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


ARangemin = math.ceil(A * (100/8))
BRangemin = math.ceil(B * (100/10))

ARangemax = ARangemin
BRangemax = BRangemin
while int(ARangemax * 0.08) == A:
    ARangemax = ARangemax + 1
while int(BRangemax* 0.10) == B:
    BRangemax = BRangemax + 1
ARangemax = ARangemax -1
BRangemax = BRangemax -1

if ARangemax > BRangemin or ARangemin > BRangemax:
    if ARangemin > BRangemin:
        print(ARangemin)
    else:
        print(BRangemin)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B = [int(i) for i in input().split()]
emax = (A + 1) / 0.08
emin = A / 0.08
tmax = (B + 1) / 0.1
tmin = B / 0.1

if emin < tmax and emin >= tmin:
    print(int(emin))
elif tmin < emax and tmin >= emin:
    print(int(tmin))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
x,y = map(int,input().split())
a=int(x/0.08)
b=int((x+1)/0.08)
xx=[i for i in range(a,b+1)]
c=int(y/0.1)
d=int((y+1)/0.1)
yy=[i for i in range(c,d)]
sx=set(xx)
sy=set(yy)
Q=list(sx&sy)
if len(Q)==0:
  print(-1)
else:
  print(Q[0])

Submission status: Wrong Answer

Solution code:
#coding utf-8

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

x=A/0.08
y=B/0.1

if int(max(x,y)*0.08)==A:
  if int(max(x,y)*0.1)==B:
    print(int(max(x,y)))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

a,b = map(int,input().split())
t8 = math.floor(a/0.08)
t1 = math.floor(b/0.1)
mymin = min(t8,t1)
mymax = max(t8,t1)
flag = -1

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

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 a == b:
            ans.append(int(a))
print(min(ans)) if ans else print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

lsta = list(range(int(12.5*A), math.ceil((A+1)*12.5)))

ans = -1

for i in lsta:
    if int(i*0.1)==B:
        ans=i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil

a, b = tuple(map(int, input().split()))
min_a = ceil(a / 0.08)
max_a = ceil((a + 1) / 0.08)
min_b = ceil(b / 0.1)
max_b = ceil((b + 1) / 0.1)

if max_a <= min_b:
    print(-1)
else:
    print(max(min_a, min_b))

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
ans = -1
N = math.floor(A/0.08)
for i in range(1,N+1):
    if math.floor(0.08*i) == A and math.floor(0.10*i) == B:
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
miA=-(-A//0.08)
maA=-(-(A+1)//0.08)-1
miB=-(-B//0.1)
maB=-(-(B+1)//0.1)-1
if max(miA,miB)<=maA and max(miA,miB)<=maB:
  print(max(miA,miB))
else:
  print(-1)

Submission status: Wrong Answer

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

import math

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

tax8 = 12.5
tax10 = 10

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

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

if x == b:
    print(price8)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
A=set([i for i in range((a*25)//2,((a+1)*25)//2)])
B=set([i for i in range((b*10),((b+1)*10))])
x=list(A&B)
if x:
    print(min(x))
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)]
BBB = [i for i in range(BB,(B+1)*10)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list else -1
print(ans)

Submission status: Wrong Answer

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

a, b = MAP()

# x = a * 0.92
# y = b / 0.90
# print(x, y)
x1 = a / 0.08
y1 = b /0.1
x2 = (a+1) / 0.08
y2 = (b+1) /0.1

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

Submission status: Wrong Answer

Solution code:
import math

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

tax008 = [(a / 0.08), ((a + 1) / 0.08)]
tax010 = [(b / 0.1), ((b + 1) / 0.1)]
min_value = math.ceil(max(tax008[0], tax010[0]))
max_value = math.floor(min(tax008[1], tax010[1]))
if min_value > max_value:
    print(-1)
else:
    print(min_value)

Submission status: Wrong Answer

Solution code:
from sys import stdin


def spam(x, AB, per):
    min_ = x
    max_ = x
    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(' '))

result = -1
for i in range(1, 10000 + 1):
  if i * 0.08 == a:
    if b * 10 == i or (b + 0.5) * 10 == i:
      result = i
      
print(result)

Submission status: Wrong Answer

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

def no_tax(tax,tax_r):
    origin,min,max = 0,0,0
    while int(origin*tax_r) < tax:
        origin += 1
    min = origin
    while int(origin*tax_r) <= tax:
        origin += 1
    max = origin-1
    return (min,max)

A_min,A_max,B_min,B_max = \
no_tax(A,0.08)[0],no_tax(A,0.08)[1],no_tax(B,0.1)[0],no_tax(B,0.1)[1]

if A_min <= B_max and A_min <= 100:
    print(A_min)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
aa=[]
bb=[]
for a in range(A*10,(A+1)*10):
    aa.append(a/10/0.08)
for b in  range(B*10,(B++1)*10):
    bb.append(b/10/0.1)
l=list(set(aa)&set(bb))
l.sort()
if l:
    print(int(l[0]))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

for n in range(0, 10):
  x = (A + n/10) / 0.08
  if math.floor(x * 0.1) == B:
    print(int(x))
    exit()
print("-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:
                  ans = i
                  flag = True
                  break
        if flag:
            break
    else:
        ans = -1
    
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

# print(ansA,ansB)
# print(int(ansA*0.08))
# print(int(ansA*0.10))
if 0<=ansA-ansB and ansA-ansB<12.5 and ((int(ansA*0.08)==A and int(ansA*0.10)==B) or (int(ansB*0.08)==A and int(ansB*0.10)==B)):
    print(int(max(ansA,ansB)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
ax = a*12.5
bx = b*10
if ax==bx :
    print(bx)
else:
    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}")

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

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
a1=math.ceil(a/0.08)
a2=math.floor((a+1)/0.08)
A=set([i for i in range(a1,a2)])
b1=math.ceil(b/0.1)
b2=math.floor((b+1)/0.1)
B=set([i for  i in range(b1,b2)])
print(A)
print(B)
if A&B==set(): 
    print(-1)
    exit()

print(min(A & B))

Submission status: Wrong Answer

Solution code:
def main():
  a,b=map(int,input().split())
  for i in range(-int(-a/0.08),-int(-(a+1)/0.08)):
    if int(i*0.1)==b:
      return i
  return -1
print(main())

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
a=math.ceil(A/0.08)
list=[]
count=0
while (a+count)*0.08==A:
    list.append(a+count)
    count+=1
suuji=0

for b in list:
    if math.floor(b*0.1)==B:
        print(b)
        break
    else:
        suuji+=1
if suuji==len(list):
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
tmp = range(int(y/0.1), int((y+1)/0.1))
ans=-1
for i in range(int(x/0.08), int((x+1)/0.08)):
    if i in tmp:
        ans=i
        break
print(ans)

Submission status: Wrong Answer

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

x = a * 100 / 8
y = (a+1) * 100 / 8
z = b * 100 / 10
w = (b+1) * 100 / 10
    
if z <= x and x <= w and w <= y:
    print(int(x))
elif x <= z and z <= y and y <= w:
    print(int(z))
else:
    print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
i = list(map(int,input().split()))
a = i[0]*100//8
b = i[1]*100//10
if -10 < a-b and a-b < 10:
  if a>b:
    print(a)
  else:
    print(b)
else:
  print(-1)

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 = 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:
import math
A, B = map(int, input().split())
flag = math.floor(A/0.08)
flag2 = math.floor(B/0.1)
if math.floor(flag*0.1)==B:
  print(flag)
elif math.floor(flag2*0.08)==A:
  print(flag2)
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)]
    B_cand = [i for i in range(v_B, v_B2)]
    
    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:
import math

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

res1 = math.floor(a / 0.08)

if math.floor(res1 * 0.08) != a:
    res1 += 1

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

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
a1=int(A/0.08)
a2=int((A+1)/0.08)
b1=int(B/0.1)
b2=int((B+1)/0.1)
a=[]
b=[]
for i in range(a1,a2+1):
    s=i
    a.append(s)
for i in range(b1,b2+1):
    t=i
    b.append(t)
#print(a)
#print(b)
if max(a)<min(b):
    print(-1)
elif max(b)<min(a):
    print(-1)
elif min(a)>=min(b):
    print(min(a))
else:
    print(min(b))

Submission status: Wrong Answer

Solution code:
import sys
from math import floor

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


A, B = map(int, input().split())
let1 = floor(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+1)])
sel = select1 & select2
if sel == set():
	print(-1)
else:
	print(min(sel))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# @Time    : 2020/3/1 19:59
# @Author  : DIRICHLET
# @File    : main.py
a=[]
def myin(fun=int):
    global a
    a=list(map(fun,input().split()))
#myin(int)
a,b=map(int,input().split())
oner=(a+1)/0.08
if a%2==0:
    oner=round((a+1)/2*25)+1
    onel=a//2*25
else:
    oner=(a+1)/2*25
    onel=round(a/2*25)+1
#*25/2
twol=b*10
if oner>twol:
    if onel<=twol:
        print(twol)
    else:
        print(onel)
else:
    print(-1)
#print(a)
#[25,37.5) [20,30)
#[19-20) [99-100) 99.5-18.5=81/0.02=4050
#(231.35,243.75] (985,995]
#

Submission status: Wrong Answer

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

number1 = int(A*100/8)
number2 = int(B*100/10)
if number1/1 == number1//1:
    number1 = number1//1 + 1
if number2/1 == number2//1:
    number2 = number2//1 + 1

if number1//10 == B:
    if number2*8//100 == A:
        if number1 <= number2:
            print(number1)
        else:
            print(number2)
    else:
        print(number1)
else:
    if number2*8//100 == A:
        print(number2)
    else:
        print(-1)

Submission status: Wrong Answer

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

x, y = math.floor(a/0.08), math.floor(b/0.1)

if math.floor(x*0.08) == a and math.floor(x*0.1) == b:
    print(x)
elif math.floor(y*0.08) == a and math.floor(y*0.1) == b:
    print(y)
else:
    print(-1)

Submission status: Wrong Answer

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

a = math.ceil(A/0.08)
b = math.ceil(B/0.1)
a2 = math.ceil((A+1)/0.08)
b2 = math.ceil((B+1)/0.1)
ans = max(a,b)
if a > b:
    if a > b2:
        ans = -1
else:
    if b > a2:
        ans = -1
print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
A=[]
B=[]
for i in range(9):
  A.append(a+i/10)
  B.append(b+i/10)
for i in range(len(A)):
  A[i]=A[i]/0.08
  B[i]=B[i]/0.1
ans=[]
for i in range(len(A)):
  for j in range(len(A)):
    if round(A[i],2)==round(B[j],2):
      ans.append(A[i])
      break
A.sort()
if ans==[]:
  print(-1)
else:
  print(int(ans[0]))

Submission status: Wrong Answer

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

if(a*0.1 < b*0.08):
    print(-1)
    exit()

a1 = a/0.08
b1 = b/0.1
#print(a1)
#print(b1)
if((10*a1)%10 != 0):
    a1 = int(a/0.08)+1

if((10*b1)%10 != 0):
    b1 = int(b/0.08)+1

print(int(a1))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
a_min = A/0.08
a_max = (A+1)/0.08

result = -1
for i in range(int(a_min), int(a_max)+1):
    if round(i*0.1) == B:
        result = i
        break
print(result)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
min_8=int(A*(100/8))
max_8=int((A+1)*(100/8))
min_10=int(B*10)
max_10=int((B+1)*10)
if A > B:
    print("-1")
else:
    if max_8 > min_10:
        if min_8 > min_10:
            print(min_8)
        else:
            print(min_10)
    else:
        print("-1")

Submission status: Wrong Answer

Solution code:
import math
a, b =(int(x) for x in input().split())

ans = 0
while ans <= 100:
    ans += 1
    if math.floor(ans * 0.08) == a and  math.floor(ans * 0.1) == b:
        print(ans)
        exit()
print('-1')

Submission status: Wrong Answer

Solution code:
import numpy as np
import math
s = input().split()
A = int(s[0])
B = int(s[1])
x_A = math.ceil(100/8*A)
x_B = math.ceil(10*B)
if x_A>x_B and A<= x_A*0.08 and x_A*0.08<A+1 and 10*B<x_B and x_B<10*B+10:
  print(x_A)
elif x_A<=x_B and A<= x_A*0.08 and x_A*0.08<A+1 and 10*B<x_B and x_B<10*B+10:
  print(x_B)
else:
  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 = min(X,Y)

    if(round(C*0.08)==A and round(C*0.1)==B):
        print(C)
    else:
        print(-1)
else:
    print(-1)