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: Accepted

Solution code:
a,b = map(int,input().split())
b_min = b*10
b_max = (b+1)*10

for i in range(b_min,b_max):
    aa = int(i*0.08)
    if aa == a:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
def main():
    A,B = map(int, input().split())
    for i in range(50000):
        a = int(i * 0.08)
        b = int(i * 0.1)
        if a==A and b == B:
            print(i)
            return

    print(-1)






if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(1, 1101):
  if int(i*0.08) == A and int(i*0.10) == B:
    print(i)
    break
else:
  print(-1)

Submission status: Accepted

Solution code:
import sys
#read = sys.stdin.read
from math import floor
def main():
    a, b = map(int, input().split())
    for i1 in range(1251):
        if floor(i1 * 0.08) == a and floor(i1 * 0.1) == b:
            print(i1)
            sys.exit()
    print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for x in range(1251):
    if int(0.08 * x) == A and int(0.10 * x) == B:
        print(x)
        exit()
print(-1)

Submission status: Accepted

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

ans = -1

for i in range(10000,-1,-1):
    tax1 = int(i * 0.08)
    tax2 = int(i * 0.10)
    if tax1 == A and tax2 == B:
        ans = i

print(ans)

Submission status: Accepted

Solution code:
import sys 
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
A, B = map(int, readline().split())
A1 = math.ceil(A * 12.5)
B1 = B * 10
A2 = math.ceil((A+1) * 12.5)
B2 = (B+1) * 10 
a = min(A1,B1)
b = max(A2,B2)
for i in range(a,b+1):
    if A1 <= i < A2 and B1 <= i < B2:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

flag = 0

for x in range(1,1252):
    if math.floor(0.08 * x) == A and math.floor(0.10 * x) == B:
        ans = x
        flag = 1
        break
if flag == 0:
    ans = -1

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
l=max(0--a*25//2,b*10)
print([-1,l][l<min(-~a*25//2,-~b*10)])

Submission status: Accepted

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

i=0
while True:
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        break
    elif i > A/0.08 and i > B/0.1:
        print(-1)
        break
    i += 1

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
al,ar,bl,br=0--a*25//2,a*25//2+12,b*10,b*10+9
print([max(al,bl),-1][ar<bl or br<al])

Submission status: Accepted

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

for x in range(1, 1001):
    if x * 8 // 100 == a and x * 10 // 100 == b:
        print(x)
        break
else:
    print('-1')

Submission status: Accepted

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

for i in range(10001):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

for x in range(0,10**6):
    # print('---')
    # print(x)
    ax = (8*x)//100
    bx = (10*x)//100
    # print(ax,bx)
    if ax == a and bx == b:
        print(x)
        break
else:
    print(-1)

Submission status: Accepted

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

flag = 1
for i in range(1,1010,1):
  a = int(i*0.08)
  b = int(i*0.10)
  if a == A and b == B:
    flag = i
    break
  else:
    flag = -1
print(flag)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for i in range(1010):
    tax8 = int(i * 0.08)
    tax10 = int(i * 0.1)

    if a == tax8 and b == tax10:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = -1
for x in range(1010):
    if int(x*0.08) == A and int(x*0.1) == B:
        ans = x
        break

print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = -1
for x in range(10001):
    if int(x*0.08) == A and int(x*0.1) == B:
        ans = x
        break

print(ans)

Submission status: Accepted

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

import math
ans = -1
for i in range(10000):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        ans=i
        break
print(ans)

Submission status: Accepted

Solution code:
def resolve():
    A, B = list(map(int, input().split()))
    for x in range(1, 1000 +1):
        if int(0.08 * x) == A and int(0.10 * x) == B:
            print(x)
            return

    print('-1')
    return

resolve()

Submission status: Accepted

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
a, b = map(int, input().split())
List = [0]*10
ans = -1

for i in range(10):
    List[i] = b*10+i

for i in List:
    if int(i*0.08) == a:
        ans = i
        break;

print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict 
a,b=map(int,input().split())


dic=defaultdict(lambda:-1)
for i in range(100000,0,-1):
    dic[int(i*0.08),int(i*0.10)]=i
    
print(dic[a,b])

Submission status: Accepted

Solution code:
#158
A, B = map(int,input().split())
if(12.5*A-10*(B+1)>=0 or 10*B-12.5*(A+1)>=0):
    print(-1)
else:
    if(A*100 % 8 == 0):
        print(max([10*B,A*100//8]))
    else:
        print(max([10*B,A*100//8+1]))

Submission status: Accepted

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

down_a = math.ceil(A / 0.08)
up_a = math.ceil((A+1) / 0.08)
down_b = int(B / 0.1)
up_b = int((B+1) / 0.1)

a = [i for i in range(down_a, up_a)]
b = [j for j in range(down_b, up_b)]

ans = -1
for num in a:
  if num in b:
    ans = num
    break;
print(ans)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
ans=100000
for i in range(1,10001):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        if i<ans:
            ans=i
if ans==100000:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ans=-1
for i in range(10,1263):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans=i
        break
print(ans)

Submission status: Accepted

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

# In[11]:


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


# In[12]:


for x in range(B*10,B*10+10):
    if x*0.08//1 == A:
        print(x)
        break
else:
    print(-1)


# In[ ]:

Submission status: Accepted

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

main()

Submission status: Accepted

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

ans=-1
for i in range(2000):
    if i*8//100==A and i//10==B:
        ans=i
        break

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=-1
for i in range(1300):
    if int(i*2/25)==a and int(i/10)==b:
        ans=i
        break
print(ans)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

_A = int(A//0.08)
_B = int(B//0.10)

r = sorted([_A,_B])
ans = []
for i in range(r[0],r[1]+2):
    if int(i*0.08) == A and int(i*0.1) == B :
        ans.append(i)

if ans == []:
    print("-1")
else:print(ans[0])

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = [i for i in range(1010)]
c = 0
for f in b:
  if f * 8 // 100 == a[0] and f * 10 // 100 == a[1]:
    print(f)
    c += 1
    break
if c == 0:
  print(-1)

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b=INTM()
    
    for i in range(1,1251):
        if int(i*0.08)==a and int(i*0.1)==b:
            ans=i
            break
        ans=-1
    
    print(ans)
    
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
for i in range(1,1010):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
A,B = list(map(int,input().split()))
 
A_min=12*A+math.ceil(0.5*A)
A_max=12*(A+1)+math.floor(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)
 
if A_max <= B_min:
    print(-1)
elif B_max <= A_min:
    print(-1)
else:
    print(max(A_min,B_min))

Submission status: Accepted

Solution code:


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

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

print(-1)

Submission status: Accepted

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

flag = -1
for x in range(1,10001):
    if (x *0.08) // 1 == A and (x*0.1) // 1 == B:
        flag = x
        break

print(flag)

Submission status: Accepted

Solution code:
class Fraction_Error(Exception):
    pass

from fractions import gcd
#import math
class Fraction():
    ##入力定義
    def __init__(self,Numerator=0,Denominator=1):
        self.a=Numerator
        self.b=Denominator

    #表示定義
    def __str__(self):
        if self.b==1:
            return str(self.a)
        else:
            return str(self.a)+"/"+str(self.b)

    #四則演算定義
    def __add__(self,other):
        c=Fraction()
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        c.a=self.a*other.b+self.b*other.a
        c.b=self.b*other.b
        return Fraction.__reduce(c)

    def __radd__(self,other):
        c=Fraction()
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        c.a=self.a*other.b+self.b*other.a
        c.b=self.b*other.b
        
        return Fraction.__reduce(c)
    
    def __sub__(self,other):
        return self+(-other)

    def __rsub__(self,other):
        return -self+other

    def __mul__(self,other):
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        return Fraction.__reduce(Fraction(self.a*other.a,self.b*other.b))

    def __rmul__(self,other):
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        return Fraction.__reduce(Fraction(self.a*other.a,self.b*other.b))

    def __floordiv__(self,other):
        if other==Fraction():
            raise Fraction_Error("0除算です.")
        
        H=self/other
        return H.a//H.b

    def __rfloordiv__(self,other):
        if self==Fraction():
            raise Fraction_Error("0除算です.")

        H=other/self
        return H.a//H.b
    
    def __truediv__(self,other):
        if other==Fraction():
            raise Fraction_Error("0除算です.")
        
        if not(isinstance(other,Fraction)):
            other=Fraction.Int_to_Fraction(other)
            
        return self*Fraction.__inverse(other)

    def __rtruediv__(self,other):
        if self==Fraction():
            raise Fraction_Error("0除算です.")
        
        if not(isinstance(self,Fraction)):
            self=Fraction.Int_to_Fraction(other)
            
        return Fraction.__inverse(self)*other

    def __pow__(self,other):
        if other==0:
            return 1
        n=abs(other)

        g=1
        k=self
        for i in range(int(math.log(n,2))+1):
            if n%2==1:
                g*=k

            k*=k
            n=n>>1

        if other>0:
            return g
        else:
            return 1/g
        
    #比較演算子
    def __eq__(self,other):
        t=self-other
        if isinstance(t,Fraction):
            return t.a==0
        else:
            return t==0
    
    def __nq(self,other):
        return not(self==other)

    def __lt__(self,other):
        t=self-other
        if isinstance(t,Fraction):
            return t.a<0
        else:
            return t<0

    def __le__(self,other):
        return (self<other) or (self==other)

    def __gt__(self,other):
        return -self<-other

    def __ge__(self,other):
        return (other<self) or (self==other)
    
    #その他
    def ToNumber(self):
        return self.a/self.b

    def sign(self):
        s=self.a*self.b
        if s>0:return 1
        elif s==0:return 0
        else:return -1

    def __reduce(self):
        g=gcd(self.a,self.b)
        self.a//=g
        self.b//=g

        if self.b<0:
            self.a*=-1
            self.b*=-1
        return Fraction(self.a,self.b)

    def Int_to_Fraction(self):
        if not(isinstance(self,Fraction)):
            return Fraction(self,1)
        else:return self
        
    def __inverse(self):
        if self==Fraction():
            raise Fraction_Error("0の逆数は存在しまんせん.")
        
        return Fraction.__reduce(Fraction(self.b,self.a))
    
    def __pos__(self):
        return self

    def __neg__(self):
        return Fraction(-self.a,self.b)

    def __abs__(self):
        return max(self,-self)
#--------------------
import math
A,B=map(int,input().split())
alpha=Fraction(8,100)
beta=Fraction(10,100)

m=max(A/alpha,B/beta)
m=math.ceil(m.a/m.b)

M=min((A+1)/alpha,(B+1)/beta)
M=math.floor(M.a/M.b)

if m<M:
    print(m)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
X = 1
F = False
while X <1500:
  if A == math.floor(X*0.08) and B == math.floor(X*0.1):
    F = True
    break
  else:
    X += 1
print(X if F else -1)

Submission status: Accepted

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

if a <= b:
    for i in range(1000000):
        if int(i*0.08) == a and int(i*0.1) == b:
            num = i
            break

        elif int(i*0.08) > a or int(i*0.1) > b:
            break

print(num)

Submission status: Accepted

Solution code:
## coding: UTF-8
import math

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

ans = -1
for i in range(1, 1050):
    a = math.floor(i * 0.08)
    b = math.floor(i * 0.10)
    #print(i, a, b)
    if(a == A and b == B):
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
A = int(math.floor(a * (100/8)))
A1 = int(math.ceil((a+1)*(100/8)))
B = int(math.floor(b * (100/10)))
B1 = int(math.ceil((b+1) * (100/10)))
X = []
Y = []
for i in range(A,A1+1):
  if int(math.floor(i*(8/100))) == a:
    X.append(i)
  else:
    pass
  
for i in range(B,B1+1):
  if int(math.floor(i*(10/100))) == b:
    Y.append(i)
  else:
    pass
    
if set(X)&set(Y) == set():
  print(-1)
else:
  Z = list(set(X)&set(Y))
  Z.sort()
  print(Z[0])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

p8min = math.ceil(a * 100 / 8)
p8max = math.ceil((a+1)*100 / 8) - 1

p10min = b * 10
p10max = (b + 1) * 10 - 1

p = max(p8min, p10min)

if p <= p8max and p <= p10max:
    print(p)
else:
    print(-1)

Submission status: Accepted

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

if(a%2 == 1):
    a_h = (a+1)*100 // 8
    a_l = a*100 // 8 + 1
else:
    a_h = (a+1)*100 // 8 + 1  
    a_l = a*100 // 8
b_h = (b+1)*10
b_l = b*10

if(a_l >= b_h or b_l >= a_h):
    print(-1)
elif(a_l < b_l):
    print(b_l)
elif(b_l <= a_l):
    print(a_l)

Submission status: Accepted

Solution code:
import math
A,B = (int(x) for x in input().split())
LowEight = math.ceil((25*A)/2)
CheckL8  = math.floor(LowEight/10)
LowTen   = 10*B
CheckL10 = math.floor(LowTen*2/25)

if   (CheckL8==B) and (CheckL10==A):
    minC = LowEight
elif (CheckL8!=B) and (CheckL10==A):
    minC = LowTen
elif (CheckL8==B) and (CheckL10!=A):
    minC = LowEight
elif (CheckL8!=B) and (CheckL10!=A):
    minC = -1
print(minC)

Submission status: Accepted

Solution code:
#C
A,B = map(int,input().split())
for i in range(1,10001):
    if int(i*0.08) == A and int(i*0.1) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

for i in range(100000):
    a = int(i * 0.08)
    b = int(i * 0.1)
    if a == A and b == B:
        print(i)
        break
    if a > A or b > B:
        print(-1)
        break

Submission status: Accepted

Solution code:
A, B = map(int, input().split(' '))
result = -1
for n in range(1000+1):
    if int(n*0.08) == A and int(n*0.1) == B:
        result = n
        break 
print(result)

Submission status: Accepted

Solution code:
import math

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

al = []
bl = []
for i in range(2000):
  t = math.floor(i * 0.08)
  if t == a:
    al.append(i)
for i in range(2000):
  t = math.floor(i * 0.1)
  if t == b:
    bl.append(i)

for i in range(len(al)):
  for j in range(len(bl)):
    if al[i] == bl[j]:
      print(al[i])
      exit(0)
print(-1)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
res = -1
for n in range(100**2):
    if math.floor(n * 0.08) == A:
        if math.floor(n * 0.1) == B:
            res = n
            break
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
ans = -1
for i in range(math.ceil(a / 0.08), math.ceil((a + 1) / 0.08)):
  if math.floor(i * 0.1) == b:
    ans = i
    break
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
for i in range(20000):
    if (i*8)//100==A and (i*10)//100==B:
        print(i)
        exit()
    else:
        pass
print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
for i in range(20000):
    if ((i*8)+0.000005)//100==A and ((i*10)+0.000005)//100==B:
        print(i)
        exit()
    else:
        pass
print(-1)

Submission status: Accepted

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

import math

if math.ceil((a+1)*12.5) <= math.ceil(b*10) or math.ceil(a*12.5) >= math.ceil((b+1)*10):
    print(-1)
else:
    print(max(math.ceil(a*12.5),math.ceil(b*10)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())
for i in range(10000):
    if int(i*0.08) == a and int(i*0.10) == b:
        print(i)
        exit()
if i == 9999:
    print(-1)

Submission status: Accepted

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

for i in range(1, 1251):
    if int(i * 0.08) == a and int(i * 0.10) == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

ans = -1
for n in range(1251):
    if int(n * 0.08) == a and int(n * 0.1) == b:
        ans = n
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(1,1009):
    if math.floor(x * 0.08 )== a and math.floor(x * 0.1) == b:
        ans.append(x)

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

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
for i in range(10*B,10*(B+1)):
  if 10*B<= i <10*(B+1) and 12.5*A<= i < 12.5*(A+1):
    print(i)
    break
else:
  print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
res = -1
for i in range(1,1011):
  if int(i * 0.08) == a and int(i * 0.10)==b:
    res = i
    break
  if int(i * 0.10) > 100:
    break
print(res)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
for m in range (math.ceil(a/0.08),int((a+1)/0.08)):
  if int(m*0.10)== b:
    print(m)
    break
else:
  print(-1)

Submission status: Accepted

Solution code:
import math

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

if A == 0 and B == 0:
    print(0)
    exit()

for i in range(1000):
    a = math.floor((i+1)*8/100)
    b = math.floor((i+1)/10)
    if A == a and B == b:
        print(i+1)
        exit()

print(-1)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
for i in range(0,1001):
  if int(i*0.08) == A and int(i*0.1)==B:
    print(i)
    exit()

print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=100*a/8
y=100/8*(a+1)
z=10*b
w=10*(b+1)
import math
if max(math.ceil(z),math.ceil(x))<min(y,w) :
    print(math.ceil(max(z,x)))
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
a = min(int(A/0.08), int(B/0.08))

while True:
    if int(a*0.08) == A and int(a*0.10) == B:
        print(a)
        sys.exit()
    elif int(a*0.08) > A or int(a*0.10) > B:
        print('-1')
        sys.exit()
    else:
        a += 1

Submission status: Accepted

Solution code:
import math
A, B = map(int,input().split())
minA = math.ceil(A/0.08)
maxA = math.ceil((A+1)/0.08) -1
minB = math.ceil(B/0.1)
maxB = math.ceil((B+1)/0.1) -1

if (minA>maxB) or (minB>maxA):
    print(-1)
else:
    print(max(minA,minB))

Submission status: Accepted

Solution code:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

a,b = imap()
amin,mod = divmod(a*100, 8)
if mod: amin += 1
amax,mod = divmod((a+1)*100, 8)
if mod: amax += 1
bmin,bmax = b*10, (b+1)*10
ran = set(range(amin,amax)) & set(range(bmin,bmax))
ans = min(ran) if ran else -1
print(ans)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
a=[]
q=1
while True:
    if  int(q*0.08)==A:
        a.append(q)
    if int(q*0.08)>A:
        break
    q+=1
b=[]
w=1
while True:
    if  int(w*0.1)==B:
        b.append(w)
    if int(w*0.1)>B:
        break
    w+=1
    
#print(a)
#print(b)
#
#print(max(a[0],b[0]))
e=max(a[0],b[0])

if e in a and e in b:
    print(e)
else:
    print('-1')

Submission status: Accepted

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

for i in range(10,1010):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

a_inf = a / 0.08
a_sup = (a + 1) / 0.08
b_inf = b / 0.1
b_sup = (b + 1) / 0.1
a_min = int(a_inf // 1)

a = a_min
al = []
while a < a_sup:
    if a_inf <= a < a_sup:
        al.append(a)
    a += 1

if al[0] >= b_sup:
    print('-1')
else:
    for i in range(len(al)):
        if b_inf <= al[i]:
            print(int(al[i]))
            break
    else:
        print('-1')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = -1
for i in range(1,1101):
    if (int((i*8)/100)==A)  & (int((i*10)/100)==B):
        #print((i*8)/100)
        #print((i*10)/100)
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
aa = 0
aaa = 0
bb = 0
bbb = 0
x = True
for i in range(1, 1100):
    if a == int(i*0.08) and x:
        aa=i
        x = False
        continue
    if a ==int(i*0.08)-1:
        aaa = i-1
        break
x = True
for i in range(1, 1100):
    if b == int(i*0.1) and x:
        bb=i
        x = False
        continue
    if b ==int(i*0.1)-1:
        bbb = i-1
        break
#print(aa, aaa, bb, bbb)
if bb>=aa and bb <= aaa:
    print(bb)
elif aa >=bb and aa<= bbb:
    print(aa)
else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(float, input().split())
for i in range(1, 1010):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()

print("-1")

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    al = int(a / 0.08 + 0.5)
    bl = int(b / 0.1)
    au = al + 12 - a % 2
    bu = bl + 9
    if bu < al or au < bl:
        print(-1)
    else:
        print(max(al, bl))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    eight = [i for i in range(0, 2000) if a == int(i * 0.08)]
    ten = [i for i in range(0, 2000) if b == int(i * 0.1)]
    for i in eight:
        for j in ten:
            if i == j:
                print(i)
                return
    print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

f = True
count = 0
while f:
    count += 1
    if int(count*0.08) == a and int(count*0.1) == b:
        print(count)
        break
    elif int(count*0.1) > b:
        print(-1)
        f = False

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
a1=math.ceil(A/0.08)
a2=math.ceil((A+1)/0.08)-1
b1=math.ceil(B/0.1)
b2=math.ceil((B+1)/0.1)-1

if b2<a1 or a2<b1:
  print(-1)
else:
  print(max(b1,a1))

Submission status: Accepted

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

def solve(A: int, B: int):
    A = Decimal(str(A))
    B = Decimal(str(B))
    s8 = Decimal('0.08')
    s10 = Decimal('0.10')
    n8 = [math.ceil(A/s8), math.floor((A+1)/s8)]
    n10 = [math.ceil(B/s10), math.floor((B+1)/s10)]

    # print(n8, n10)
    if n10[0] <= n8[0] < n10[1]:
        print(int(n8[0]))
    elif n8[0] <= n10[0] < n8[1]:
        print(int(n10[0]))
    else:
        print('-1')
    return


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
ans = -1
for x in range(10000):
  if int(x*0.08) == A and int(x*0.10) == B:
    ans = x
    break
print(ans)

Submission status: Accepted

Solution code:
import math

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

min_price_A = A * 12.5
max_price_A = min_price_A + 12

min_price_B = B * 10
max_price_B = min_price_B + 9

if min_price_A <= min_price_B:
    if max_price_A >= min_price_B:
        print(int(min_price_B))
    else:
        print(-1)
else:
    if max_price_B >= min_price_A:
        print(math.ceil(min_price_A))
    else:
        print(-1)

Submission status: Accepted

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

i = min(int(A/0.08), int(B/0.1)) * 1.0
while(True):
  if int(i * 0.08) == A and int(i*0.1) == B:
    print(int(i))
    break
  i = 1.0 + i
  if int(i * 0.08) > A or int(i*0.1) > B:
    print('-1')
    break