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 .

Solution (Python):

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




maxA = A+1
maxB = B+1

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

gBmin = B*10
gBmax = maxB * 10






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

if ans - int(ans) > 0:
    ans = int(ans) + 1

print(int(ans))

Solution (Python):
import math

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

for i in range(10000):
  target_a = i * 0.08
  target_b = i * 0.1
  if math.floor(target_a) == A and math.floor(target_b) == B:
    print(i)
    exit()
  else:
    pass

print(-1)

Solution (Python):
ab = list(map(int, input().split())) 
a= ab[0]
b=ab[1]
 
x=[]
x.append(a/0.08)
x.append((a+1)/0.08)
x.append(b/0.1)
x.append((b+1)/0.1)
if x[0]<= x[2] and x[2]<x[1]:
    print(int(x[2]))
elif x[2]<= x[0] and x[0] < x[3]:
    if x[0]>int(x[0]):
        print(int(x[0])+1)
    else:
        print(int(x[0]))
else:
    print(-1)

Solution (Python):
import math

line = input().split(" ")

eight_tax = int(line[0])
ten_tax = int(line[1])

eight_side_price = math.ceil(eight_tax / 0.08)
ten_side_price = math.ceil(ten_tax / 0.1)

while(1):
    break_flg = 0
    for i in range(int(math.fabs(eight_side_price - ten_side_price)) + 1):
        target = eight_side_price if eight_side_price < ten_side_price else ten_side_price
        num = i + target
        if math.floor(num * 0.08) == eight_tax and math.floor(num * 0.1) == ten_tax:
            print(num)
            break_flg = 1

    if break_flg == 0:
        print("-1")
    break

Solution (Python):
ans=-1
nums=input().split(" ")
t8,t10=int(nums[0]),int(nums[1])
value=max(round(t8*100/8),round(t10*100/10))+1
for i in range(value):
  v=value-i
  tax8=v*8/100
  tax10=v*10/100
  if tax8>=t8 and tax8<t8+1 and tax10>=t10 and tax10<t10+1:
    ans=v
  elif tax8<t8 or tax10<t10:
    break
print(ans)

Solution (Python):
a, b=map(int,input().split())
a_t=a/0.08
a_t2=a_t+0.9/0.08
b_t=b/0.1
if b_t<=a_t2 and b_t>=a_t:
  print(int(b_t))
else:
  if b_t>a_t2 or b_t+9<a_t:
    print(-1)
  for k in range(9):
    b_t+=1
    if b_t<=a_t2 and b_t>=a_t:
      print(int(b_t))
      break

Solution (Python):
a,b=map(int,input().split())
val=b*10
huta=str(val)[-2]
while True:
    if str(val)[-2]!=huta:
        print(-1)
        break
    if int(val*0.08)==a:
        print(val)
        break
    val+=1

Solution (Python):
A,B = map(int,input().split())
PA = 1

while PA <= 1250:
    if PA*0.08 >= A:
        break
    else:
        PA += 1

if int(PA*0.1) == B:
    print(PA)

elif PA*0.1 >= B+1:
    print(-1)

else:
    while PA <= 1000:
        if PA*0.1 >= B:
            break
        else:
            PA +=1
    if int(PA*0.08) == A:
        print(PA)
    else:
        print(-1)

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

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

Solution (Python):


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

a_koho = int(A/0.08)
b_koho = int(A/0.1)



if a_koho == b_koho:
    
    exit()

start = min(a_koho,b_koho)
end = max(a_koho,b_koho)

for i in range(start-100,end+1+100):
    if i < 1:
        continue

    a = int(i*0.08)
    b = int(i*0.1)

    

    if a == A and B == b:
        print(i)
        exit()

print("-1")

Solution (Python):
a,b = list(map(int,input().split()))
flg = False
for i in range (0,1001):
    if(i * 8 // 100 == a and i * 10 // 100 == b):
        print(i)
        flg = True
        break
if(flg == False):
    print(-1)

Solution (Python):


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

for i in range(10000):
    
    
    if int(i * (8/100)) == a and int(i * (1/10)) == b:
        print(i)
        break
else:
    print("-1")

Solution (Python):
a,b=map(int, input().split())
f_inf = float('inf')
a_x,b_x = [],[]
cnt = 0
for i in range(1,int(100/0.08)+1):
    if int(0.08 * i) == a:
        a_x.append(i)
        cnt += 1
if cnt != 0:
    cnt = 0
    for i in a_x:
        if int(0.1 * i) == b:
            b_x.append(i)
            cnt +=1
if cnt != 0:
    print(min(b_x))
else:
    print(-1)

Solution (Python):
import numpy as np
import math as m

def main(**kwargs):
    res = -1
    now = 1263

    while now > 0:
        now -= 1
        
        if (int(now * 0.08) == a and int(now * 0.1) == b):
            res = now

    return res

if __name__ == "__main__":
    cin = np.array(input().split(" ")).astype("int")
    a, b, *_ = cin

    cout = main(a=a, b=b)
    print(cout)

Solution (Python):
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

Solution (Python):
import math

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

    ans = []
    for i in range(1, 1251):
      tax8 = math.floor(i * 0.08)
      tax10 = math.floor(i * 0.10)
      if tax8 == a and tax10 == b:
        ans.append(i)

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

if __name__ == '__main__':
    main()

Solution (Python):
A, B = (int(x) for x in input().split())

Amin = 0
Amax = 0
if A%2 == 0:
    Amin = 100*A//8
    Amax = 100*(A + 1)//8
else:
    Amin = 100*A//8 + 1
    Amax = 100*(A + 1)//8 - 1
Bmin = 10*B
Bmax = 10*(B + 1) - 1
if Amin > Bmax or Bmin > Amax:
    print(-1)
else:
    if Amin < Bmin:
        print(Bmin)
    else:
        print(Amin)

Solution (Python):
import sys
A,B=map(int,input().split())
for i in range(10,1001):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        sys.exit()
print(-1)

Solution (Python):
import math

a, b = input().split()

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

xas = math.ceil(a / 0.08)
xab = math.floor((a + 1) / 0.08)
xbs = math.ceil(b / 0.10)
xbb = math.floor((b + 1) / 0.10)

ra = list(range(xas, xab))
rb = list(range(xbs, xbb))

c = set(ra) & set(rb)

if c:
    print(min(c))
else:
    print('-1')

Solution (Python):
import math

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

S=[]

for i in range(1251):
    if math.floor(0.08*i)==A and math.floor(0.1*i)==B:
        S.append(i)
    else:
        S.append(10000)
        
S.sort()

if S[0]==10000:
    print('-1')
else:
    print(S[0])

Solution (Python):



import math

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

a_min = math.ceil(a / 0.08)
a_max = math.ceil((a + 1) / 0.08)

b_min = math.ceil(b / 0.10)
b_max = math.ceil((b + 1) / 0.10)

if (b_min < a_max and a_min < b_max):
    print(max(a_min, b_min))
else:
    print(-1)

Solution (Python):
a, b = map(int, input().split())
a_list = [x for x in range(20000) if int(x*0.08) == a]
b_list = [x for x in range(20000) if int(x*0.1) == b]
a_list.extend(b_list)
new_list = sorted([x for x in set(a_list) if a_list.count(x) >1])
if len(new_list) != 0:
    print(new_list[0])
else:
    print(-1)

Solution (Python):
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)

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

Alist = []
Blist = []

for i in range(1, 1251) :
  Alist.append(int(i * 0.08))
for i in range(1, 1001) :
  Blist.append(int(i * 0.1))

canA = [i + 1 for i, x in enumerate(Alist) if x == A]
canB = [i + 1 for i, x in enumerate(Blist) if x == B]

can = set(canA) & set(canB)

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

Solution (Python):
from math import floor

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

for i in range(1001):
    if floor(i * 0.08) == A and floor(i * 0.1) == B:
        print(i)
        exit()
print('-1')

Solution (Python):
import math

a, b = map(int, input().split())
 
x = math.ceil(a/0.08)
ans = 0
while True:    
    y = int(x * 0.1)
    if (y == b):
        ans = 1
        break
    x += 1
    if int((x) * 0.08) > a:
        break
 
if ans == 1:
    print (int(x))
else:
    print (-1)

Solution (Python):
import sys
import math

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

for i in range(1, 1001):
    eat_in = math.floor(i * 0.08)
    eat_out = math.floor(i * 0.1)
    if eat_in == a and eat_out == b:
        print(i)
        sys.exit()
print(-1)

Solution (Python):
a, b = list(map(int, input().strip().split()))
for i in range(0,1500):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    break
else:
  print("-1")

Solution (Python):
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

Solution (Python):
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):
            if ans == -1:
                ans = i

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

print(ans)

Solution (Python):
import math

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


def calc():
    global A, B

    for x in range(1, 1001):
        a = math.floor(x * 0.08)
        b = math.floor(x * 0.1)

        if a == A and b == B:
            return x

    return -1


res = calc()
print(res)

Solution (Python):
a,b=map(int, input().split())
f_inf = float('inf')
a_x,b_x = [],[]
cnt = 0
for i in range(1,int(100/0.08)+1):
    if int(0.08 * i) == a:
        a_x.append(i)
        cnt += 1
if cnt != 0:
    cnt = 0
    for i in a_x:
        if int(0.1 * i) == b:
            b_x.append(i)
            cnt +=1
if cnt != 0:
    print(min(b_x))
else:
    print(-1)

Solution (Python):
import sys

s = sys.stdin.readline().split()

a, b = map(int, s)
orig_a = a/0.08
if int(orig_a) < orig_a:
    left = int(orig_a) + 1
else:
    left = int(orig_a)
right = left + 1
while True:
    if int(right * 0.08) > a:
        break
    right += 1
for i in range(left, right):
    if int(i * 0.1) == b:
        print(i)
        sys.exit(0)
print(-1)

Solution (Python):
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

Solution (Python):
import numpy as np
import math

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

    

    a_ans = np.array([i for i in range(math.ceil(a/0.08), int((a+1)/0.08))])
    b_ans = np.array([j for j in range(math.ceil(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()

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

Solution (Python):

import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from functools import lru_cache
from heapq import heappop,heappush
import time
import sys
input=readline = sys.stdin.readline
sys.setrecursionlimit(2000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s



import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from functools import lru_cache
from heapq import heappop,heappush
import time
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(2000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s


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


s1=set()
s2=set()
for a in range(1,10000):
    if(int(a*0.08)==A):s1.add(a)
for a in range(1,10000):
    if(int(a*0.1)==B):s2.add(a)
C=s1&s2
if(len(C)==0):print(-1)
else:print(min(C))

Solution (Python):
import math

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

emin=math.ceil(a/0.08)
emax=math.ceil((a+1)/0.08)-1
tmin=math.ceil(b/0.1)
tmax=math.ceil((b+1)/0.1)-1

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

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

Solution (Python):
A,B=map(int,input().split())
if (A/0.08)%1==0.0:
    a1=int(A/0.08)
else:
    a1=int(A/0.08)+1
if ((A+1)/0.08)%1!=0.0:
    a2=int((A+1)/0.08)
else:
    a2=int((A+1)/0.08)-1

if (B/0.1)%1==0.0:
    b1=int(B/0.1)
else:
    b1=int(B/0.08)+1
if ((B+1)/0.1)%1!=0.0:
    b2=int((B+1)/0.1)
else:
    b2=int((B+1)/0.1)-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)


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

Solution (Python):
import math
a, b = map(int, input().split())
ta = a / 0.08
tb = b / 0.10
if (math.floor(ta * 0.1) == b):
  print(math.ceil(ta))
elif (math.floor(tb * 0.08) == a):
  print(math.ceil(tb))
else:
  print(-1)

Solution (Python):
import math

A,B = map(int,input().split())
ans = -1
for i in range(10,10000):
    a = math.floor(i * 0.08)
    b = math.floor(i * 0.1)
    if a == A and b == B:
        ans = i
        break

print(ans)

Solution (Python):
from math import floor
a,b=map(int,input().split())
A=[]
B=[]
for i in range(1,10001):
    x=int(floor(i*0.08))
    y=int(floor(i*0.1))
    if x==a:
        A.append(i)
    if y==b:
        B.append(i)
A=set(A)
B=set(B)
ans=list(A&B)
if ans:
    print(min(ans))
else:
    print(-1)

Solution (Python):
import sys

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


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

A_ = []
B_ = []
end = False
for i in range(1, 1001):
	if i*8//100 == A and i//10 == B:
		print(i)
		end = True
		break
	else:
		continue
if end:
	pass
else:
	print(-1)

Solution (Python):
import math
A,B = map(int,input().split())
flag = 0
for i in range(1,10**5):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        print(i)
        flag += 1
        break
if flag == 0:
    print(-1)

Solution (Python):
from math import floor, ceil

def get_original_price(a, b):
  inclusive_min = max(12.5*a, 10*b)
  exclusive_max = min(12.5*(a+1), 10*(b+1))
  if inclusive_min >= exclusive_max: return -1
  if ceil(inclusive_min) == exclusive_max: return -1
  if floor(exclusive_max) >= ceil(inclusive_min): return int(ceil(inclusive_min))
  return -1






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

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

r = b * 10
for i in range(10):
    if math.floor(r * 0.08) == a:
        print(r)
        exit()
    r = r + 1

print('-1')

Solution (Python):
b,a = map(int,input().split())
ans = -1

for i in range(10*a, 10*(a+1) ):
  if i >= 25*b/2 and i < 25*(b+1)/2:
    ans = i
    break
    
print(ans)

Solution (Python):
def main():

    A, B = map(int, input().split())
    v_A = int(A / 0.08)
    if (100*A) % (100*0.08) != 0:
        v_A += 1
    v_B = int(B / 0.1)
    if (100*B) % (100*0.1) != 0:
        v_B += 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()

Solution (Python):
import math
A,B = map(int,input().split())
for i in range(10002):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        print(i)
        break
    elif i ==10001:
        print(-1)

Solution (Python):
from math import floor
A, B = map(int, input().split())
N = -1
for i in range(1, 10000):
    if (floor(i * 0.08) == A and floor(i * 0.10) == B):
        print(i)
        exit(0)
print(N)

Solution (Python):
A,B=map(int,input().split())
a=A//0.08
b=B//0.10
ans=max(a,b)+1
if int(ans*0.08)==A and int(ans*0.10)==B:
    print(int(ans))
else:
    print(-1)

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

mid_a = 12.5 * a
mid_b = 10 * b

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

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

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

Solution (Python):
A, B = map(int, input().split())
flag = 0
for x in range(100000):
  if (int(x * 0.08) == A) & (int(x * 0.1) == B): flag = 1; break
print(x if flag == 1 else -1)

Solution (Python):
import math
a,b = map(int, input().split())
x = math.ceil(a/0.08)
y = math.ceil(b/0.10)
ans1 = 10**8
ans2 = 10**8
while math.floor(x*0.08) == a and math.floor(x*0.1) == b:
    ans1 = x
    x -= 1
while math.floor(y*0.08) == a and math.floor(y*0.1) == b:
    ans2 = y
    y -= 1
print(min(ans1,ans2) if min(ans1,ans2)!=10**8 else -1)

Solution (Python):
a,b=map(int,input().split())
min=0
for i in range(1,15000):
  if(int(i*0.08+0.0001)==a and int(i*0.1+0.0001)==b):
    print(i)
    min=i
    break
if(min==0):
  print(-1)

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

max_value = 1250

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

print(-1)

Solution (Python):
def main():
    A,B = map(int,input().split())
    a = A / 0.08
    b = B / 0.10
    ans = -1
    large = max(int(a),int(b))
    small = min(int(a),int(b))
    for num in range(large+2,small-2,-1):
        numa = int(num * 1.08)
        numb = int(num * 1.10)
        if numa == (A+num) and numb == (B+num):
            ans = num
            

    print(ans)

if __name__ == "__main__":
    main()

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

for i in range(10001):
    if math.floor(i * 0.08) == A and math.floor(i*0.1) == B:
        print(i)
        exit()
print(-1)

Solution (Python):
A,B=map(int,input().split())
result=0

flg=0
X=1

while X*0.1<=100:
    if int(X*0.08)==A and int(X*0.1)==B:
        flg=1
        result=X
        break
    X+=1
    

if flg==0:
    result=-1

print(result)

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

    array = []
    for i in range(1,1262):
        if int(i*0.08)==a and int(i*0.1)==b:
            print(i)
            return
    print(-1)


if __name__ == '__main__':
    main()

Solution (Python):
A,B=map(int,input().split())
import math
a=[]
for i in range(13,1010):
    if math.floor(i*0.08)==A and math.floor(i*0.10)==B:
        a.append(i)
if len(a)>=1:
    print(a[0])
else:
    print('-1')

Solution (Python):
import math

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

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

Solution (Python):
import math

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

minA = 12.5 * A
if minA.is_integer() == True:
    minA = int(minA)
else:
    minA = math.ceil(minA)

maxA = 12.5 *(A+1)
if maxA.is_integer() == True:
    maxA = int(maxA-1)
else:
    maxA = math.floor(maxA)

minB = 10 * B
maxB = (10 * (B+1))-1



if minA <= maxB and minB <= maxA:
    if minA < minB:
        print(minB)
    else:
        print(minA)
else:
    print(-1)

Solution (Python):

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


X1 = B*10
X2 = math.ceil((B+1)*10) - 1
X3 = math.ceil((A/0.08))
X4 = math.ceil(((A+1)/0.08)) - 1


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

Solution (Python):
A, B = map(int, input().split())
flag = 0
for i in range(1, 1001):
    iP = i * 0.08
    for j in range(1, 1001):
        jP = j * 0.1
        if int(iP) == A and int(jP) == B:
            if i == j:
                print(i)
                flag = 1
                break
    if flag == 1:
        break
else:
    print(-1)

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

res = -1
for pp in range(10, 1250):
    if int(pp * 0.08) == A and int(pp * 0.10) == B:
        res = pp
        break

print(res)

Solution (Python):
b,a = map(int,input().split())
ans = a*10
for i in range(11):
    if i == 10:
        ans = -1
        break
    if int(ans*0.08) == b:
        break
    ans += 1
print(ans)

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

for i in range(1,10001):
  a = int(i * 0.08)
  if(a == A):
    b = int(i * 0.1)
    if(b == B):
      print(i)
      exit()
print('-1')

Solution (Python):
import sys

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

for i in range(1, 10000):
  if (int)(i * 0.08) == A and (int)(i*0.1) == B:
    print(i)
    sys.exit()

print(-1)

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

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

ans = ('-1')

for i in range(10001):
    z8 = math.floor(i * 0.08)
    z10 = math.floor(i * 0.1)

    if z8 == a and z10 == b:
        ans = i
        break

print(ans)

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


result = -1
for i in range(1, 1001):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        result = i
        break
print(result)

Solution (Python):
import math
import sys

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

minx = max(10*B, math.floor(12.5*A))
maxx = min(10*(B+1)-1, math.floor(12.5*(A+1)-1))
for i in range(minx, maxx+1):
    if (A <= i*0.08 < A+1) and (B <= i*0.1 < B+1):
        print(i)
        sys.exit()

print(-1)

Solution (Python):

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


a = int(A/0.08)
b = int(B/0.1)
aa=[]
bb=[]
if int(a*0.08)==A:
    aa.append(a)
if int(b*0.1)==B:
    bb.append(b)
au=a+1
ap=a-1
bu=b+1
bs=b-1
f1=True
f2=True
f3=True
f4=True

while f1==True or f2==True:
    if int(au*8/100) == A:
        aa.append(au)
        au += 1
    else:
        f1=False

    if int(ap*8/100) == A:
        aa.append(ap)
        ap -=1
    else:
        f2=False

while f3==True or f4==True:
    if int(bu*10/100) == B:
        bb.append(bu)
        bu += 1
    else:
        f3=False

    if int(bs*8/100) == B:
        bb.append(bs)
        bs -=1
    else:
        f4=False
cc=[]
for i in aa:
    for j in bb:
        if i==j:
            cc.append(j)
if len(cc)==0:
    print(-1)
else:
    print(min(cc))

Solution (Python):
import numpy as np

array = list(map(int,input().strip().split()))

a = array[0]
b = array[1]

min8 = a/0.08
max8 = (a+1)/0.08
min10 = b/0.1
max10 = (b+1)/0.1

def lists(a,b):
    if a%1==0:
        a2 = a
    else:
        a2 = int(a)+1
    if b%1==0:
        b2 = b-1
    else:
        b2 = int(b)
    return np.arange(a2,b2+1)

list8 = lists(min8,max8)
list10 = lists(min10,max10)

hosii = list(set(list8)&set(list10))
if len(hosii)>0:
    print(int(np.min(hosii)))
else:
    print(-1)

Solution (Python):
import math

TAXRATE8 = 0.08
TAXRATE10 = 0.1

tax8, tax10 = map(int, input().split())

amount8_min = math.ceil(tax8 / TAXRATE8)
amount8_max = math.floor((tax8+1) / TAXRATE8)
if ((tax8+1) / TAXRATE8).is_integer():
  amount8_max -= 1


amount10_min = math.ceil(tax10 / TAXRATE10)
amount10_max = math.floor((tax10+1) / TAXRATE10)
if ((tax10+1) / TAXRATE10).is_integer():
  amount10_max -= 1

ans_set = set(range(amount8_min, amount8_max)) & set(range(amount10_min, amount10_max))

if ans_set == set({}):
  print(-1)
else:
  print(min(ans_set))

Solution (Python):
from sys import stdin
import math

a, b = [int(x) for x in stdin.readline().rstrip().split()]

x1 = a / 0.08
x11 = (a + 1) / 0.08
x2 = b / 0.1
x22 = (b + 1) / 0.1

result = -1
if (x1 >= x2) and (x1 < x22):
    result = x1
if (x2 >= x1) and (x2 < x11):
    result = x2

print(math.ceil(result))

Solution (Python):
a,b = map(int,input().split())
import math
c = []
d =[]
for i in range(1300):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        c.append(i)
    else:
        d.append(i)
if len(c) ==0 :
    print(-1)
else:
    print(min(c))

Solution (Python):
from math import floor
A, B = map(int, input().split())

def check(x):
    if floor(x*0.08) == A and floor(x*0.1) == B:
        return True
    return False

x = 1
while(x < 1251):
    if check(x):
        break
    x += 1

if x == 1251:
    print(-1)
else:
    print(x)

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

ans = -1
for i in range(1, 2000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        ans = i
        break

print(ans)

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

for i in range(1,2000):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        print(i)
        break
    elif i==1999:
        print(-1)