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(" "))
list_a = [i for i in range(round(a/0.08+0.5), round((a+1)/0.08 +0.5))]
list_b = [i for i in range(round(b/0.1 +0.5),round((b+1)/0.1 +0.5))]
list_and = list(set(list_a) & set(list_b))
if list_and == []:
    print("-1")
else:
    print(min(list_and))

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split(" "))
list_a = [i for i in range(int(a/0.08), round((a+1)/0.08 +0.5))]
list_b = [i for i in range(int(b/0.1),round((b+1)/0.1 +0.5))]
list_and = list(set(list_a) & set(list_b))
if list_and == []:
    print("-1")
else:
    print(min(list_and))

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split(" "))
list_a = [i for i in range(int(a/0.08)+1,int((a+1)/0.08-1)+1)]
list_b = [i for i in range(int(b/0.1)+1,int((b+1)/0.1-1)+1)]
list_and = list(set(list_a) & set(list_b))
if list_and == []:
    print("-1")
else:
    print(min(list_and))

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
f=-1
for i in range(1,1000):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        f=i
        break;
print(f)

Submission status: Wrong Answer

Solution code:
import math

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

A_low = math.ceil(a * 12.5)
B_low = math.ceil(b * 10)
A_high = math.floor((a+1) * 12.5)
B_high = math.floor((b+1) * 12.5)

if B_high < A_low or A_high < B_low:
    print(-1)
else:
    print(A_low)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
tax8=a/2*25
tax8l=(a-1)/2*25
tax8h=(a+1)/2*25
tax10=float(b*10)
tax10l=float((b-1)*10)
tax10h=float((b+1)*10)

if tax10>tax8l and tax10<tax8h and tax8>tax10l and tax8<tax10h:
    if tax8>tax10:
        if tax8>int(tax8):
            if int(tax8+1)<tax10h:
                print(int(tax8+1))
            else:
                print(-1)
        else:
            print(int(tax8))
    else:
        print(max(int(tax8),int(tax10)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

a,b = input().split()

a = int(a)
b = int(b)

A_low = math.ceil(a * 12.5)
B_high = math.floor((b+1) * 12.5)

if B_high < A_low:
    print(-1)
else:
    print(A_low)

Submission status: Wrong Answer

Solution code:
import math
 
a,b = input().split()
a = int(a)
b = int(b)
 
B_low = math.ceil(b * 10)
A_high = math.floor((a+1) * 12.5)
 
if A_high < B_low:
    print(-1)
else:
    print(B_low)

Submission status: Wrong Answer

Solution code:
import math

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

B_low = math.ceil(b * 10)
A_high = math.floor((a+1) * 12.5)

if A_high < B_low:
    print('-1')
else:
    print(B_low)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
tax8=a/2*25
tax8l=(a-1)/2*25
tax8h=(a+1)/2*25
tax10=float(b*10)
tax10l=float((b-1)*10)
tax10h=float((b+1)*10)
if tax10>tax8l and tax10<tax8h and tax8>tax10l and tax8<tax10h:
    if max(tax8,tax10)>max(int(tax8),int(tax10)):
        print(max(int(tax8+1),int(tax10+1)))
    else:
        print(max(int(tax8),int(tax10)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

a,b = input().split()

a = int(a)
b = int(b)

B_low = math.ceil(b * 10)
A_high = math.floor((a+1) * 12.5)

if A_high < B_low:
    print('-1')
else:
    print('B_low')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
tax8=a/2*25
tax8l=(a-1)/2*25
tax8h=(a+1)/2*25
tax10=float(b*10)
tax10l=float((b-1)*10)
tax10h=float((b+1)*10)
if tax10>tax8l and tax10<tax8h and tax8>tax10l and tax8<tax10h:
    print(max(int(tax8),int(tax10)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
x=0
a=int(round(100/8*a,0))
b=int(round(10*b,0))
if a==b:
	x=10*b
	print(x)
else:
  print('-1')

Submission status: Wrong Answer

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from functools import *
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def Golf():
    *a,=map(int,open(0))
def S_():
    return input()
def IS():
    return input().split()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0}):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[1]*(w+2)
    found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[1]+[mp_def[j] for j in s]+[1]
    mp+=[1]*(w+2)
    return h+2,w+2,mp,found
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['YES','NO']
Yn=['Yes','No']
 
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
#ts=time.time()
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()
 
def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

ans=0

a,b=LI()
for i in range(1,10**6):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        break

Submission status: Wrong Answer

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

N_A = A / 0.08
N_B = B / 0.1

A_list = [int(N_A+i) for i in range(20) if A <= int((N_A+i)*0.08) < A+1]
B_list = [int(N_B+i) for i in range(15) if B <= int((N_B+i)*0.1) < B+1]

N_min = float('inf')
for i in A_list:
    if i in B_list and i < N_min:
        N_min = i

if N_min == float('inf'):
    print(-1)
else:
    print(N_min)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
a_min = math.ceil(a / 0.08)
a_max = math.floor((a + 1) / 0.08)
b_min = math.ceil(b / 0.1)
b_max = math.floor((b + 1) / 0.1)

if a_max < b_min or b_max < a_min:
  print('-1')
else:
  result = b_min if a_min <= b_min else a_min
  print(result)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
a_min = math.ceil(a / 0.08)
a_max = math.floor((a + 1) / 0.08)
b_min = math.ceil(b / 0.1)
b_max = math.floor((b + 1) / 0.1)

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

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
a_min = math.ceil(a / 0.08)
a_max = math.floor((a + 1) / 0.08)
b_min = math.ceil(b / 0.1)
b_max = math.floor((b + 1) / 0.1)

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

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
a_min = math.ceil(a / 0.08)
a_max = math.floor((a + 1) / 0.08)
b_min = math.ceil(b / 0.1)
b_max = math.floor((b + 1) / 0.1)

if a_max < b_min or b_min < a_max:
  print(-1)
else:
  result = b_min if a_min < b_min else a_min
  print(result)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
ans = []
for i in range(1, 101):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans.append(i)
print(-1 if not ans else min(ans))

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
i=0
while i<10000:
  i+=1
  if i//100*8==a and i//100*10==b:
    print(i)
  break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
i=0
while i<10000:
  i+=1
  if i//100*8==a and i//100*10==b:
    print(i)
    break
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
i=0
while i<10000:
  i+=1
  if i//100*8==a and i//100*10==b:
    print(i)
else:
  print(-1)

Submission status: Wrong Answer

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

i = -1
for i in range(1, 10001):
  if i * 8 // 100 == a:
    if i * 10 // 100 == b:
      break
      
print(i)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
if 100*a//8+100*a%8 == 100*b//10+100*b%10:
  print(100*a//8+100*a%8)
else:
  print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
tax = [3, 3]
tax_8 = int(tax[0])
tax_10 = int(tax[1])

price_8 = [math.ceil(tax_8*(100/8)), math.ceil((tax_8+1)*(100/8))-1]
price_10 = [math.ceil(tax_10*(10)), math.ceil((tax_10+1)*(10))-1]
if(min(price_8[1], price_10[1]) < max(price_8[0], price_10[0])):
    print(-1)
else:
    print(max(price_8[0], price_10[0]))

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), int((N[0]+1)*(1/0.08)))]
Y = [i for i in range(int(N[1]*(1/0.10)), int((N[1]+1)*(1/0.10)))]
#print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), int((N[0]+1)*(1/0.07)))]
Y = [i for i in range(int(N[1]*(1/0.10)), int((N[1]+1)*(1/0.09)))]
#print(X, Y)
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))
X = [i for i in range(int(N[0]*(1/0.08)), int(N[0]*(1/0.07)))]
Y = [i for i in range(int(N[1]*(1/0.10)), int(N[1]*(1/0.09)))]
cand = set(X) & set(Y)
if len(cand) == 0:
  print(-1)
else:
  print(min(cand))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
j = False
for i in range(1, 1009):
  if int(i * 0.08) == A and int(i * 0.1) == B:
    j = True
    break
if j:
  print(int(A/0.08))
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)
j = False
if A_ == B_:
  print(A_)
else:
  if A_ < B_:
    A_ += abs(A_ - B_)
  elif A_ > B_:
    B_ += abs(A_ - B_)
  if int(A_ * 0.08) == A and int(B_ * 0.1) == B:
    print(A_)
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B = [int(i) for i in input().rstrip().split()]
Aa = A/0.08
Ba = B/0.1
round=lambda x:int((x*2+1)//2)
N = round(max(Aa,Ba))

def ch(n):
    global A,B
    print(int(n * 0.08), A, int(n * 0.1), B)
    if int(n * 0.08) == A and int(n * 0.1) == B:
        return True
    else:
        return False

if ch(N-1):
    print(N-1)
elif ch(N):
    print(N)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B = list(map(int,input().split()))
def problem_gksn(A, B):
  x_min = math.ceil(A / (0.08))
  x_max = math.floor((A+1)/0.08)
  y_min = math.ceil(B / (0.10))
  y_max = math.floor((B+1) / (0.10))
  if max(x_min, y_min) <= min(x_max, y_max):
    return max(x_min, y_min)
  else:
    return -1
print(problem_gksn(A,B))

Submission status: Wrong Answer

Solution code:
import math
A,B = list(map(int,input().split()))
def problem_gksn(A, B):
  x_min = math.ceil(A / (0.08))
  x_max = math.floor((A+1)/0.08)
  y_min = math.ceil(B / (0.10))
  y_max = math.floor((B+1) / (0.10))
  # print(x_min,x_max,y_min,y_max)
  if max(x_min, y_min) <= min(x_max, y_max):
    return max(x_min, y_min)
  else:
    return -1
print(problem_gksn(A,B))

Submission status: Wrong Answer

Solution code:
import math
A,B = list(map(int,input().split()))
def problem_gksn(A, B):
  x_min = A / (0.08)
  x_max = (A+1)/0.08
  y_min = B / (0.10)
  y_max = (B+1) / (0.10)
  # print(x_min,x_max,y_min,y_max)
  if max(x_min, y_min) <= min(x_max, y_max):
    return math.ceil(max(x_min, y_min))
  else:
    return -1
print(problem_gksn(A,B))

Submission status: Wrong Answer

Solution code:
import math
A ,B = list(map(int,input().split()))
 
def problem_koganemaru(A,B):  
  for price in range(10000):
    if math.ceil(price*0.08) == A and math.ceil(price*0.1) == B:
      return price
  return -1
 
print(problem_koganemaru(A,B))

Submission status: Wrong Answer

Solution code:
import math

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

A_min = int(math.ceil(A/0.08))
A_max = int(math.floor((A+1)/0.08))

B_min = int(math.ceil(B/0.1))
B_max = int(math.floor((B+1)/0.1))


A_list = list(range(A_min,A_max+1))
B_list = list(range(B_min,B_max+1))

ans_list = list(set(A_list) & set(B_list))

if len(ans_list) > 1:
  print(min(ans_list))
elif len(ans_list) == 0:
  print(-1)
else:
  print(ans_list[0])

Submission status: Wrong Answer

Solution code:
import math

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

A_min = int(math.ceil(A/0.08))
A_max = int(math.floor((A+1)/0.08))

B_min = int(math.ceil(B/0.1))
B_max = int(math.floor((B+1)/0.1))


A_list = list(range(A_min,A_max+1))
B_list = list(range(B_min,B_max+1))

ans_list = list(set(A_list) & set(B_list))

if len(ans_list) > 1:
  print(min(ans_list))
elif len(ans_list) == 0:
  print(-1)
else:
  print(min(ans_list))

Submission status: Wrong Answer

Solution code:
import math

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

A_min = int(math.ceil(A/0.08))
A_max = int(math.floor(A+1)/0.08)

B_min = int(math.ceil(B/0.1))
B_max = int(math.floor(B+1)/0.1)


A_list = list(range(A_min,A_max+1))
B_list = list(range(B_min,B_max+1))

ans_list = list(set(A_list) & set(B_list))

if len(ans_list) > 1:
  print(min(ans_list))
elif len(ans_list) == 0:
  print(-1)
else:
  print(min(ans_list))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
for i in range(1,1009):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(int(i))
        break
print("-1")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
for i in range(1,1009):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(int(i))
print("-1")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
for i in range(909,1009):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(int(i))
print("-1")

Submission status: Wrong Answer

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

x = max((A*100+7)//8, B*100/10)
y = min((A+1)*100/8, (B+1)*100/10)

if x <= y:
    ans = x
else:
    ans = -1

print(ans)

Submission status: Wrong Answer

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

x = max((A*100+7)//8, B*100/10)
y = min((A+1)*100/8, (B+1)*100/10)

if x < y:
    ans = x
else:
    ans = -1

print(ans)

Submission status: Wrong Answer

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

x = max(A*100//8, B*100//10)
y = min((A+1)*100//8, (B+1)*100//10)

if x < y:
    ans = x
else:
    ans = -1

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
flag = True
for i in range(101):
    t1 = i*1.08
    t2 = i*1.10
    if int(t1-i) == a and int(t2-i) == b:
        print(i)
        flag = False
        break
if flag:
    print(-1)

Submission status: Wrong Answer

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

x = max(A*100//8, B*100//10)
y = min((A+1)*100//8, (B+1)*100//10)

if x <= y:
    ans = x
else:
    ans = -1

print(ans)

Submission status: Wrong Answer

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

x = max(A*8//100, B*10//100)
y = min((A+1)*8//100, (B+1)*10//100)

if x <= y:
    ans = x
else:
    ans = -1

print(ans)

Submission status: Wrong Answer

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

ans = -1
if A // 0.08 == B // 0.1:
    ans = A // 0.08

print(ans)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
x = math.ceil((100*a+10*b)/9)
if int(x*0.08) == a and int(x*0.1) == b:
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
for i in range(1,112):
    if(int(i*0.08) == a and int(i*0.10) == b):
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
A,B = input().split()
k = int(max(int(A)/(0.08), int(B)/(0.1)))
if int(k * 0.08) == int(A) and int(k*0.1) == int(B):
    print(k)
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
a, b = (int(x) for x in input().split())
aa = int(min(a / 0.08, b/0.1))
bb = int(max(a / 0.08, b/0.1))
ans = -1
for c in range(aa, bb + 1):
    if int(c*0.08) == a and int(c*0.1) == b:
        ans = c
        break
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = input().split()
k = int(max(int(A)/(0.08), int(B)/(0.1)))
if k * 0.08 == int(A) and k*0.1 == int(B):
    print(k)
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
A,B = input().split()
print(int(max(int(A)/(0.08), int(B)/(0.1))))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
z,x,c,v=10*b,10*b+10-1,50*a//4,50*(a+1)//4-1
if not len(range(max(z,c),min(x,v)+1)):print(-1)
else:print(max(z,c))

Submission status: Wrong Answer

Solution code:
from math import ceil, floor

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

x8min = ceil(A / 0.08) # 8%でA円になる最小値
x8max = floor((A + 1) / 0.08) # 8%でA円になるのは、これ未満
x10min = ceil(B / 0.1) # 10%でB円になる最小値
x10max = floor((B + 1) / 0.1) # 10%でB円になるのは、これ未満

if x10min > x8max:
    print('-1')
elif x10min >= x8min:
    print(str(x10min))
else: # x10min < x8min の場合
    if x10max < x8min:
        print('-1')
    else:
        print(str(x8min))

Submission status: Wrong Answer

Solution code:
import math

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

m, r = divmod( (a*(10/100)) ,  (8/100) )

if (m != b): print("-1")
else:
    p = a / (8/100)
    print(int(p))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
z,x,c,v=10*b,10*b+10-1,50*a//4,50*(a+1)//4-1
if x<c or v<z:print(-1)
else:print(max(z,c))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
z,x,c,v=10*b,10*b+10-1,50*a//4,50*(a+1)//4-1
if x<c or v<z:print(-1)
else:print(min(z,c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,1010):
	ia=int(i*0.1)
	ib=int(i*0.08)
	if ia==a and ib==b:
		print (i)
		exit()
else:
	print (-1)

Submission status: Wrong Answer

Solution code:
tax = [int(n) for n in input().split()]

max_8tax = (tax[0]+1) / .08
min_8tax = int((tax[0]) / .08)
max_10tax = int((tax[1]+1) / .1) - 1
min_10tax = int((tax[1]) / .1)

r = -1

for i in range(min_10tax, max_10tax):
    if min_8tax <= i and i < max_8tax:
        r = i
        break

print(r)

Submission status: Wrong Answer

Solution code:
tax = [int(n) for n in input().split()]

max_8tax = (tax[0]+1) / .08
if max_8tax == int(max_8tax):
    max_8tax -= 1
min_8tax = int((tax[0]) / .08)
max_10tax = int((tax[1]+1) / .1) - 1
min_10tax = int((tax[1]) / .1)

r = -1

for i in range(min_10tax, max_10tax):
    if min_8tax <= i and i <= max_8tax:
        r = i
        break

print(r)

Submission status: Wrong Answer

Solution code:
tax = [int(n) for n in input().split()]

max_8tax = (tax[0]+1) / .08
min_8tax = (tax[0]) / .08
max_10tax = int((tax[1]+1) / .1) - 1
min_10tax = int((tax[1]) / .1)

r = -1

#print(max_8tax, min_8tax)
#print(max_10tax, min_10tax)

for i in range(min_10tax, max_10tax):
    if min_8tax <= i and i <= max_8tax:
        r = i
        break

print(r)

Submission status: Wrong Answer

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

Alow = A*100//8
Ahi  = (A+1)*100//8

Blow = B*100//10
Bhi  = (B+1)*100//10

#print(Alow,Ahi,Blow,Bhi)

Aran = range(Alow,Ahi)
Bran = range(Blow,Bhi)
resRan = sorted(list(set(Aran) & set(Bran)))
#print(resRan)
if len(resRan) !=0:
  print(resRan[0])
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=(float(x) for x in input().split())
#print(a)
#print(b)

am=int(100./8.*a)
al=int(100./8.*(a+1.))
if (int(a+1.)%4)==0:
       al=al-1

bm=int(10.*b)
bl=int(10.*(b+1.))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=(float(x) for x in input().split())
#print(a)
#print(b)

am=int(100./8.*a)
al=int(100./8.*(a+1))
if ((a+1)%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=(float(x) for x in input().split())
#print(a)
#print(b)

am=int(100./8.*a)
al=int(100./8.*(a+1))
if ((a+1)%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al):
       for ib in range(bm,bl):
       		if ia==ib:
       			print (ia)
       			exit()
else:
  print(-1)

Submission status: Wrong Answer

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

am=int(100/8*a)
al=int(100/8*(a+1))
if ((a+1)%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al):
       for ib in range(bm,bl):
       		if ia==ib:
       			print (ia)
       			exit()
else:
  print(-1)

Submission status: Wrong Answer

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

am=int(100/8*a)
al=int(100/8*(a+1))
if ((a+1)%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
else:
  print(-1)

Submission status: Wrong Answer

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

am=int(100/8*a)
al=int(100/8*(a+1))
if (a%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
else:
  print(-1)

Submission status: Wrong Answer

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

am=int(100/8*a)
al=int(100/8*(a+1))
if (a%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
      
print (-1)

Submission status: Wrong Answer

Solution code:
import math
s = input().split(" ")
A = int(s[0])
B = int(s[1])

for i in range(101):
    e = math.floor(i * 0.08)
    t = math.floor(i * 0.1)

    if e == A and t == B:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
Aans=0
for i in range(13,10000):
  if int(i*0.08)==A:
    Aans=i
    break
Bans=0
for i in range(10,10000):
  if int(i*0.1)==B:
    Bans=i
    break

if Aans > Bans:
  if (int(Aans*0.1))==B:
    print(Aans)
  else:
    print("-1")
elif Aans < Bans:
  if (int(Bans*0.08))==A:
    print(Aans)
  else:
    print("-1")
else:
  print(Aans)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
x=int(A/0.08)
y=int(B/0.1)
if int(x*0.08)!=A:
    x+=1
if int(x*0.1)!=B:
    y+=1
eight=[i for i in range(x,1251) if int(i*0.08)==A]
ten=[i for i in range(y,1001) if int(i*0.1)==B]
eight_set=set(eight)
ten_set=set(ten)
ans_set=eight_set&ten_set
ans=list(ans_set)
if len(ans)>0:
    print(min(ans))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
A_ = int(A / 0.08)
B_ = int(B / 0.1)
j = False
if A_ == B_:
  print(A_)
else:
  for i in range(abs(A_ - B_)):
    if A_ > B_:
      B_ += 1
    elif A_ < B_:
      A_ += 1
    if A_ == B_:
      break
  if int(A_ * 0.08) == A and int(B_ * 0.1) == B:
    print(A_)
  else:
    print(-1)

Submission status: Wrong Answer

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

m = B * 10
M = B * 100
for i in range(m, M):
    if i * 8 // 100 == A:
        print(i)
        break
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)
j = False
if A_ == B_:
  print(int(A/0.08))
else:
  for i in range(abs(A_ - B_)):
    if A_ > B_:
      B_ += 1
    elif A_ < B_:
      A_ += 1
    if A_ == B_:
      break
  if int(A_ * 0.08) == int(B_ * 0.1):
    print(A_)
  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)
j = False
if A_ == B_:
  print(int(A/0.08))
else:
  for i in range(abs(A_ - B_)):
    if A_ > B_:
      B_ += 1
    elif A_ < B_:
      A_ += 1
    if int(A / 0.08) == int(B / 0.1):
      j = True
      break
  if j == True:
    print(B_)
  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)
j = False
if A_ == B_:
  print(int(A/0.08))
else:
  for i in range(abs(A_ - B_)):
    B_ += 1
    if A_ == B_:
      j = True
      break
  if j == True:
    print(B_)
  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)
j = False
if A_ == B_:
  print(int(A/0.08))
else:
  for i in range(abs(A_ - B_)):
    B_ += 1
    if A_ == B_:
      j = True
      break
if j == True:
  print(B_)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
import sys
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)
        sys.exit()

print(-1)

Submission status: Wrong Answer

Solution code:
import math
flag = 0
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:
        ans = i
        flag = 1
if flag == 1:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

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

print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

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

print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

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

print(-1)

Submission status: Wrong Answer

Solution code:
import math

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)
        break
print(-1)

Submission status: Wrong Answer

Solution code:
import math 

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

#Pseudo code also have to round to an int. Solving for befTax
befTaxA = math.floor(A / 0.08) 
befTaxB = math.floor(B / 0.10)

if befTaxB * 0.10 == B and befTaxA * 0.08 == A:
  print(max(befTaxA, befTaxB))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math 

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

#Pseudo code also have to round to an int. Solving for befTax
befTaxA = math.floor(A / 0.08) 
befTaxB = math.floor(B / 0.10)

if math.floor(befTaxB * 0.10) == B and math.floor(befTaxA * 0.08) == A:
  print(befTaxA)
else:
  print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input().split()
A = int(S[0])
B = int(S[1])
R = -1
for i in range(100):
  #print(i+1)
  j = i + 1
  AMTA = int(j * 0.08)
  AMTB = int(j * 0.1)
  if AMTA == A and AMTB == B:
    R = j
    break
  if AMTA > A and AMTB > B:
    break
print(R)

Submission status: Wrong Answer

Solution code:
A,B=[int(x) for x in input().split()]
a=-(-A//0.08)
b=-(-B//0.1)
print(int(a) if a//10 == b//10 else -1)

Submission status: Wrong Answer

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

#output
import math
p = math.ceil(max(A/0.08, B/0.1))
q = math.floor(min((A+1)/0.08, (B+1)/0.1))

answer = 0
if p <= q:
    answer = p
else:
    answer = -1

print(answer)

Submission status: Wrong Answer

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

#output
import math
p = int(max(A/0.08, B/0.1))
q = int(min((A+1)/0.08, (B+1)/0.1))

answer = 0
if p <= q:
    answer = p
else:
    answer = -1

print(answer)

Submission status: Wrong Answer

Solution code:
A,B=[int(x) for x in input().split()]
a=(A/0.08)
b=(B/0.1)
print(int(a) if a//10 == b//10 else -1)