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 math
A, B = list(map(int, input().split()))

A_min = math.ceil(A * 25 / 2)
A_max = ((A + 1) * 25 / 2)
if A_max > math.floor(A_max):
    A_max = math.floor(A_max) + 1
else:
    A_max = A_max
A_max = int(A_max)
B_min = B * 10
B_max = (B + 1) * 10
# print(B_min, B_max)
A_list = list(range(A_min, A_max))
B_list = list(range(B_min, B_max))
# print(A_list)
# print(B_list)

min_ans = -1
for num in A_list:
    if num in B_list:
        min_ans = num
        break
    else:
        continue

print(min_ans)

Submission status: Accepted

Solution code:
import math
a, b = (int(i) for i in input().split())
x = math.ceil(a / 0.08)
flag = False
while math.floor(x * 0.08) == a:
    if (math.floor(x * 0.1) == b):
        flag = True
        break
    x = x + 1
if flag:
    print(int(x))
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b=map(int, raw_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())
N=0
flag=0
while N<1250 and flag==0:
  N += 1
  a = int(N * 0.08 // 1)
  b = int(N * 0.1 // 1)
  #print(N,a,b)
  if a==A and b==B:
    flag = 1
    
if flag==1:
  print(N)
else:
  print(-1)

Submission status: Accepted

Solution code:
from math import floor

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

res = -1
for price in range(1, 10**6):
    if floor(price*0.08) == A and floor(price*0.1) == B:
        res = price
        break

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
l = -1
for num in range(n*10,(m+1)*10+1):
    if int(num * 0.08) == n and int(num * 0.1) == m:
        l = num
        break
    else:
        continue
print(l)

Submission status: Accepted

Solution code:
import sys
import math

read = sys.stdin.readline
S = read()

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

fin = False
for i in range(1000+1):
    if a == math.floor(i * 0.08):
        if b == math.floor(i * 0.1):
            print(i)
            fin = True
            break
if not fin:
    print(-1)

Submission status: Accepted

Solution code:
import math

a, b = list(map(int, input().split()))
result = -1
end_flag = False
for i in range(1, 1251):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 1001):
                y = math.floor(j * 0.1)
                if i == j:
                    if int(y) == b:
                        result = i
                        end_flag = True
                        break
print(result)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
a_min = int(a / 0.080 + 0.9)
a_max = int((a + 0.9) / 0.080)
b_min = int(b / 0.100 + 0.9)
b_max = int((b + 0.9) / 0.100)
if a_max < b_min or b_max < a_min:
    ans = -1
elif a_min <= b_min:
    ans = b_min
elif b_min <= a_min:
    ans = a_min
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#C消費税
h,j = map(int,input().split())
s=int(h*(25/2))
while True:
    hh=int(s*(2/25))
    jj=int(s/10)
    if(hh==h and jj==j):
        print(s)
        exit()
    if(hh>h and jj>j):
        print(-1)
        exit()
    s+=1

Submission status: Accepted

Solution code:
import math

s = input()

ss = s.split(" ")

TAX_A = 0.08
TAX_B = 0.1

A = int(ss[0])
B = int(ss[1])

ans = 10000
re = False
for i in range(10000,0,-1):
  tax_a = math.floor( i * TAX_A ) 
  tax_b = math.floor( i * TAX_B )
  if tax_a == A and tax_b == B:
    if i < ans :
      ans = i
      re = True

if re == True:
  print( ans )
else:
  print(-1)

Submission status: Accepted

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

x = 9
while True:
  if a == int(x * 0.08) and b == int(x*0.1):
    print(x)
    break
  elif a < int(x * 0.08) and b < int(x*0.1):
    print(-1)
    break
  x += 1

Submission status: Accepted

Solution code:

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

x1 = -(-a //0.08)
x2 = -(-b //0.1)
counter = int(max(x1,x2))
for i in range(1,counter+1):
  y1 = int(i * 0.08)
  y2 = int(i * 0.1)
  if y1 == a and y2 == b:
    print(i)
    exit()
print("-1")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
AB = list(map(int, input().split()))

N2min = AB[1] * 10
N2max = AB[1] * 10 + 9

N1min = int(AB[0] * 12.5)
N1max = int((AB[0] + 0.9) * 12.5)
if (N2min <= N1max) and (N1min <= N2max):
    if (N1min < N2min):
        print(N2min)
    else:
        i = 0
        while (int((N1min - i) * 0.08) == AB[0]):
            i += 1
        print(N1min - i + 1)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
 
def main():
  a, b = list(map(int, input().split()))
  
  for i in range(a, 1099):
    if not math.floor(i * 0.08) == a:
      continue
    if not math.floor(i * 0.1) == b:
      continue
    return i
  
  return -1
  
print(main())

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
m=b*10
n=m
result=-1
while math.floor(n*0.1)==b:
  if math.floor(n*0.08)==a:
    result=n
    break
  n+=1
print(result)

Submission status: Accepted

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

a1 = ceil(12.5 * a)
if a % 2 == 0:
    a2 = floor(12.5 * (a + 1))
else:
    a2 = 12.5 * (a + 1) - 1

b1 = 10 * b
b2 = 10 * (b + 1) - 1

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
import math
ans=-1
for x in range(10,1001):
    s=math.floor(x*0.08)
    t=math.floor(x*0.10)
    if s==a and t==b:
        ans=x
        break
print(ans)

Submission status: Accepted

Solution code:
import math
a,b=map(float,input().split())
for i in range(1,1001):
    if math.floor(i*(1.08))-i==a and math.floor(i*(1.10))-i==b:
        print(i)
        break
    elif i==1000:
        c=-1
        print(c)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
diff = b - a
if diff > 20:
    print(-1)
else:
    x1 = (diff - 1) * 50
    x2 = (diff + 2) * 50
    flg = 0
    for i in range(x1, x2, 1):
        if(math.floor(i * 0.08) == a):
            if(math.floor(i * 0.1) == b):
                print(i)
                flg = 1
                break
    if flg == 0:
        print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

a, b = input_nums()

a_rate = 0.08
b_rate = 0.1

al = int(a / a_rate)
ar = int((a+1) / a_rate)
bl = int(b / b_rate)
br = int((b+1) / b_rate)

ans = 0
if bl <= al and al < br:
    ans = al
elif al <= bl and bl < ar:
    ans = bl
else:
    ans = -1

if not ans == -1 and int(ans*0.08) < a:
    ans += 1
    if int(ans*0.1) > b:
        ans = -1
print(ans)

Submission status: Accepted

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

for x in range(1, 1251):
    A = int(x/100*8)
    B = int(x/10)
    #print(x, A, B)
    if a==A and b==B:
        print(x)
        exit()
print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8

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:
AB = list(map(int, input().split()))
A = AB[0]
B = AB[1]
ans = 0

B_list = [B*10 + i for i in range(10)]

for i in B_list:
  if int((i) * 0.08) == A:
    ans = i
    break

if ans == 0:
  ans = -1

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import numpy as np

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

tax_8 = []
tax_10 = []

for i in range(10001):
  tax_8.append([math.floor(i*0.08)])
  tax_10.append([math.floor(i*0.1)])

tax_8_np = np.array(tax_8)
tax_10_np = np.array(tax_10)

tax_8_candidate = list(np.where(tax_8_np==A)[0])
tax_10_candidate = list(np.where(tax_10_np==B)[0])

candidate = list(set(tax_8_candidate)&set(tax_10_candidate))

if len(candidate)==0:
  print(-1)
else:
  print(int(np.array(candidate).min()))

Submission status: Accepted

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

minA = A / 0.08
maxA = (A+1) / 0.08
minB = B / 0.1
maxB = (B+1) / 0.1

if minB <= minA and minA < maxB: print(int(minA) + (1 if minA > int(minA) else 0))
elif minA <= minB and minB < maxA: print(int(minB) + (1 if minB > int(minB) else 0))
else: print("-1")

Submission status: Accepted

Solution code:
# c = list(map(int, input().split()))
a, b = map(int, input().split())
# a = [list(map(int, list(input()))) for i in range(n)]
# n = int(input())
# x = list(map(int, input().split()))


min_na = int(12.5 * a)
max_na = int(12.5 * (a + 1))
min_nb = int(10 * b)
max_nb = int(10 * (b + 1))

ret = -1
for i in range(min(min_na, min_nb), max(max_na, max_nb) + 1):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        ret = i
        break

print(ret)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
a,b=map(int, input().split())

y = math.floor(b/0.1)

for i in range(y,y+10):
    if math.floor(i * 0.08) == a:
        print(i)
        sys.exit(0)
print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
n=1
a=0
b=0
flag=1

while flag==1:

    if a==A and b==B:        
        flag=0
        print(n)
            
    elif a>A or b>B:
        
        flag=0
        print(-1)
        
    
    else:
        
        n+=1
        a=int(n*0.08)
        b=int(n*0.1)

Submission status: Accepted

Solution code:
import sys

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

for price in range(1, 1251):
    if int(price * 0.08) == a :
        if int(price * 0.1) == b :
            print(price)
            sys.exit()
print(-1)

Submission status: Accepted

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

Amin= A*100/8
AMAX= (A+1)*100/8
Bmin= B*100/10
BMAX= (B+1)*100/10

Alist=[0]*1257
Blist=[0]*1257
ANSlist=[10000]*1257

for i in range(1257):
    if Amin <=i <AMAX:
        Alist[i]=i

for i in range(1257):
    if Bmin <=i <BMAX:
        Blist[i]=i

for i in range(1257):
    if Alist[i]!=0 and Blist[i]!=0:
        ANSlist[i]=i

if min(ANSlist)==10000:
    print(-1)
else:
    print(min(ANSlist))

Submission status: Accepted

Solution code:
# coding: utf-8

import math

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

a_target1 = a / 0.08
a_target2 = (a + 1) / 0.08

b_target1 = b / 0.1
b_target2 = (b + 1) / 0.1


result_list = []

for i in range(math.ceil(a_target1), math.ceil(a_target2)):
    if i >= b_target1 and i < b_target2:
        result_list.append(i)

if result_list == []:
    print(-1)
else:
    result = min(result_list)
    print(result)

Submission status: Accepted

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

if a%2==0:
  lower1=int(a*100/8)
  upper1=(a+1)*100/8
  upper1=max(lower1,int(upper1)-1)  
else:
  lower1=a*(100/8)
  upper1=int((a+1)*100/8)
  if (upper1)-int(lower1)<=1:
    print(-1)
    sys.exit()
  else:
    lower1=int(lower1)+1
    if lower1==upper1:
      print(-1)
      sys.exit()
    else:
      pass
  
lower2=(b)*10
upper2=(b+1)*10

lower=max(lower1,lower2)
upper=min(upper1,upper2)
if upper-lower<1:
  print(-1)
else:
  print(lower)

Submission status: Accepted

Solution code:
import math

a,b = map(int,input().split())
er=a/0.08
el=(a+1)/0.08
tr=b/0.1
tl=(b+1)/0.1
le = []
lt = []
for i in range(math.ceil(er),math.ceil(el)):
  le.append(i)
for i in range(math.ceil(tr),math.ceil(tl)):
  lt.append(i)
if list(set(le)&set(lt)) == []:
  print(-1)
else:
  print(min(list(set(le)&set(lt))))

Submission status: Accepted

Solution code:
A,B=map(float,input().split())
A_min=int(A/8*100)
A_max=int((A+1)/8*100)+1
ans=0
flag=False
if (A+1)*100%8==0:
    A_max=int((A+1)*100/8)
for i in range(A_min,A_max):
    if int(i*0.1)==B:
        ans=i
        flag=True
        break
if int(ans*0.08)!=A:
    ans+=1
if flag:
    print(ans)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
ans = 0
for i in range(1001):
  pay = i * 0.08
  pby = i * 0.1
  if math.floor(pay) == A and math.floor(pby) == B:
    ans = i
    break
  else:
    ans = -1
print(ans)

Submission status: Accepted

Solution code:
from math import ceil

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

a_btm = ceil(a*100/8)
a_top = int((a+1)*100/8)

b_btm = b*10
b_top = (b+1)*10 -1

minn = min(a_btm,a_top,b_btm,b_top)
maxx = max(a_btm,a_top,b_btm,b_top)

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

print(ans)

# ans = -1
# for aa in range(a_btm,a_top):
#     for bb in range(b_btm,b_top):
#         if aa == bb:
#             ans = aa
#             break
#     break

Submission status: Accepted

Solution code:
#coding:utf-8
import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    A,B = LMIIS()
    #A:1.08 B:1.1
    from math import ceil,floor
    # print(A/0.08,B/0.1)
    # print(ceil(A/0.08),ceil(B/0.1))
    # A_min = ceil(A/0.08)
    # A_max = ceil((A+1)/0.08)-1
    # B_min = ceil(B/0.1)
    # B_max = ceil((B+1)/0.1)-1
    # print(A_min,A_max,B_min,B_max)
    for i in range(1,100000):
        if floor(i *0.08) == A and floor(i *0.1) == B:
            print(i)
            return
    print(-1)

    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

def check(A,B):
    for i in range(0,A*8+B*10):
        ans1 = i * 0.08
        ans2 = i * 0.1
        if int(ans1) == A and int(ans2) == B:
            return i
    return -1

print(check(A,B))

Submission status: Accepted

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

eightper = 0.08
tenper = 0.1
ans = -1
for i in range(1,1000+1):
    if int(i*eightper)==a:
        if int(i*tenper)==b:
            ans=i
            break
print(ans)

Submission status: Accepted

Solution code:
a, b = (float(x) for x in input().split())
list8 = []
ans = -1
for i in range(12500):
  if int(i * 0.08) == a:
    list8.append(i)
for j in range(10000):
  if int(j * 0.1) == b:
    if j in list8:
      ans = j
      break
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for i in range(1000):
    c = int((i + 10) * 0.08)
    d = int((i + 10) * 0.10)
    if c == a and d == b:
        if i + 10 > 1000:
            break
        print(i + 10)
        exit()
print('-1')

Submission status: Accepted

Solution code:
import math

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

count = 1
while True:
  if math.floor(count*0.08) == a and math.floor(count*0.1) == b:
    print(count)
    break
  if math.floor(count*0.08) > a or math.floor(count*0.1) > b:
    print('-1')
    break
  count += 1

Submission status: Accepted

Solution code:

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

flag=0
x = 1
while flag<=1:
     AA = int(x*0.08)
     BB = int(x*0.1)
     if AA==A:
         flag=1
         if BB==B:
             flag=2
             break
     elif AA>A:
         x='-1'
         break
     x+=1

print(x)

Submission status: Accepted

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

A, B = map(int, input().split(' '))
A_list = [i/10+A for i in range(0, 10)]
B_list = [i/10+B for i in range(0, 10)]
x, y = 0, 0
a_set = set()
b_set = set()
for a in A_list:
    a_set.add(math.ceil(a/0.08))
for b in B_list:
    b_set.add(math.ceil(b/0.1))
ans_list = list(a_set & b_set)
if len(ans_list) == 0:
    print(-1)
else:
    print(int(min(ans_list)))

Submission status: Accepted

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

# process/output
a = -(-A*100//8)
b = B*10

ans = a
if a < b:
    ans = b

if ans*8//100 == A and ans//10 == B:
    print(ans)
else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = -1
for i in range(1010):
    #print([i, int(i*0.08), int(i*0.1)])
    if (A==int(i*0.08)) & (B==int(i*0.1)):
        ans = i
        break
print(ans)

Submission status: Accepted

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

result = []
for i in range(1, 100000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        result.append(i)

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

Submission status: Accepted

Solution code:
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)
        exit()
print(-1)

Submission status: Accepted

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

n=1
while n<=2*10**4:
  if int(n*0.08)==a and int(n*0.1)==b:
    print(n)
    exit()
  else:
    n+=1
print(-1)

Submission status: Accepted

Solution code:
import math

A,B=(int(x) for x in input().split())
#N=int(input())
#A=list(map(int, input().split()))

a_1=math.ceil(A*12.5)
a_2=math.ceil((A+1)*12.5)
la=list(range(a_1,a_2))

b_1=int(format(B*10 ,'.0f'))
b_2=int(format((B+1)*10 ,'.0f'))
lb=list(range(b_1,b_2))

la_lb_and_list = list(set(la) & set(lb))

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

Submission status: Accepted

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

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

x1 = math.ceil(a / 0.08)
y1 = math.floor((a+1) / 0.08)
if y1 == (a+1) / 0.08:
    y1 -= 1

x2 = math.ceil(b / 0.1)
y2 = math.floor((b+1) / 0.1)
if y2 == (b+1) / 0.1:
    y2 -= 1

if max(x1, x2) > min(y1, y2):
    print(-1)
elif x1 > y1 or x2 > y2:
    print(-1)
else:
    print(max(x1, x2))

Submission status: Accepted

Solution code:
import sys
a,b=map(int,input().split())
for i in range(100000):
    if i*8//100==a and i*10//100==b:
        print(i)
        sys.exit(0)
print(-1)

Submission status: Accepted

Solution code:
from math import floor
A, B = list(map(int, input().split()))
for x in range(1, 1001):
    a = floor(x*0.08)
    b = floor(x*0.1)
    if a==A and b==B:
        print(x)
        break
    else:
        continue
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
# 税がかかる金額A,B
A, B = map(int, input().split())

# 税抜きの候補
a_min_price = math.ceil(A*100/8)
a_over_price = math.ceil((A+1)*100/8)
b_min_price = math.ceil(B*100/10)
b_over_price = math.ceil((B+1)*100/10)

# 除外する組み合わせ
# 片方の最大値が最小値を超える
if((a_over_price <= b_min_price) or (b_over_price <= a_min_price)):
    print(-1)
else:
    if(a_min_price < b_min_price):
        print(b_min_price)
    else:
        print(a_min_price)

Submission status: Accepted

Solution code:
from math import floor
a,b=map(int,input().split())
flag=0
for i in range(1,1005):
	if floor(i*0.08)==a and floor(i*0.1)==b:
		flag=1
		break

if flag==1:
	print(i)
else:
	print(-1)

Submission status: Accepted

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


for i in range(1251):
    if i<1250:
        if int(i*0.08)==a and int(i*0.1)==b:
            print(i)
            break
    elif i==1250:
        print(-1)

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
x_A= int(math.ceil(25/2*A))
x_B= int(math.ceil(10*B))
large_num = x_A if x_A > x_B else x_B
result = 0
if int(large_num*0.08) == A and int(large_num*0.1) == B:
  result = large_num
else:
  result = -1
print(result)

Submission status: Accepted

Solution code:
import math
a, b = list(map(int,input().split()))
ao = a / 0.08
ao1 = (a+1) / 0.08
bo = b * 10
bo1 = (b+1) * 10
if bo <= ao < bo1:
    print(math.ceil(ao))
elif ao <= bo < ao1:
    print(bo)
else:
    print(-1)

Submission status: Accepted

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

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

a_plus = a+1
b_plus = b+1

price_a = int(a*(100/8))
price_aplus = int(a_plus*(100/8))
price_b = int(b*(100/10))
price_bplus = int(b_plus*(100/10))

#配列作成
if is_integer_num(a_plus*(100/8)):
  al = list(range(price_a+1, price_aplus))
else:
  al = list(range(price_a, price_aplus+1))
bl = list(range(price_b, price_bplus))

ans = list(set(al) & set(bl))

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
A_list=[]
B_list=[]
for i in range(1201):
    if int(i*0.08)==A:
        A_list.append(i)
    if int(i*0.1)==B:
        B_list.append(i)
flg=0
for i in A_list:
    if i in B_list:
        print(i)
        flg=1
        break
if flg==0:
    print('-1')

Submission status: Accepted

Solution code:
import math
A,B=list(map(int,input().split()))
ans=-1
start=math.ceil(B*(10))
cntr=start
end=math.ceil((B+1)*(10))
while(cntr<end):
    if(math.floor(cntr*0.08)==A):
        ans=cntr
        break
    else:
        cntr+=1
print(ans)

Submission status: Accepted

Solution code:
import math

A, B = [int(i) for i in input().strip().split()]

# X * 0.08 = A + a (0 <= a < 1)
# X * 0.10 = B + b (0 <= b < 1)

# X = A / 0.08 + a / 0.08
# 12.5*A <= X < 12.5*A + 12.5
#  thus
# 12.5*A <= X < 12.5*(A+1)
# 10  *B <= X < 10  *(B+1)
#   and A <= B

if 12.5*(A+1) <= 10*B:
  print(-1)
elif 10*(B+1) <= 12.5*A:
  print(-1)
else:
  X_min = max(12.5*A, 10*B)
  X_max = min(12.5*(A+1), 10*(B+1))
  if X_min <= X_max:
    if math.ceil(X_min) <= math.floor(X_max):
      print(math.ceil(X_min))
    else:
      print(-1)
  else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
[A, B] = list(map(int, input().split()))
flag = False
for i in range(1001):
  if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
    ans = i
    flag = True
    break

if flag:
  print(ans)
else:
  print(-1)

Submission status: Accepted

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
a ,b =i2()
n = int(a//0.08)
m = int(b//0.1)
for i in range(n+1,2*n):
    for j in range(m+1,2*m):
        if i == j and math.floor(i*0.08) == a  and b == math.floor(j*0.1):
            print(i)
            exit()
print(-1)

Submission status: Accepted

Solution code:
import math

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

ans = -1

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

Submission status: Accepted

Solution code:
import math

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

tax8 = math.floor(c/0.08)
tax10 = int(d / 0.1)
ans = tax10
flag = True

while math.floor(ans * 0.1) == d:
    if math.floor(ans*0.08) == c and math.floor(ans * 0.1) == d:
        print(ans)
        flag = False
        break
    else:
        ans += 1

if flag:
    print(-1)

Submission status: Accepted

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


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

print(-1)

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split(' '))
    result = -1
    for i in range(1, 1001):
        if int(i * 0.1) == B:
            if int(i * 0.08) == A:
                result = i
                break
    print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

ans = -1

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
x_a = int((A-1) * 100 / 8)
x_b = int((B+1) * 100 / 10)
l = [i for i in range(min(x_a, x_b)-1, max(x_a, x_b)+1)]
for n in l:
    if int(n * 0.08) == A and int(n * 0.10) == B:
        print(n)
        break
else:
    print(-1)

Submission status: Accepted

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

import math

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

if ans == 0:
  print(-1)

Submission status: Accepted

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

while 1:
  to += 100
  c = int(to * 0.08)
  d = int(to * 0.1)
  if c >= a and d >= b:
    to -= 100
    while 1:
      to += 1
      c = int(to * 0.08)
      d = int(to * 0.1)
      if c == a and d == b:
        print(to)
        exit()
      elif to % 100 == 0:
        print(-1)
        exit()

Submission status: Accepted

Solution code:
import math

a,b = (int(x) for x in input().split())
if (a*100)%8 == 0:
  amin = int(a/0.08)
else:
  amin = math.ceil(a/0.08)
if ((a+1)*100)%8 == 0:
  amax = int((a+1)/0.08)-1
else:
  amax = math.floor((a+1)/0.08)

if (b*100)%10 == 0:
  bmin = int(b/0.1)
else:
  bmin = math.ceil(b/0.1)
if ((b+1)*100)%10 == 0:
  bmax = int((b+1)/0.1)-1
else:
  bmax = math.floor((b+1)/0.1)
  
if amax < bmin or bmax < amin:
  print(-1)
else:
  la = list(range(amin,amax))
  lb = list(range(bmin,bmax))
  print(min(set(la) & set(lb)))

Submission status: Accepted

Solution code:
a,b=list(map(int,input().split()))
B=[10*b + i for i in range(10)]
for j in range(10):
    if int(B[j]*0.08)==a:
        print(B[j])
        exit()
print('-1')

Submission status: Accepted

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

a, b = MAP()

x1 = a / 0.08
y1 = b /0.1
x2 = (a+1) / 0.08
y2 = (b+1) /0.1


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

Submission status: Accepted

Solution code:
import math
def main(a,b):
    p_min = math.ceil((12.5)*a)
    q_min = 10*b
    if p_min > q_min:
        ans = p_min
        if int(ans/10) == b:
            return ans
        return -1
    else:
        ans = q_min
        if int(ans/12.5) == a:
            return ans
        return -1

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

Submission status: Accepted

Solution code:
def input_int_list():
    return [int(thing) for thing in input().split(" ")]
def No():
    print(-1)
    exit()
def eight(x):
    return int(x*0.08//1)
def ten(x):
    return int(x*0.1//1)

A,B=input_int_list()

for i in range(1,1009):
    if eight(i)==A and ten(i)==B:
        print(i)
        exit()
No()

Submission status: Accepted

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

for i in range(2000):
    ans88=int(i*0.08)
    ans1010=int(i*0.1)

    if(ans88==A and ans1010==B):
        print(i)
        exit()

print("-1")

Submission status: Accepted

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

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

min = -1

for i in range(1251):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        min = i
        break

print(min)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
cost_A=math.ceil(A/0.08)
cost_B=B*10
if cost_B<cost_A:
    ans=cost_B
    while math.floor(ans*0.08) < A:
        ans+=1
        if math.floor(ans*0.1) >B:
            ans=-1
            break
elif cost_A<cost_B:
    ans=cost_A
    while math.floor(ans*0.1)<B:
        ans+=1
        if math.floor(ans*0.08) >A:
            ans=-1
            break
else:ans=cost_B
print(ans)

Submission status: Accepted

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