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

for i in range(10**4):
    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:
from math import floor
A, B = map(int, input().split())

ans = 10**9
for i in range(1, 100000):
    a = floor(i * 0.08)
    b = floor(i * 0.1)

    if a == A and b == B:
        ans = min(ans, i)

if ans == 10**9:
    print(-1)
else:
    print(ans)

Submission status: Accepted

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

for i in range(10*b,10*(b+1)):
	if i * 2 // 25 == a:
		print(i)
		exit()
print(-1)

Submission status: Accepted

Solution code:
import math


if __name__ == '__main__':
    a, b = list(map(int, input().split(" ")))
    for i in range(1, 1500):
        # print(i)
        if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
            print(i)
            exit()
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, open(0).read().split())

for i in range(b*10, b*10+10):
    if int(i * .08) == a:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

for n in range(1, 20000):
    a = n * 8 // 100
    b = n * 10 // 100
    if a == A and b == B:
        print(n)
        break
else:
    print(-1)

Submission status: Accepted

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

ans = -1
for i in range(1, 100000):
    h = floor(i * 0.08)
    z = floor(i * 0.1)
    if h == a and b == z:
        ans = i
        break
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key



__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



if __name__ == '__main__':
    A, B = mulinputs()

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

Submission status: Accepted

Solution code:
import math,sys

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

for i in range(100000):
  if math.floor(i * 0.08) == a and math.floor(i / 10) == b:
    print(i)
    sys.exit(0)
    
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

a,b=map(int,input().split())
ma=a*100//8
mb=b*100//10

if ma<mb:
  ta=ma
  tb=mb
else:
  tb=ma
  ta=mb
  
ta=max(0,ta-10)
tb=tb+10

#print(ta,tb)

ans=-1
for i in range(ta,tb+1):
  k=0
  if a==math.floor(i*0.08):
    if b==math.floor(i*0.1):
      ans=i
      k=1
      break
    if k:
      break

print(ans)

Submission status: Accepted

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

#############
# Libraries #
#############

import math
from functools import lru_cache

#############
# Constants #
#############

MOD = 10**9 +7
INF = float('inf')

#############
# Functions #
#############

kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#############
# Main Code #
#############

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

found = 0
for i in range(1,10000):
  if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
    print(i)
    found = 1
    break
    
if not found:
  print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
c=max(a*12.5,b*10)
d=min((a+1)*12.5,(b+1)*10)
if math.ceil(c)<d:
    print(math.ceil(c))
else:
    print(-1)

Submission status: Accepted

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

if k == 0:
    print(-1)

Submission status: Accepted

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

def main():
    a,b=map(int,input().split())
    u=max(floor((a+1)/0.08)+1,floor((b+1)/0.1)+1)
    f=min(floor(a/0.08),floor(b/0.1))
    x=-1
    for i in range(f,u+1):
        if floor(i*0.08)==a and floor(i*0.1)==b:
            x=i
            break
    print(x)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# C - Tax Increase

A, B = map(int, input().split())
ans = -1

for i in range(1, 10101):
    if i*0.08//1==A and i*0.1//1==B:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math
from collections import deque
def main():
    a,b = tuple([int(t)for t in input().split()])

    for i in range(1,100000):
        a_tax = i *8 //100
        b_tax = i * 10//100

        if a == a_tax and b == b_tax:
            print(i)
            return

    print(-1)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
if a % 2 == 0:
    c = int(a*12.5)
    d = c + 13
else:
    c = int(a*12.5) + 1
    d = c + 12
e = b * 10
f = e + 10
if d <= e or f <= c:
    print(-1)
else:
    print(max(c,e))

Submission status: Accepted

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

Submission status: Accepted

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

ans=20000

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

Submission status: Accepted

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

    i=1
    while True:
        if 0.08*i//1==a and 0.1*i//1==b:
            ans=i
            break
        
        if 0.08*i//1>a or 0.1*i//1>b:
            ans=-1
            break
        i+=1
    print(ans)  

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
res = -1
for i in range(1010):
    if (A <= 0.08 * i < A + 1) and (B <= 0.1 * i < B + 1):
        res = i
        break
print(res)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
exist = False
for i in range(1001):
    eight = int(i * 0.08)
    ten = int(i * 0.1)
    if eight == a and ten == b:
        print(i)
        exist = True
        break
if not exist:
    print('-1')

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
i = 0
ans = -1
while True:
    if int(i*0.080) == a and int(i*0.10) == b:
        ans = i
        break
    elif int(i*0.080) > a or int(i*0.10) > b:
        break
    i += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = -1
for i in range(B * 10, (B + 1) * 10):
    a = int(i * 0.08)
    b = int(i * 0.10)
    #print(i, a, b, a==b)
    if (a == A) and (b == B):
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for p in range(1, 100001):
    if p*108//100-p==A and p*110//100-p==B:
        print(p)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
x=a//0.08
for i in range(15):
  if math.floor((x+i)*0.10)==b and math.floor((x+i)*0.08)==a:
    print(int(x+i))
    break
  if i==14:
    print(-1)

Submission status: Accepted

Solution code:
d = input().split(" ")
a = int(d[0])
b = int(d[1])
ans = -1
for i in range(1, 12501):
	aa = int(i * 0.08)
	bb = int(i * 0.1)
	if a == aa and b == bb and ans == -1:
		ans = i
		break
print(ans)

Submission status: Accepted

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

    low = int(B /0.1)
    up = int((A+1) / 0.08)
    
    value = -1
    for i in range(low,up):
        if int(i*0.08)==A and int(i*0.1)==B:
            value = i
            break
    
    print(value)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

for i in range(1,1001):
    flr=floor(i*0.1)
    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())

for i in range(1, 1251):
    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(1, 2000):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys
range = xrange
input = raw_input

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

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

Submission status: Accepted

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

a=A//0.08
b=(A+1)//0.08
answer=-1

for i in range(int(a),int(b)+1):
    #print(i)
    #print(i*0.1)
    if int(i*0.1)==B and int(i*0.08)==A:
        answer=i
        break
print(answer)

Submission status: Accepted

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

judge = True
for i in range(1,1001):
    if 0.08*i//1 == a and 0.1*i//1 ==b:
        print(i)
        judge = False
        break

if judge:
    print(-1)

Submission status: Accepted

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

ans = -1

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

print(ans)

Submission status: Accepted

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

tmp_A = A*100
if tmp_A%8==0:
  min_A = tmp_A//8
  max_A = (tmp_A+100)//8
else:
  min_A = tmp_A//8+1
  max_A = (tmp_A+100)//8-1

min_B = 10*B
max_B = 10*B+9

min_AB = max(min_A, min_B)
max_AB = min(max_A, max_B)

if min_AB <= max_AB:
  print(min_AB)
else:
  print(-1)

Submission status: Accepted

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

for p in range(1, 20000):
    if p * 8 // 100 == A and p * 10 // 100 == B:
        ans = p
        break
print(ans)

Submission status: Accepted

Solution code:
import sys

A, B = map(int, sys.stdin.readline().split())

for i in range(20000):
    a = int(i * 0.08)
    b = int(i * 0.10)
    if a == A and b == B:
        print(i)
        sys.exit()

print(-1)

Submission status: Accepted

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

a, b = map(int,input().split())
eps = 10**-10

c0 = -((-a * 12.5) // 1)
c1 = (a+1) * 12.5
if c1 - int(c1) != 0:
    c1 = int(c1+1)
d0 = -((-b * 10) // 1)
d1 = (b+1) * 10
if d1 - int(d1) != 0:
    d1 = int(d1+1)
# print(c0,c1,d0,d1)
if c1 <= d0 or d1 <= c0:
    print(-1)
else:
    print(int(max(c0,d0)))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
v = 1
while True:
    if (v*0.08)//1 == a and (v*0.1)//1 == b:
        ans = v
        break
    v += 1
    if v > 10100:
        ans = -1
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


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


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    A, B = MI()

    for N in range(1, 10**5):
        if int(N * 0.08) == A and int(N * 0.1) == B:
            print(N)
            return

    print(-1)
    # print(low, high)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a, b = list(map(int, input().split()))
flag = True
for v in range(1, 10001):
    if math.floor(v * 0.08) == a and math.floor(v * 0.1) == b:
        print(v)
        flag = False
        break
if flag:
    print(-1)

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

a,b=[int(i) for i in input().split()]
for i in range(10000):
    if math.floor(i*1.08)==i+a and math.floor(i*1.1)==i+b:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
# abc 158
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

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


answer = -1
for i in range(1, 2000): # 2000は適当
    if int(i * 0.08) == A and int(i * 0.1) == B:
        answer = i
        break

print(answer)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import math 
a, b = map(int,input().split())
Flg = True
for i in range(10**5+2):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        Flg = False
        break
if Flg:
    print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
i=1
while(1):
    p=int(i*0.08)
    q=int(i*0.1)
    if p==a and q==b:
        break
    i+=1
    if i>=100000:
        i=-1
        break
print(i)

Submission status: Accepted

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

for i in range(2000):
    zeiA = int(i*0.08)
    zeiB = int(i*0.1)
    if zeiA == A and zeiB == B:
        print(i)
        hantei = 1
        break

if hantei == 0:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    middle = int(a / 0.08)

    for i in range(-30, 30):
        tested = i + middle
        if tested * 8 // 100 == a and tested // 10 == b:
            print(tested)
            return

    print(-1)

main()

Submission status: Accepted

Solution code:
import sys

a, b = map(int, input().split())
for i in range(10000):
    if int(i*1.08)-i == a and int(i*1.1)-i == b:
        print(i)
        sys.exit(0)
print(-1)

Submission status: Accepted

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

for k in range(1, 10001):
    if int(k * 0.08) == a and int(k * 0.1) == b:
        flag = k
        break

print(flag)

Submission status: Accepted

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


def solve(A: int, B: int):
    for i in range(1, 1000000):
        tax_A = int(i * 108 / 100 - i)
        tax_B = int(i * 110 / 100 - i)
        if tax_A == A and tax_B == B:
            print(i)
            return
        else:
            continue
    print(-1)
    return


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor

A, B = map(int, input().split())
a = set()
b = set()
for i in range(floor(A / 0.08), floor((A + 1) / 0.08) + 1):
    if floor(i * 0.08) == A:
        a.add(i)

for i in range(floor(B / 0.1), floor((B + 1) / 0.1) + 1):
    if floor(i * 0.1) == B:
        b.add(i)

seq = a & b
if seq:
    print(min(seq))
else:
    print(-1)

Submission status: Accepted

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

A, B = map(int, input().split())
N = 1
flag = False
for x in range(1300):
    if x // 12.5 == A and x // 10 == B:
        flag = True
        print(x)
        break

if not flag:
    print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

if (b < a):
    temp = b
    b = a
    a = temp


x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

Submission status: Accepted

Solution code:
from math import ceil
from math import floor
a,b = map(int,input().split())
l1 = ceil((a)/0.08)
r1 = floor((a+0.999999999999)/0.08)
l2 = ceil((b)/0.1)
r2 = floor((b+0.99999999999)/0.1)
l3 = max(l1,l2)
r3 = min(r2,r1)
if(l3<=r3):
    print(l3)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

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

flg = False
for i in range(2000):
    
    if math.floor(i * 0.08) == (A) and math.floor(i * 0.1 ) == B:
        flg = True
        break
if flg:
    print(i)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

A, B = (int(i) for i in input().split())
for i in range(10000):
    a = int(math.floor(i * 0.08))
    b = int(math.floor(i * 0.1))
    if a == A and b == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
num = 0
unchi = -1
while num < 10500:
	num = num + 1
	if math.floor(num*0.08)==a:
		if math.floor(num*0.10)==b:
			unchi = num
			num = 12345
print(unchi)

Submission status: Accepted

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

import math

cond_A = [math.ceil((A * 100) / 8), ((A+1) * 100) /8]
cond_B = [math.ceil((B * 100) /10), ((B+1) * 100) /10]

if cond_B[0] < cond_A[1] and cond_A[0] < cond_B[1]:
    print(max(cond_A[0], cond_B[0]))
else:
    print(-1)

Submission status: Accepted

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

INF = 10**4

for i in range(INF):
    x = i*8//100
    y = i*10//100

    if x == a and y == b:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

C = -1

for i in range(1000):
  a = int((i+1)*0.08)
  b = int((i+1)*0.1)
  if  a == A and b == B:
    C = i+1
    break
print(C)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe


# my functions here!
#標準エラー出力
def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(*args):
    print(*args,file=sys.stderr)

def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
     
#input

def resolve():
    A,B=pin()
    ans=-1
    for i in range(1,2001):
        if int(i*(0.08))==A and int(i*(0.1))==B:
            ans=i
            break

    print(ans)
    #print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])
#if __name__=="__main__":resolve()

"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """2 2"""
        output = """25"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """8 10"""
        output = """100"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """19 99"""
        output = """-1"""
        self.assertIO(input, output)
if __name__=="__main__":resolve()

Submission status: Accepted

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

for i in range(2000):
    tmpA = math.floor(i * 0.08)
    tmpB = math.floor(i * 0.1)

    if tmpA == A and tmpB == B:
        print(i)
        exit()

print('-1')

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    A, B = [int(x) for x in input().split()]

    for i in range(100000):
        if i * 8 // 100 == A and i // 10 == B:
            print(i)
            return
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

A, B = MI()

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

    if i == 10000:
        print(-1)
        break

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split()))
judge = False
for x in range(10000):
    tax_a = int(0.08*x)
    tax_b = int(0.1*x)
    if tax_a == a and tax_b == b:
        print(x)
        judge = True
        break
    
if judge == False:
    print(-1)