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

m = -((-a*25)//2)
M = -(-(a+1)*25)//2


def check(x, b):
    ans = True
    if x < 10*b or 10*(b+1) <= x:
        ans = False
    return ans


ans = -1
for x in range(m, M):
    if(check(x, b)):
        ans = x
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
Ra,Rb = math.ceil(A/0.08), math.ceil(B/0.1)
if Ra == Rb:
  print(Ra)
  exit()
if Ra < Rb:
  if math.floor(Rb*0.08) == A:
    print(Rb)
  else:
    print(-1)
  exit()
else:
  if math.floor(Ra*0.1) == B:
    print(Ra)
  else:
    print(-1)
  exit()
print(-1)

Submission status: Accepted

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

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

if ans < 1299:
    print(str(ans))
else:
    print('-1')

Submission status: Accepted

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

flag=False
for x in range(1,1263):
  if int(x*0.08)==a and int(x*0.10)==b:
    print (x)
    flag=True
    break
if flag==False:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

print('-1')

Submission status: Accepted

Solution code:
import sys

a, b = map(int, input().split())
for i in range(1251):
    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())
if a>b:
    print(-1)
else:
    p=a/0.08
    q=(a+1)/0.08
    r=b/0.1
    s=(b+1)/0.1
    if q<=r or s<=p:
        print(-1)
    else:
        if r<=p and q<=s:
            if p%1==0:
                print(int(p))
            else:
                print(int(p//1+1))
        elif p<=r and s<=q:
            if r%1==0:
                print(int(r))
            else:
                print(int(r//1+1))
        elif p<=r and q<=s:
            if r%1==0:
                print(int(r))
            else:
                if r//1+1<=q:
                    print(int(r//1+1))
                else:
                    print(-1)
        elif r<=p and s<=q:
            if p%1==0:
                print(int(p))
            else:
                if p//1+1<=s:
                    print(int(p//1+1))
                else:
                    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b  =map(int,input().split())
c = b*10
lis = []
d = range(c,c+10)
l = list(d)
for j in l:
    if int(j*0.08)==a:
        lis.append(j)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())
mn = max(100 * a, 80 * b)
mx = min(100 * a + 99, 80 * b + 72)
print((mn + 7) // 8 if mn <= mx else -1)

Submission status: Accepted

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

x = a * 100 / 8
if int(x) < x:
    x = int(x)+1
else:
    x = int(x)
y = b * 100 / 10
if int(y) < y:
    y = int(y)+1
else:
    y = int(y)

while x * 10 // 100 < b and x * 8 // 100 == a:
    x += 1
    
if x * 10 // 100 == b and x * 8 // 100 == a:
    print(x)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split(" "))
x_min = a / 0.08
x_max = (a + 1) / 0.08
y_min = b / 0.10
y_max = (b + 1) / 0.10


lower = math.ceil(max([x_min, y_min]))
upper = math.floor(min([x_max, y_max]))
if lower < upper:
    print(lower)
else:
    print("-1")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
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)
        break
else:print(-1)

Submission status: Accepted

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

for i in range(1001):
    if i*0.08//1==a and i*0.10//1==b :
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
mi8 = -(-A*25//2)
ma8 = -(-(A+1)*25//2)
mi10 = -(-B*10)
ma10 = -(-(B+1)*10)
mi = max(mi8, mi10)
ma = min(ma8, ma10)
if mi >= ma:
    answer = -1
else:
    answer = mi

print(answer)
# 58

Submission status: Accepted

Solution code:
from math import floor

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

for i in range(1200):
    if floor(i * 0.08) == a and floor(i * 0.1) == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

count = 0
for x in range(1, 10010):
    if A/0.08 <= x and B/0.1 <= x and x < (A+1)/0.08 and x < (B+1)/0.1:
        print(x)
        count += 1
        break

if count == 0:
    print("-1")

Submission status: Accepted

Solution code:
import sys

A, B = list(map(int, input().split()))
a = int(A/0.08)
b = int(B/0.1)

if a > b: a, b = b, a

a -= 1
b += 1

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

Submission status: Accepted

Solution code:
list = []
A,B = map(int ,input().split())
for i in range(13,10001):
    if int(i*0.08) == A and int(i*0.10) == B:
        print(i)
        break
else:
    print("-1")

Submission status: Accepted

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

for i in range(1300):
  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 sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
for x in range(1, 10001):
    if x * 8 // 100 == A and x * 10 // 100 == B:
        print(x); exit()

print(-1)

Submission status: Accepted

Solution code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

import math

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

result = -1
for i in reversed(range(0, 1250)):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        result = i
print(result)

Submission status: Accepted

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

q = 10*b
r = -1
while(q/10 == b):
	if int(q *0.08) == a:
		r = q
		break
	q+=1
print r

Submission status: Accepted

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

for i in range(0, 1250+1):

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

ans = -1
for x in range(10000, 0, -1):
    ta, tb = x*8//100, x*10//100
    if a == ta and b == tb:
        ans = x

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

import math
a,b = LI()
tax8 = [i for i in range(math.ceil(100/8*a), int(100/8*(a+1)))]
tax10 = [i for i in range(math.ceil(100/10*b), int(100/10*(b+1)))]
# print(tax8,tax10)
c = max(tax8[0], tax10[0])
if c in tax8 and c in tax10:
    print(c)
else:
    print(-1)

Submission status: Accepted

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

import math
x = math.ceil(A / 0.08)
#print(x)

y = math.ceil(B / 0.1)
#print(y)

if x == y:
    print(int(x))
    exit()

if y < x:
#    print("y < x")
    while y < x:
        y += 1
        z = y * 0.1
    if z >= B + 1:
        print(-1)
        exit()
    else:
        print(int(x))
        exit()

if y > x:
#    print("y > x")
    while y > x:
        x += 1
        z = x * 0.08
    if z >= A + 1:
        print(-1)
        exit()
    else:
        print(int(y))
        exit()

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:
a,b = map(int,input().split())   
c = -1
for i in range(10000):
    if int(i*0.08) == a and int(i*0.1) == b :
        c = i
        break
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        a,b=map(int, input().split())
        for i in range(13,1250):
            if (i*8)//100==a and (i*10)//100==b:
                return i
        return -1
    print(main())
resolve()

Submission status: Accepted

Solution code:
def solve(A, B):
    for i in range(1001):
        if int(i * 0.08) == A and int(i * 0.10) == B:
            return i

    return -1


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

Submission status: Accepted

Solution code:
import sys
import math
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        a,b=map(int, input().split())
        for i in range(13,1250):
            if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
                return i
        return -1
    print(main())
resolve()

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.1) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu May  7 01:35:41 2020

@author: shinba
"""

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

for i in range(1,1264):
    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=list(map(int,input().split()))
ans=[]
for i in range(1,1010):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans.append(i)
if ans==[]:
    print(-1)
else:
    print(min(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
A_min = math.ceil(A/0.08)
A_upper = (A+1)/0.08
if (math.floor(A_upper) == A_upper) and (math.ceil(A_upper) == A_upper):
    A_max = math.floor(A_upper-1)
else:
    A_max = math.floor(A_upper)
    
B_min = math.ceil(B/0.1)
B_upper = (B+1)/0.1
if (math.floor(B_upper) == B_upper) and (math.ceil(B_upper) == B_upper):
    B_max = math.floor(B_upper-1)
else:
    B_max = math.floor(B_upper)

if (A_max < B_min) or (B_max < A_min):
    print(-1)
else:
    print(max(A_min, B_min))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
l = [i for i in range(2000) if math.floor(i*0.08) == A and math.floor(i *0.1) == B  ]
if l == []:
    print(-1)
else:
    print(min(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# C - Tax Increase

A, B = map(int, input().split())
for i in range(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


def resolve():
    A, B = map(int, input().split())

    for i in range(10000):
        tmp_8 = math.floor(i * 0.08)
        tmp_10 = math.floor(i * 0.1)

        if (tmp_8 > 0 and tmp_10 > 0 and tmp_8 == A and tmp_10 == B):
            print(i)
            return

    print(-1)


resolve()

Submission status: Accepted

Solution code:
import sys
import math
a,b=map(int,input().split())
for i in range(1,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 sys
a,b=map(int,input().split())
i=0
while True:
    kouho=10*b+i
    if kouho//10 > b:
        print("-1")
        sys.exit()

    if int(kouho*0.08) == a:
        print(kouho)
        sys.exit()
    i+=1

Submission status: Accepted

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

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

Submission status: Accepted

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

Xmin = math.ceil(A / 0.08)
Xmax = (A + 1) / 0.08
Ymin = math.ceil(B / 0.1)
Ymax = (B + 1) / 0.1

if (Xmin > Ymin):
    if (Xmin < Ymax):
        print(Xmin)
        sys.exit(0)
else:
    if (Ymin < Xmax):
        print(Ymin)
        sys.exit(0)
print("-1")

Submission status: Accepted

Solution code:
import math
import sys

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

for product in range(1, 1251):
    if (math.floor(product * 0.08) == a) and (math.floor(product * 0.1) == b):
        print(product)
        sys.exit()

print(-1)

Submission status: Accepted

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

import math

X_MIN_FROM_A = math.ceil(A / 0.08)
X_MAX_FROM_A = math.ceil((A + 1) / 0.08)

ans_set_from_a = set(range(X_MIN_FROM_A, X_MAX_FROM_A))

X_MIN_FROM_B = math.ceil(B / 0.10)
X_MAX_FROM_B = math.ceil((B + 1) / 0.10)

ans_set_from_b = set(range(X_MIN_FROM_B, X_MAX_FROM_B))

ans_set = ans_set_from_a & ans_set_from_b

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
k=[]
o=[]
p=[]
for i in range(1,5000):
    if int(i*0.08)==a:
        k.append(i)
for j in range(1,5000):
    if int(j*0.1)==b:
        o.append(j)
for t in range(len(k)):
    for u in range(len(o)):
        if k[t]==o[u]:
            p.append(k[t])
if p==[]:
    print(-1)
else:
    print(min(p))

Submission status: Accepted

Solution code:
tax1, tax2 = map(int,input().split())

def _tax(tax,rate):
  return (100*tax)/rate, (100*(tax+1))/rate

tax1_m, tax1_u = _tax(tax1, 8)
tax2_m, tax2_u = _tax(tax2, 10)

import math
if tax1_m < tax2_u and tax2_m < tax1_u:
  print(math.ceil(max(tax2_m, tax1_m)))
else:
  print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

N_list = [i for i in range(1, 1251)]
for i in N_list:
  if int(0.08*i) == A and int(0.1*i) == B:
    print(i)
    exit()
print(-1)

Submission status: Accepted

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

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

a = int(A // 0.08) + 1
b = int(B // 0.1) + 1

ab = []
ab.append(min(a, b))
ab.append(max(a, b))

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

print('-1')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

from math import floor

def solve():
    a, b = MI()

    for i in range(10000):
        x = floor(i * 0.08)
        y = floor(i * 0.1)
        if x == a and y == b:
            print(i)
            return
    print(-1)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
A, B = [int(_) for _ in input().split()]
for x in range(1, 2000):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

A,B = (int(x) for x in input().split())
result = False
y = math.ceil(A * 12.5)
z = math.floor((A+1)*12.5)
#if B >= A:

for h in range(y,z):
    #print(h)
    if result == True:
        break

    for i in range(B*10 ,(B+1)*10):
       
        if i == h:
            result = True
            break
       
if result == True:
    print(i)
else:
    print(-1)

Submission status: Accepted

Solution code:

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

c =0 
for n in range(0,10000):
    taxa = int(n*8/100)
    taxb = int(n*10/100)
    if a == taxa and b == taxb:
        print(n)
        break
    else:
        c += 1
if c > 9999:
    print(-1)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  # '123' -> 123
def Is(): return map(int, input().split())  # '123 456' -> 123, 456
def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]
def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']
def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

a, b = Is()
ax = a * 12.5  # /0.08
bx = b * 10    # /0.1
# print(ax, bx)
for i in range(floor(bx-15), floor(bx-15)+40):
    # print(i, floor(i*0.08), floor(i*0.1))
    if a == floor(i*0.08) and b == floor(i*0.1):
        print(i)
        exit()

print("-1")

Submission status: Accepted

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

ans = -1
for i in range(1010):
    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())

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

if flag:
    print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

from math import floor

for x in range(1,1200):
    if floor(0.08*x) == a and floor(0.1*x) == b:
        print(x)
        exit()
print(-1)

Submission status: Accepted

Solution code:
"""
a = int(x*0.08)
a <= x*0.08 < a+1
a/0.08 <= x < (a+1)/0.08

b = int(x*0.1)
b <= x*0.1 < b+1
b/0.1 <= x < (b+1)/0.1
"""

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
a,b = [int(i) for i in readline().split()]

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

Submission status: Accepted

Solution code:
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=q
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)

a,b = readInts()
for x in range(10*b,10*b+10):
	if math.floor(x*0.08)==a:
		print(x)
		exit()

print(-1)

Submission status: Accepted

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

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

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

a_list = set(list(range(a_min, a_max, 1)))
b_list = set(list(range(b_min, b_max, 1)))

ab_list = a_list & b_list
if len(ab_list) > 0:
    print(min(ab_list))
else:
    print(-1)

Submission status: Accepted

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


def main():
    A, B = map(int, input().split())
    assert A <= 100
    assert B <= 100
    for i in range(1000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit()
    print("-1")


if __name__ == '__main__':
    main()

Submission status: Accepted

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


def main():
    A, B = map(int, input().split())
    for i in range(1000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit()
    print("-1")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ret = -1
for i in range(1000 + 1):
  if i * 0.08 // 1 == a and i * 0.1 // 1 == b:
    ret = i
    break
print(ret)

Submission status: Accepted

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

    for i in range(0, 1251):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            print(i)
            return

    print(-1)
    
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
rA = set(range(int((A-0.001)//0.08 + 1), int((A+0.999)//0.08 + 1)))
rB = set(range(int((B-0.001)//0.1 + 1), int((B+0.999)//0.1 + 1)))
if len(rA & rB) == 0:
    print(-1)
else:
    print(min(rA & rB))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

a , b = map(int, input().strip().split())
ans = -1

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

print(ans)

Submission status: Accepted

Solution code:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()
flag = 0
for i in range(1, 10**6):
    if((i*8)//100==a and (i*10)//100==b):
        print(i)
        flag = 1
        break

if(flag==0):
    print(-1)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
i=1
while i<=10000:
  if (int(i * 0.08) == A) & (int(i * 0.10) == B):
    print(i)
    exit()
  i+=1
print(-1)

Submission status: Accepted

Solution code:
from math import floor

a, b = map(int, input().split())
for x in range(1, 1300):
    if floor(x * 0.08) == a and floor(x * 0.1) == b:
        print(x)
        raise SystemExit(0)
print(-1)

Submission status: Accepted

Solution code:
ratio_8,ratio_10 = map(int,input().split())
min = 10000
for price in range(1,1010):
  if int(price*0.08) == ratio_8 and int(price*0.1) == ratio_10:
    if min > price:
      min = price

print(min) if min < 10000 else print("-1")

Submission status: Accepted

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

ans = -1
for i in range(10*b, 10*(b+1)):
    if math.floor(i*0.08) == a:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
c=[]
for x in range(10*B,10*B+10):
  if A/0.08<=x<(A+1)/0.08:
    c.append(x)
if c==[]:
  print(-1)
else:
  print(c[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def tax8(n):
    return list(range(int((n-1)*(25/2)),int((n+1)*(25/2))))
    
def tax10(n):
    return list(range(int((n-1)*(10/1)),int((n+1)*(10/1))))

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

ans = -1

x = []

x.extend(tax8(a))
        
y = []

y.extend(tax10(b))

for i in x:
    if i in y:
        if int(i*(27/25))-i == a and int(i*(11/10))-i == b:
            ans = i
            break
    
print(ans)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
tmp_a = math.ceil(a / 0.08)
tmp_b = int(b / 0.1)
if a % 2 == 0:
    set_a = set([i for i in range(tmp_a, tmp_a+13)])
else:
    set_a = set([i for i in range(tmp_a, tmp_a+12)])
set_b = set([i for i in range(tmp_b, tmp_b+10)])
if len(set_a & set_b) == 0:
    print(-1)
else:
    print(min(set_a & set_b))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
Aset=set([int(i) for i in range(1,1010) if int(i*0.08)==A])
Bset=set([int(i) for i in range(1,1010) if int(i*0.1)==B])
if Aset&Bset :
    print(min(Aset&Bset))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
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:
    ans=i
    break
  else:
    ans=-1
print(ans)

Submission status: Accepted

Solution code:
import math

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

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

if f==0:
    print(-1)

Submission status: Accepted

Solution code:
import math


def main():
    A, B = list(map(int, input().split(' ')))
    price = 1
    answer = -1
    while True:
        tax_008 = math.floor(0.08 * price)
        tax_010 = math.floor(0.1 * price)
        if tax_008 > A or tax_010 > B:
            break
        if tax_008 == A and tax_010 == B:
            answer = price
            break
        price += 1
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
X=10001
c=[]

for i in range(10,X):
  if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
    c.append(i)

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