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())
j = False
for i in range(1, 1010):
  if int(i * 0.08) == A and int(i * 0.1) == B:
    j = True
    break
if j:
  print(i)
else:
  print(-1)

Submission status: Accepted

Solution code:
def solve(a, b):
    for x in range(3000):
        if 0 <= (x*0.08 - a) < 1 and 0 <= (x*0.1 - b) < 1:
            return x
    return -1

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

Submission status: Accepted

Solution code:
inp = input().split()
a = int(inp[0])
b = int(inp[1])

def check(a, b):
    for i in range(1,1001):
        if (a<=i*0.08) and (a+1>i*0.08):
            if (b<=i*0.1) and (b+1>i*0.1):
                return i
    return -1

print(check(a, b))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

i = math.floor(A / 0.08)
while i < 10001:
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        break
    i += 1
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
for ans in range(1,10**6+1):
    if ans * 0.8 //10 == A and  ans // 10 == B:
        print(ans)
        quit()
print(-1)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(-1)

Submission status: Accepted

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

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

print(ans)

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def mm(a, b):
    m, r = divmod( (a*(10/100)) ,  (8/100) )

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


def slow(a, b):
    for x in range(1, 1000000):
        ac = int(x*0.08)
        bc = int(x*0.1)
        if (a == ac and b == bc):
            return x
    return -1


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

print(slow(a, b))

Submission status: Accepted

Solution code:
tax_a, tax_b = map(int, input().split())
ans = tax_b * 10

for i in range(9):
    if int(ans * 0.08) == tax_a:
        print(ans)
        break
    else:
        ans += 1
else:
    print('-1')

Submission status: Accepted

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

Submission status: Accepted

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

print(-1)

Submission status: Accepted

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

for n in range(10000):

    za = n*8//100
    zb = n*10//100

    if A == za and B == zb:
        print(n)
        exit(0)

print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
z,x,c,v=10*b,10*b+10-1,50*a//4,50*(a+1)//4-1
for i in range(max(z,c),min(x,v)+1):
  if i*8//100==a and i//10==b:print(i);exit()
else:print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
for i in range(20000):
    if (math.floor(i * 8 / 100), math.floor(i / 10))\
        == (a, b):
        print(i)
        exit()
    
print(-1)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
for i in range(10**5):
    a=math.floor(i*0.08)
    b=math.floor(i*0.10)
    if a==A and b==B:
        print(i)
        exit()
    if a>A or b>B:
        print(-1)
        exit()

Submission status: Accepted

Solution code:
A, B =list(map(int, input().split()))
i=0
for N in range(1,1001):
    N_a=int(N*0.08)
    N_b=int(N*0.1)
    
    if A==N_a and B==N_b:
        print(N)
        i+=1
        break
if i==0:
    print(-1)

Submission status: Accepted

Solution code:
flag = False
a,b=(int(x) for x in input().split())
for i in range(1,1010):
    mul_1 = int(i*0.08)
    mul_2 = int(i*0.1)
    #print(mul_1)
    if a==mul_1 and b == mul_2:
        flag = True
        print(i)
        if flag == True:
            break
        

else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for i in range(1010):
    if int(i * 0.08) == a and int(i*0.1) == b:
        print(i)
        sys.exit(0)

print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

r = -1

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

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

#print(Alow,Ahi,Blow,Bhi)

Aran = [i for i in range(Alow,Ahi+1) if int(i*0.08) == A]
Bran = [i for i in range(Blow,Bhi+1) if int(i*0.10) == B]


resRan = sorted(list(set(Aran) & set(Bran)))
#print(resRan)
if len(resRan) !=0:
  print(resRan[0])
else:
  print(-1)

Submission status: Accepted

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

for i in range(1010):
    s = math.floor(i*0.08)
    t = math.floor(i*0.10)
    if s == a and t == b:
            print(i)
            break
else:
    print(-1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(0,10):

  if math.floor((b*10+i)*0.08)==a:
    print(b*10+i)
    exit()
print("-1")

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
flag=True
ans=0
for i in range(b * 10,b * 10+9):
    if math.floor(i * 0.08) == a:
        flag = False
        ans = i
        break
if flag:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
import math
a = list(map(int,input().split()))
ans = -1
n = a[0] * 12 - 1
for i in range(n,1001):
    a0 = i * 0.08
    a0 = math.floor(a0)
    a1 = i * 0.1
    a1 = math.floor(a1)
    if (a0 == a[0]) and (a1 == a[1]):
        ans = i
        break
print(ans)

Submission status: Accepted

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

m = B * 10
for i in range(m, m + 10):
    if i * 8 // 100 == A:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import math


def main():
    A, B = map(int, input().split())
    la = []
    lb = []
    for i in range(2000):
        if math.floor(i * 0.08) == A:
            la.append(i)
        if math.floor(i * 0.1) == B:
            lb.append(i)
    for sla in la:
        if sla in lb:
            return sla
    return -1


print(main())

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b =input().split()
A = int(a)
B = int(b)
N = []
for i in range(1300):
  if int(i * (8/100)) == A and int(i*(10/100)) == B:
    N.append(i)
if len(N)==0:
    print(-1)
else:
    print(min(N))

Submission status: Accepted

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

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

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

A,B = map(int, input().split())
tmp1 = int(np.ceil(A/0.08))
tmp2 = int(B/0.1)

if tmp1>=tmp2:
    max=tmp1
    if int(np.floor(max*0.1))==B:
        print(max)
    else:
        print(-1)
else:
    max=tmp2
    if int(np.floor(max*0.08))==A:
        print(max)
    else:
        print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b =map(int, input().split())
ans = []
for i in range(1,10**4+1):
  if int(i * (8/100)) == a and int(i*(10/100)) == b:
    ans.append(i)
  if len(ans) >= 2:
    break
print('-1' if ans == [] else min(ans))

Submission status: Accepted

Solution code:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    a, b = list(map(int, input().rstrip('\n').split()))
    for i in range(1, 1500):
        if int(i * 0.08) == a and int(i * 0.1) == b:
            print(i)
            exit()
    print(-1)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

price_A = math.ceil(A/0.08)
price_A_max = math.floor(price_A+12.5)
cnt = 0
for i in range(price_A, price_A_max):
	if math.floor(i*0.1)==B:
		cnt = 1
		print(i)
		break
if cnt == 0:
	print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,5000):
  if (i*8)//100==A and (i*10)//100==B:
    print(i)
    sys.exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Alist=[i for i in range(ceil(A/0.08),int((A+1)/0.08))]
Blist=[i for i in range(ceil(B/0.1),int((B+1)/0.1))]

if set(Alist)&set(Blist):
  print(min(set(Alist)&set(Blist)))
else:
  print("-1")

Submission status: Accepted

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

from sys import stdin, stderr

def main():
   A, B = map(int, stdin.readline().split())
   p = 1
   res = -1
   while True:
      a = (p * 8) / 100
      b = (p * 10) / 100
      if a > A or b > B:
         break
      if a == A and b == B:
         res = p
         break
      p += 1

   print(res)

   return 0

if __name__ == '__main__': main()

Submission status: Accepted

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

for i in range(1,1101):
    a1 = int( math.floor( i * 0.08 ) )
    if a1 == a:
        b1 = int( math.floor( i * 0.10 ) )
        if b1 == b:
            print(i)
            exit()
print(-1)

Submission status: Accepted

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

res = -1
for i in range(1000,0,-1):
    if (i*8)//100 == A and (i*10)//100 == B:
        res = i

print(res)

Submission status: Accepted

Solution code:
a,b = [int(i) for i in input().split()]

flg  = False
for i in range(1,1009):
    a_s = int(i * 0.08)
    b_s = int(i * 0.1)
    
    if (a_s == a) and (b_s == b):
        ans = i
        flg = True
        break
        
print(ans if flg else '-1')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
max = 1001 # これ以上の値は絶対に条件Bを満たさない。
for i in range(1, max):
    if int(i * 0.08) == A and int(i * 0.1) == 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(1,10001):
    aa = math.floor(i*0.08)
    bb = math.floor(i*0.1)
    if aa == a and bb == b:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
minV = math.ceil(A / 0.08)
maxV = int((A + 1) / 0.08)
for i in range(minV, maxV):
    if int(i * 0.1) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = -1
for i in range(1001):
    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())
 
min_8 = math.ceil(A  * 12.5)
max_8 = math.ceil((A + 1) * 12.5) -1
min_10 = math.ceil(B * 10)
max_10 = math.ceil((B  + 1) * 10)  -1
 
if (max_10 < min_8 or max_8 < min_10):
    print(-1)
else:
    print(max(min_8,min_10))

Submission status: Accepted

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

for ans in range(10**5):
	ta = math.floor(ans * 0.08)
	tb = math.floor(ans * 0.1)

	if ta == A and tb == B:
		print(ans)
		sys.exit()

print(-1)

Submission status: Accepted

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

for x in range(1010):
    a = x * 8 // 100
    b = x * 10 // 100

    if a == A and b == B:
        print(x)
        quit()

print(-1)

Submission status: Accepted

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

while a >= (magic * 0.08) // 1 and b >= ( magic * 0.1) // 1:
    if a == (magic * 0.08) // 1 and b == ( magic * 0.1) // 1:
        ans = magic
        break
    magic += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1009):
    a = math.floor((i+1)*0.08)
    b = math.floor((i+1)*0.1)
    if  a==A and b==B:
        print(i+1)
        break
    elif i == 1008:
        print("-1")

Submission status: Accepted

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

Submission status: Accepted

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

amax = math.ceil((A + 1) * 12.5) - 1
amin = math.ceil(A * 12.5)
bmax = math.ceil((B + 1) * 10) - 1
bmin = math.ceil(B * 10)

if amin > bmax or bmin > amax:
    print(-1)
else:
    print(int(max(amin, bmin)))

Submission status: Accepted

Solution code:
x,y=map(int, input().split())
import math
x1=math.ceil(x*12.5)
x2=math.ceil((x+1)*12.5)-1
y1=math.ceil(y*10)
y2=math.ceil((y+1)*10)-1
if x1>y2 or y1>x2:
	print (-1)
else:
	print (int(max(x1,y1)))

Submission status: Accepted

Solution code:
import math

A, B = map( int, input().split() )
m, M = B * 10 , A * 13

ans = -1
for x in range( m, M + 1 ):
  if ( math.floor( x * 0.08 ) == A ) and ( math.floor( x * 0.1 ) == B ):
    ans = x
    break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

a,b = map(lambda x: int(x),input().split())
ans = -1
for i in reversed(range(1,1011)) :
    a_ans =int(i *0.08)
    b_ans =int(i *0.1)

    if a == a_ans and b == b_ans :
        ans = i
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines 
MOD = 10**9+7

a, b = map(int, inp().split())
ans = -1
for i in range(10, 1003):
  A = int(i*0.08)
  B = int(i*0.1)
  if A==a and B==b:
    print(i)
    exit()
print(ans)

Submission status: Accepted

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


out = '-1'

for N in range(1, 1100):
    if int(N * 0.08) == A and int(N * 0.1) == B:
        out = N
        break
print(out)

Submission status: Accepted

Solution code:
import math
import numpy as np

a,b=map(int, input().split())
j=-1
flag="No"
for i in range(1,1100):
    if int(i*0.08)==a and int(i*0.10)==b:
        j=i
        flag="Yes"
        break
print(j)

Submission status: Accepted

Solution code:
import sys
from math import floor

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

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

print(-1)

Submission status: Accepted

Solution code:
import math

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

A_min = math.ceil(A/0.08)
A_max = math.ceil((A+1)/0.08)-1
B_min = math.ceil(B/0.1)
B_max = math.ceil((B+1)/0.1)-1

MIN = max([A_min, B_min])
MAX = min([A_max, B_max])

if MIN > MAX:
    print(-1)
    print('\n')
else:
    print(MIN)
    print('\n')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for n in range(1010):
    a1 = int(n * 8/100)
    b1 = int(n * 10/100)
    if a1 == a and b1 == b:
        n1 = n
        break
    else:
        n1 = "-1"
print(n1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Code for C - Tax Increase
# Use input() to fetch data from STDIN
import math
def solve():
    [a, b] = map(int, input().split())
    
    for i in range(1, 1009):
        if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
            print(i)
            return

    print("-1")

solve()

Submission status: Accepted

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

ans =[]
for x in range(10*b+10):
	if a<=x*0.08<a+1 and b<=x*0.1<b+1:
		ans.append(x)
if len(ans) != 0:
	print(min(ans))
else:
	print(-1)

Submission status: Accepted

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    a,b = mi()
    for i in range(2000):
        if floor(i*0.08) == a:
            if floor(i*0.1) == b:
                print(i)
                exit()
    print(-1)




main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding utf-8

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

for i in range(1009):
  if A==int(i*0.08):
    if B==int(i*0.1):
      print(i)
      exit()
print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
def ceil(x):
  if x%1==0:
    return x//1
  else:
    return x//1+1
a1=int(ceil(a*100/8))
a2=int(ceil((a+1)*100/8)-1)
b1=int(ceil(b*100/10))
b2=int(ceil((b+1)*100/10)-1)
count=0
for i in range(a1,a2+1):
  if b1<=i<=b2:
    print(i)
    count=0
    break
  else:
    count+=1
if count!=0:
  print(-1)

Submission status: Accepted

Solution code:
import math

def end():
    print(-1)
    exit()

a, b = map(int, input().split())
if a > b:
    end()

n = a/0.08
m = b/0.1

if n <= m:
    dif = m-n
    if 0 <= dif < 12.5:
        ans = math.ceil(m)
        if ans >= n + 12.5: ans -= 1
        print(ans)
    else:
        end()
    
elif m < n:
    dif = n-m
    if 0 <= dif < 10:
        ans = math.ceil(n)
        if ans >= m + 10: ans -= 1
        print(ans)
    else:
        end()

Submission status: Accepted

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

Submission status: Accepted

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

C = 1009
Min = 1010

while(C > 0):
    a = int(C*0.08)
    b = int(C*0.10)
    t_bool = (a==A and b==B)
    c_bool = (C<Min)
    if t_bool and c_bool :
        Min = C
    C-=1
if Min==1010:
    print(-1)
else:
    print(Min)

Submission status: Accepted

Solution code:
import math as m

a, b = map(int, input().split())
cost = -1
flg = 0

while flg == 0 and cost < 10 ** 6 / 1.5:
    cost += 1
    aAns = m.floor(cost * 0.08)
    bAns = m.floor(cost * 0.1)
    if aAns == a and bAns == b:
        flg = 1
    if a - aAns < 0 or b - bAns < 0:
        break

print(cost if flg == 1 else -1)

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 math
a, b = map(int, input().split())
def tax(price, tax_rate):
  return int(price * (tax_rate / 100))
def range_of_price(tax_rate, target):
  entry_point = math.ceil(target / (tax_rate / 100))
  counter = entry_point
  if tax(entry_point, tax_rate) < target:
    for i in range(100):
      counter += i
      if tax(counter, tax_rate) == target:
        left = counter
        break
    for i in range(100):
      counter += 1
      if tax(counter, tax_rate) > target:
        right = counter - 1
        break
  elif tax(entry_point, tax_rate) == target:
    for i in range(100):
      counter -= i
      if tax(counter, tax_rate) < target:
        left = counter + 1
        break
    counter = entry_point
    for i in range(100):
      counter += 1
      if tax(counter, tax_rate) > target:
        right = counter - 1
        break
  elif tax(entry_point, tax_rate) > target:
    for i in range(100):
      counter -= i
      if tax(counter, tax_rate) == target:
        right = counter
        break
    for i in range(100):
      counter -= i
      if tax(counter, tax_rate) < target:
        left = counter - 1
        break
  #print(left, right)
  return left, right
      
left8, right8 = range_of_price(8, a)
left10, right10 = range_of_price(10, b)
if left8 > right10 or right8 < left10:
  print(-1)
else:
  print(max(left8, left10))