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:
import numpy as np
A, B = map(int,input().split())
A,B=int(A),int(B)
c=0
d=True
while(d):
    a=int(c*0.08)
    b=int(c*0.1)
    if a==A and b==B:
        print(c)
        d=False
    elif a>A or b>B:
        print('-1')
        d=False
    else:
        c+=1 
        continue

Submission status: Accepted

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

for i in range(1, 1250):
  if int(i*0.08) == a and int(i*0.1) ==b:
    print(i)
    quit()
print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
a = int(A // 0.08)
ans_lst = []
for i in range(20):
    # print(a, int(a * 0.08) == A)
    if int(a * 0.08) == A:
        ans_lst.append(a)
    a += 1
for i in ans_lst:
    if int(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

if 25*(A+1)/2 <= 10*B or 10*(B+1) <= 25*A/2:
    print(-1)
else:
    for i in range(10*B,10*(B+1)):
        if 25*A <= 2*i < 25*(A+1):
            print(i)
            break

Submission status: Accepted

Solution code:
import math

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

# a = A / 0.08
# a = a // 10
# a *= 10
#
# result = -1
# for i in range(10):
#     temp = a + i
#     if math.floor(temp*0.08) == A and math.floor(temp*0.1) == B:
#         result = int(temp)
#         break


result = -1
for i in range(1, 1263):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        result = int(i)
        break

print(result)

Submission status: Accepted

Solution code:
import math

A,B = map(int,input().split())
tmp_Bx = B * 10

f = False
for i in range(tmp_Bx,tmp_Bx+10):
    Ax = math.floor(0.08 * i)
    if Ax == A:
        print(i)
        f = True
        break
if f == False:
    print(-1)

Submission status: Accepted

Solution code:
import math

a, b = [int(x) for x in input().split()]

mina, maxa = math.ceil(a / 0.08), math.ceil((a+1) / 0.08)-1
minb, maxb = b * 10, (b+1) * 10 -1

if minb <= maxa and minb >= mina:
    print(minb)
elif mina <= maxb and mina >= minb:
    print(mina)
else:
    print(-1)

Submission status: Accepted

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

for i in range(1,int(100/0.08)):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
import math
sys.setrecursionlimit(int(1e6))

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

pa = A / 0.08
d = 100 / 8

ans = -1
for p in range(int(pa), int(pa + d)+1):
    if (A == int(p * 0.08)) and (B == int(p * 0.10)):
        ans = p
        break

print(ans)

Submission status: Accepted

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

for i in range(1000):
  if int((i+1)*0.080) == A and int((i+1)*0.10) == B:
    print(i+1)
    exit()
print(-1)

Submission status: Accepted

Solution code:
a, b =  map(int, input().split())
ans = 2000
for i in range(2000):
    if i * 8 // 100 == a and i // 10 == b:
        ans = min(ans, i)
if ans == 2000:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
def main():
    n,m = map(int, input().split())
    ans = 100000
    for i in range(5*m, 15*m):
        if int(i * 0.08) == n and int(i * 0.1) == m:
          ans = min(ans,i)
    print(-1) if ans == 100000 else print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(1, 10000):
    p = (i * 108) // 100
    q = (i * 11) // 10
    if p - i == a and b == q - i:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

a_sita = A/0.08 
a_ue = (A+1)/0.08 

b_sita = B/0.10
b_ue = (B+1)/0.10

if a_ue <= b_sita or b_ue <= a_sita:
  print(-1)

else:
  ans = max(a_sita,b_sita)
  ans = math.ceil(ans)
  print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

#print(A,B)

start = math.floor(A*100/8)
end = (B+1)*10

ans = -1

for i in range(start,end+1):
  ta = math.floor(i * 0.08)
  tb = math.floor(i * 0.1)
  #print(ta,tb)
  if ta == A and tb == B:
    ans = i
    break

print(ans)

Submission status: Accepted

Solution code:
import math

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

ans = -1
for i in range(1, 1265):
  A_calc = math.floor(i*0.08)
  B_calc = math.floor(i*0.10)
  if A_calc == A and B_calc == B:
    ans = i
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(10**5+1):
    tmp_8 = floor(i*0.08)
    tmp_10 = floor(i*0.1)
    if tmp_8==A and tmp_10==B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
from math import floor
A,B = map(int,input().split(" "))
s = 10*B
t = 10*(B+1)
ans = 2**60
for tmp in range(s,t):
    if floor(tmp*0.08) == A:
        ans = tmp
        break
s = 125*A
t = 125*(A+1)
for tmp in range(s,t):
    if floor(tmp/10) == B:
        ans = min(ans,tmp)
        break
if ans == 2**60:
    ans = -1
print(ans)

Submission status: Accepted

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

late_1 = 0.08
late_2 = 0.1

i = 1

while (i <= (100 / 0.08)):
  if int(i * late_1) == a and int(i * late_2) == b:
    print(i)
    break
  i += 1

if (i == (100 / 0.08) + 1):
  print(-1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A, B = map(int, input().split())
ansA = set()
for i in range(10*B, 10*(B+1)):
  ansA.add(i)

st = int(25*A/2)
if(25*A % 2 != 0):
  st += 1

ed = int(25*(A+1)/2)
if(25*(A+1) % 2 != 0):
  ed += 1

ansB = set()
for i in range(st, ed):
  ansB.add(i)

ans = ansA & ansB
if(len(ans) == 0):
  print('-1')
else:
  print(min(ans))

Submission status: Accepted

Solution code:
import sys
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)
        sys.exit()
    else:
        pass
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

def solve(A: int, B: int):
    ten = B * 10
    ans = int(ten)

    while True:
        if ans // 10 != B :
            print(-1)
            return
        elif math.floor(ans * 0.08) == A:
            print(ans)
            return
        ans += 1

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:
import math

AB = input().split()
A = int(AB[0])
B = int(AB[1])

# floor(0.08*x)=A
# floor(0.1*x)=B
# means
# A <= 0.08*x < A+1
# B <= 0.1*x < B+1
# therefore
# A/0.08 <= x < (A+1)/0.08
# B/0.1 <= x < (B+1)/0.1

x_lower1 = A/0.08
x_lower2 = B/0.1
x_upper1 = (A+1)/0.08
x_upper2 = (B+1)/0.1

x_lower = max(x_lower1, x_lower2)
x_upper = min(x_upper1, x_upper2)

x_candidate = math.ceil(x_lower)
if x_candidate < x_upper:
  print(int(x_candidate))
else:
  print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
f = False
for x in range(13, 1251):
    if (int(x*0.08) == A) and (int(x*0.1) == B):
        f = True
        print(x)
        break
if not f:
    print(-1)

Submission status: Accepted

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

result = -1

for x in range(0,10001):
  if int(x*0.08) == A and int(x*0.10) == B:
    result = x
    break
    
print(result)

Submission status: Accepted

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

beforeA = range(math.ceil(a * (100 / 8)), math.ceil((a+1) * (100 / 8)))
beforeB = range(b * 10, (b+1) * 10)
ans = 990990990
flag = False
for i in beforeA :
    for j in beforeB :
        #print(i, j)
        if i == j :
            flag = True
            ans = min(ans, i)
if flag :
    print(ans)
else :
    print(-1)


#print(beforeA, beforeB)

Submission status: Accepted

Solution code:
import math

S = input().split(" ")
A = int(S[0])
B = int(S[1])

def calculate(a,b):
    theta = 1 - 1e-9

    s1 = a/0.08
    s2 = (a + theta)/0.08


    s3 = b/0.10
    s4 = (b + theta) / 0.10

    m1 = math.ceil(s1)
    m2 = math.floor(s2)

    m3 = math.ceil(s3)
    m4 = math.floor(s4)

    arr1 = [i for i in range(m1,m2+1)]
    arr2 = [i for i in range(m3,m4+1)]

    result = list(set(arr1).intersection(set(arr2)))


    if len(result) == 0:
        return -1
    else:
        return min(result)



result = calculate(A,B)
print(result)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
XA=list(i for i in range (math.ceil(A/0.08), math.floor((A+1)/0.08)) )
XB=list(i for i in range (math.ceil(B/0.1), math.floor((B+1)/0.1)) )
X=list( set(XA) & set(XB)  )
if(len(X)>0):
    print(min(X))
else:
    print("-1")

Submission status: Accepted

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    from math import floor
    a, b = map(int, input().split())
    ax = 0
    bx = 0
    for i in range(1,1500):
        ax = floor(i * 0.08)
        bx = floor(i * 0.1)
        if ax == a and bx == b:
            print(i)
            return 0
    print(-1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

input_line = [int(i) for i in input().split()]
a = input_line[0]
b = input_line[1]

price_a_min = math.ceil(a / 0.08)
price_a_max = math.ceil((a + 1) / 0.08)
price_b_min = math.ceil(b / 0.1)
price_b_max = math.ceil((b + 1) / 0.1)

a_range = {i for i in range(price_a_min, price_a_max)}
b_range = {i for i in range(price_b_min, price_b_max)}

both_range = a_range & b_range

ans = -1
for i in sorted(both_range):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans = i
        break
    else:
        continue
print(ans)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
sup=min((A+1)/0.08,(B+1)/0.1)
inf=max(A/0.08,B/0.1)
inf2=math.ceil(inf)
if inf2<sup:
  print(inf2)
else:
  print(-1)

Submission status: Accepted

Solution code:
import math

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

def rangeOfPriceWithoutTax(price, rate):
    min_ = math.ceil(price / rate)
    max_ = int((price + 1) // rate)
    return set(range(min_, max_ + 1))

range_ = (rangeOfPriceWithoutTax(A, 0.08) & rangeOfPriceWithoutTax(B, 0.1)) - {0}

try:
    print(min(range_))
except ValueError:
    print(-1)

Submission status: Accepted

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

x = b * 100

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

eight = math.ceil(A / 0.08)
ten = math.ceil(B / 0.1)


eight2 = math.ceil((A+1)/0.08 - 0.0001)
ten2 = math.ceil((B+1)/0.1 - 0.01)

eight_range = set(range(eight, eight2, 1))
ten_range = set(range(ten, ten2, 1))


if eight_range.isdisjoint(ten_range):
    out = -1
else:
    out = min(eight_range & ten_range)

print(out)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ansA=A//(0.08)
ansB=B//(0.1)
a=[]
b=[]
while True:
    if int(ansA*1.08-ansA)==A:
        a.append(int(ansA))
        ansA+=1
    elif int(ansA*1.08-ansA)>A:
        break
    else:
        ansA+=1

while True:
    if int(ansB*1.1-ansB)==B:
        b.append(int(ansB))
        ansB+=1
    elif int(ansB*1.1-ansB)>B:
        break
    else:
        ansB+=1
c=[]
c+=set(a)&set(b)


if c==[]:
    print("-1")
else:
    print(int(min(c)))

Submission status: Accepted

Solution code:
a, b = input().split(" ")
a, b = int(a), int(b)
ans = -1
for i in range(1, 1010):
    if (int(i * 0.08) == a) and (int(i * 0.10) == b):
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
A,B=map(int,input().split())
flg=True
for i in range(2*10**4):
    if int(i*0.08)==A and int(i*0.1)==B:
        flg=False
        print(i)
        break

if flg:
    print(-1)

Submission status: Accepted

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

ans = -1
for x in range(1, 1250+1):
  _a = int(x * 0.08)
  _b = int(x * 0.1)
  # print(x, _a, _b)
  if _a == a and _b == b:
    ans = x
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# mini = 0
#
# maxi = 2000

smaller = 0
larger = 0

if a < b:
    smaller = a
    larger = b
else:
    smaller = b
    larger = a


start = smaller * 10
# print(start)

for i in range(start,1500):
    # print(i, int(i * 0.08), int(i * 0.1))
    if int(i * 0.08) == smaller and int(i * 0.1) == larger:
        print(i)
        exit(0)

print(-1)

Submission status: Accepted

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

a,b = -a,-b
minA,minB = a // 0.08, b // 0.1
minA,minB = -minA,-minB

maxA,maxB = (a-1) // 0.08, (b-1) // 0.1
maxA,maxB = -maxA-1,-maxB-1

if minA > maxB or minB > maxA:
    print(-1)
else:
    if minA >= minB:
        print(int(minA))
    else:
        print(int(minB))

Submission status: Accepted

Solution code:
import math

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

Xb = [i for i in range(10*B, 10*(B+1))]
Xa = [i for i in range(math.ceil(A/0.08), math.ceil((A+1)/0.08))]

S  = set(Xb) & set(Xa)

if len(S) != 0:
    print(min(list(S)))
else:
    print('-1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC158 C
a,b=map(int,input().split())
# x=a*(100/8)
# y=b*(100/10)

# print(x,y)
# print(int(x),int(y))

# sx=x*((108-8)/100)
# sy=y*((110-10)/100)

# print(int(sx),int(sy))

for i in range(200000):
    x,y=0.0,0.0
    x=i*0.08
    y=i*0.10
    if a==int(x) and b==int(y):
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
i = 1
while i < 100000:
    x = i * 108 // 100 - i
    y = i * 110 // 100 - i
    if x == a and y == b:
        print(i)
        exit(0)
    i += 1

print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=max(a/0.08,b/0.1)
y=min((a+1)/0.08,(b+1)/0.1)

if x<y:
    if x%1 != 0:
        print(int(x)+1)
    else:
        print(int(x))
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0-1
for i in range(1, 1010):
    if (i * 0.08) // 1 == a and (i * 0.10) // 1 == b:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math

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


low_A = int(math.floor(A / 0.08))
up_A = int(math.floor((A + 1) / 0.08)) - 1


low_B = int(math.floor(B / 0.1))
up_B = int(math.floor((B + 1) / 0.1)) - 1


for i in range(low_B, up_A + 1):
    x = int(i * 0.08)
    y = int(i * 0.1)

    if x == A and y == B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
pre = [10*b + i for i in range(10)]
import math
re = 0
for i in reversed(pre):
  if math.floor(i*0.08) == a:
    re = i
if re == 0:
  print(-1)
else:
  print(re)

Submission status: Accepted

Solution code:
import math

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

min_A = math.ceil(A * 100 / 8)
max_A = (A + 1) * 100 / 8
min_B = math.ceil(B * 100 / 10)
max_B = (B + 1) * 100 / 10

if (min_A <= min_B and min_B < max_A):
    ans = min_B
elif (min_B <= min_A and min_A < max_B):
    ans = min_A
else:
    ans = -1

print(ans)

Submission status: Accepted

Solution code:
#!python3.4
# -*- coding: utf-8 -*-
# abc158/abc158_c
import sys,math

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    A, B = i2nn()
    a_left = math.ceil(A / 0.08)
    a_right = int((A+1) // 0.08)
    b_left = math.ceil(B / 0.1)
    b_right = int((B+1) // 0.1)
    # print(a_left, b_left, a_right, b_right)
    left = max(a_left, b_left)
    right = min(a_right, b_right)
    if left < right:
        print(left)
    else:
        print(-1)
    return

main()

Submission status: Accepted

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

a=max(int(A//0.08),int(B//0.1))
for i in range(a,a+100):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
def solve():
    a,b=map(int,input().split())
    start=int(min(a*12.5,b*10))
    end=int(max((a+1)*12.5,(b+1)*10))

    for i in range(start, end):
        if (int(i * 0.08) == a and int(i * 0.1) == b):
            print(i)
            return
    print(-1)

solve()

Submission status: Accepted

Solution code:
from math import floor, ceil
A, B = [int(x) for x in input().split(" ")]

min_origin_a = ceil(A*12.5)     # contains
max_origin_a = ceil((A+1)*12.5)       # not contains

flag = False
for i in range(min_origin_a, max_origin_a):
    if floor(0.1*i) == B:
        print(i)
        flag = True
        break

if not flag:
    print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
list1 = []
list2 = []
if (a/0.08).is_integer():
    c1 = int(a/0.08)
else:
    c1=int(a/0.08)+1
if ((a+1)/0.08).is_integer():
    c2 = int((a+1)/0.08)
else:
    c2=int((a+1)/0.08)+1

for i in range(c1,c2):
    list1.append(i)

if (b/0.10).is_integer():
    c3 = int(b/0.10)
else:
    c3=int(b/0.10)+1
if ((b+1)/0.10).is_integer():
    c4 = int((b+1)/0.10)
else:
    c4=int((b+1)/0.10)+1
for i in range(c3,c4):
    list2.append(i)

l3 = set(list1) & set(list2)
l3 = list(l3)
if len(l3) > 0:
    print(min(l3))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
f = False
for a in range(10, 12500):
    if int(a*0.08)==A and int(a*0.1)==B:
        f = True
        break
if f:
    print(a)
else:
    print(-1)

Submission status: Accepted

Solution code:
a=input()
a=a.split(' ')
A,B=int(a[0]),int(a[1])
flag=1
for i in range(1,1001):
    if (int(i*0.08)==A and int(i*0.1)==B):
        flag=0
        print(i)
        break;
if flag:
    print(-1)

Submission status: Accepted

Solution code:
import sys
import numpy as np

# input = sys.stdin.readline

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

a_tax = a * 100 // 8

b_tax = b * 100 // 10

for money in range(a_tax, 1250):
    if (b == money // 10) and (a == money * 8 // 100):
        print(money)
        break
else:
    print("-1")

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
for i in range(1251):
    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())
ans=-1
for i in range(1,1001):
  if i*0.08//1==A and i*0.1//1==B:
    ans=i
    break
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys

DEBUG = False

def solve():
    return


def read_int_list(sep = " "):
    return [int(s) for s in sys.stdin.readline().rstrip().split(sep)]

def read_int():
    return int(sys.stdin.readline())

def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


def main():
    a, b = read_int_list()
    for i in range(0, 1250):
        if int(i * 0.08) != a:
            continue
        if int(i * 0.1) != b:
            continue
        print(i)
        return
    print(-1)



if __name__ == "__main__":
    main()

Submission status: Accepted

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

for i in range(1, 10**5):
    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())

import math

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

Submission status: Accepted

Solution code:
import math

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

x = a*12.5
y = b*10

if x >= y:
	if x < y+10:
		ans = math.ceil(x)
	else:
		ans = -1
else:
	if y < x + 12.5:
		ans = math.ceil(y)
	else:
		ans = -1

print(ans)

Submission status: Accepted

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

res = -1

for i in range(1, (B + 1) * 10):
  x = int(i * 0.08)
  y = int(i * 0.1)

  if(A == x and B == y):
    res = i
    break

print(res)

Submission status: Accepted

Solution code:
import math
import numpy as np
a,b=[int(v) for v in input().split()]

min_8=math.ceil(a/0.08)
max_8=(a+1)//0.08

min_10=math.ceil(b/0.1)
max_10=(b+1)//0.1


range_8 = np.arange(min_8,max_8+1).astype(int)
range_10 = np.arange(min_10,max_10+1).astype(int)

try:
    print(min(np.intersect1d(range_8,range_10)))
except:
    print(-1)

Submission status: Accepted

Solution code:
import math
a,b = [int(i) for i in input().split()]
mina = math.ceil(a*100/8)
if (a+1)*100/8%1==0:
    maxa = (a+1)*100/8-1
else:
    maxa = math.floor((a+1)*100/8)

minb = math.ceil(b*100/10)
if (b+1)*100/10%1==0:
    maxb = (b+1)*100/10-1
else:
    maxb = math.floor((b+1)*100/10)

#print(mina,maxa,minb,maxb)

if minb<=mina and mina<=maxb:
    print(int(mina))
elif mina<=minb and minb<=maxa:
    print(int(minb))
else:
    print("-1")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
#print(a, b)
ans = -1
i = 0
for i in range(10 ** 6):
    if int(i * 0.08) == a:
        if int(i*0.1) == b:
            ans = i
            break
        #print(i)

# print(int(25 * 0.08))
# print(int(25 * 0.1))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = [int(i) for i in input().split()]
for i in range(1,10000):
    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())
flag = 0
for i in range(10*b, 10*(b + 1)):
    if int(i * 0.08) == a:
        flag = 1
        break
if flag:
    print(i)
else:
    print('-1')

Submission status: Accepted

Solution code:
A, B = map(int, input().split()) 
aaa = []
for i in range(1, 1251):
  if int(i*0.08) == A and int(i*0.1) == B:
    aaa.append(i)
    break
if A < 0 or B < 0:
  print(-1)
elif len(aaa) >= 1:
  print(min(aaa))
else:
  print(-1)

Submission status: Accepted

Solution code:
import math

a,b=map(int,input().split())
A=a/0.08
B=(a+1)/0.08
C=b/0.1
D=(b+1)/0.1

P=max(A,C)
Q=min(B,D)
if math.ceil(P)<Q:
    print(math.ceil(P))
else:
    print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b= map(int, input().split())
z=-1
x=int(a*12.5)
xx=int((a+1)*12.5)
y=b*10
yy=(b+1)*10
if x!=a*12.5:
    x=x+1
if xx==(a+1)*100/8:
    xx=xx-1
xxx= [i for i in range(x,xx+1)]
yyy= [i for i in range(y,yy)]
for i in range(len(xxx)):
    if xxx[i] in yyy:
        z=xxx[i]
        break
print(z)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
mi = lambda : map(int,input().split())

a,b = mi()

for i in range(1,1002):
    if((int(i*0.08) == a) & (int((i*0.1)) == b)):
        print(i)
        break
else:
    print('-1')

Submission status: Accepted

Solution code:
import math

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

val1 = math.floor(a / 0.08)
val2 = math.floor(b / 0.1)
ans = []

for i in range(0, 1250):
    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)

Submission status: Accepted

Solution code:
import math
import sys

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

temp = B * 10

for element in range(0, 10):
    if math.floor((temp + element) * 0.08) == A:
        print(str(temp + element))
        sys.exit(0)
        
print("-1")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a,b = [int(i)for i in input().split()]
lower1 = math.floor(a/0.08)
upper1 = math.floor((a+1)/0.08)
lower2 = math.floor(b/0.1)
upper2 = math.floor((b+1)/0.1)
if math.floor(lower1*0.08)!=a:
    lower1+=1
if math.floor(upper1*0.08)!=a:
    upper1-=1
if math.floor(lower2*0.1)!=b:
    lower2+=1
if math.floor(upper2*0.1)!=b:
    upper2-=1
ans = max(lower1,lower2)
if ans<=min(upper1,upper2):
    print(ans)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split(' '))
v_a_min = math.ceil(a * 25 / 2)
v_a_max = math.floor((a + 1) * 25 / 2) if (a + 1) % 2 != 0 else int((a + 1) * 25 / 2) - 1
v_a_set = set(range(v_a_min, v_a_max + 1))
v_b_min = b * 10
v_b_max = (b + 1) * 10 - 1
v_b_set = set(range(v_b_min, v_b_max + 1))

v_set = v_a_set & v_b_set
v = min(v_set) if v_set else -1

print(v)

Submission status: Accepted

Solution code:
import math

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

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

if (ans * 8) // 100 != A or (ans * 10) // 100 != B:
    ans = -1

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=-1
for c in range(10*b,10*(b+1)):
    if int(c*0.08)==a:
        s=c
        break
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ah=(a+1)//0.08
al=ceil(a/0.08)
bh=(b+1)//0.1
bl=ceil(b/0.1)

if ah < al or bh < bl:
    ans = -1
else:
    if (al <= bh and ah >= bl) or (al >= bh and ah <= bl):
        ans = max(al,bl)
    else:
        ans = -1
        
print(ans)

Submission status: Accepted

Solution code:
import sys

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

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

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
n = 1
while True:
  if math.floor(n * 0.08) == a and math.floor(n * 0.1) == b:
    print(n)
    exit()
  elif n == 1000:
    print(-1)
    exit()
  else:
    n = n + 1

Submission status: Accepted

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