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: Wrong Answer

Solution code:
# from fractions import gcd
# mod = 10 ** 9 + 7
# N = int(input())
# a = list(map(int,input().split()))
# a,b,c = map(int,input().split())
# ans = [0] * N
# math.ceilで切り上げ
# dp = [[0] * 4 for i in range(3)] #2次元配列初期化
# dp = [[[0] * 2 for i in range(3)] for j in range(5)]
# (ord('A'))でASCII出力 Aは65
import math
import statistics
import string


def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  # xからyまでの階乗をzで割ったあまりを求める
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):#最大公約数 math.gcdが使えない時の手段として入れとく。pythonが更新されたらいらなくなるはず
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

A, B = splitintinput()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -1

for i in range(1,100):
  a = int(i * 1.08)
  b = int(i * 1.1)
  if a == A and b == B:
    ans = i
    break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

#x * 0.08 = a
#y * 0.1 = b

val1 = a / 0.08
val2 = b / 0.1

if math.floor(val1 * 0.08) == a and math.floor(val1 * 0.1) == b:
    print(val1)
elif math.floor(val2 * 0.08) == a and math.floor(val2 * 0.1) == b:
    print(val2)
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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,100):
        a_tax = i * 108//100
        b_tax = i * 110/100

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

    print(-1)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B):
    for i in range(1000):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            return i
    return -1


def main():
    A, B = read_int_n()
    print(slv(A, B))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for x in range(1, 100 + 1):
  if int(x * 0.08) == a and int(x * 0.1) == b:
    print(x)
    exit()
else:
  print('-1')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(1,101):
    pa=int(i*0.08)
    pb=int(i*0.10)
    if pa==a and pb==b:
        print(i)
        ans=1
        break
if ans==0:
    print(-1)

Submission status: Wrong Answer

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,101):
  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: Wrong Answer

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

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

Submission status: Wrong Answer

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

if (math.floor((A+1)/0.08) < math.ceil(B/0.1)) or (math.floor((B+1)/0.1) < math.ceil(A/0.08)):
  print(-1)
else:
  print(max(math.ceil(A/0.08),math.ceil(B/0.1)))

Submission status: Wrong Answer

Solution code:
A, B =map(int, input().split())
ans=-1
for i in range(0, 10100):
    if 2*(i//25)==A and i//10==B:
        ans=i
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = [int(i) for i in input().split()]
p1 = int(b/0.1)
p2 = int(a/0.08)

for p in range(p1,p2+1):
    if int(p*0.08) == a and int(p*0.1) == b:
        print(p)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

price = math.floor(a / 0.08)
if math.floor(price * 0.1) == b:
    print(price)
else:
    print(-1)

Submission status: Wrong Answer

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

m = -1
for n in range(101):
    if A*100 <= 8*n < (A+1)*100 and B*100 <= 10*n < (B+1)*100:
        m = n
        break
print(m)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
p=a/0.08
q=(a+1)/0.08
r=b/0.1
s=(b+1)/0.1
Min=max(p,r)
Max=min(q,s)
if Min>Max:
    print(-1)
else:
    print(int(-(-Min//1)))

Submission status: Wrong Answer

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

print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
flg=0
for i in range(1,101):
    if int(i*0.08)==a and int(i*0.10)==b and flg==0:
        print(i)
        flg=1
if flg==0:
    print(-1)

Submission status: Wrong Answer

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

for i in range(200):
    x = floor(i * 0.08)
    y = floor(i * 0.1)
    if x == a and y == b:
        print(i)
        exit(0)

print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

for i in range(1,10**6):
    if math.floor(i*0.08) == a:
        if math.floor(i*0.10) == b:
            print(i)
            exit()
        elif math.ceil(i*0.10) == b:
            print(i)
            exit()
            """
    elif math.ceil(i*0.08) == a:
        if math.floor(i*0.10) == b:
            print(i)
            exit()
        elif math.ceil(i*0.10) == b:
            print(i)
            exit()"""
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import floor


def main():
    a, b = map(int, input().split())
    tmp = True
    for n in range(1, 101):
        if floor(n * 0.08) == a and floor(n * 0.1) == b:
            print(n)
            tmp = False
            break
    if tmp:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
for i in range(1, 1000):
    if int(i * 1.08) - i == A and int(i * 1.1) - i == B:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys
sys.setrecursionlimit(300000)


def solve(A: int, B: int):
    ret = -1
    for i in range(0, 101):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            ret = i
            break
    print(ret)
    return

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: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

def ans():

    for x in range(0, 300):
        if A == int(x * 0.08) and B == int(x * 0.1):
            print(x)
            return
    print(-1)

ans()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

eps = 10**-7
a,b = nm()
for i in range(101):
    if int(i*.08 + eps) == a and int(i*.1 + eps) == b:
        print(i); break
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
for x in range(1000):
  if int(x * 1.08) == A and int(x * 1.1) == B:
    print(x)
    break
else:
  print(-1)

Submission status: Wrong Answer

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

f = False
for x in range(1, 101):
    if int(x * 0.08) == a and int(x * 0.1) == b:
        if not f:
            print(x)
        f = True

if not f:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B = [int(i) for i in input().split()]
for i in range(101):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i);exit()
print(-1)

Submission status: Wrong Answer

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

    for x in range(200):
        if int(x * 0.08) == A and int(x * 0.1) == B:
            print(x)
            return

    print(-1)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A,B=MI()
    for i in range(101):
        if(int(i*0.08)==A and int(i*0.1)==B):
            print(i)
            return
    print(-1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
#print(a/0.08)
#print(b/0.1)
if(a/0.08 < b/0.1):
    print(-1)
    exit()
else:
    if(a/0.08 != int(a/0.08)):print(int(a/0.08)+1)
    else:print(int(a/0.08))

Submission status: Wrong Answer

Solution code:
def main():
    A, B = map(int, input().split())
    for i in range(1, 101):
        if int(i*0.08) == A and int(i*0.1) == B:
            print(i)
            return
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    #→1,.→0として読み込む
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '#' else 0 for s in read()[:-1]])
    return ret


A, B = read_ints()

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

Submission status: Wrong Answer

Solution code:
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    #→1,.→0として読み込む
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '#' else 0 for s in read()[:-1]])
    return ret


A, B = read_ints()

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

Submission status: Time Limit Exceeded

Solution code:
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

a,b=map(int,input().split())
ans=1
while ans*8//100!=a or ans//10!=b:
    ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
x=10
y=int(x*8/100)
z=int(x*10/100)
i=0
while i==0:
  if int(x*8/100)==a and int(x*10/100)==b:
    print(x)
    break
  else:
    x=x+1

Submission status: Time Limit Exceeded

Solution code:
import math
a, b = map(int, input().split())
ans = math.ceil(a / 0.08)
while b != math.floor(ans*0.1):
    ans += 1

if math.floor(ans*0.08) == a:
    print(ans)
else:
    print(-1)

Submission status: Time Limit Exceeded

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

for i in range(int(10e+20)):
    if floor(i*0.08) == a:
        if floor(i*0.1) == b:
            break

print(i)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
a, b = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()


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

Submission status: Time Limit Exceeded

Solution code:
A, B = map(int, input().split())
 
i=0
while i<10000:
  if A*0.08==i and B*0.1==i:
    print(i)
    quit()
print(-1)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import math
a,b = map(int, input().split())
i = 1
while True:
  if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
    print(i)
    break
  if math.floor(i*0.08) > a or math.floor(i*0.1) > b:
    print(-1)
    break

Submission status: Time Limit Exceeded

Solution code:
import math
a,b=map(int,input().split())
flag=True
for i in range(10**7):
    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: Time Limit Exceeded

Solution code:
a = list(map(int,input().split()))
x = [a[0]]
y = [a[1]]
a = []
b = []
c = []
d = 0
while x[len(x)-1] < x[0] + 1:
    x.append(round(x[d] + 0.0001,4))
    y.append(round(y[d] + 0.0001,4))
    d += 1
for i in x:
    a.append(i/0.08)
for i in y:
    b.append(i/0.1)
for i in a:
    for i2 in b:
        if i == i2:
            c.append(i)
if len(c) > 0:
    print(round(min(c)))
else:
    print(-1)

Submission status: Time Limit Exceeded

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

a_tax = int(a / 0.08)
b_tax = int(b / 0.1)
n  = min([a_tax, b_tax])

while True:
    if a == int(n * 0.08) and b == int(n * 0.1):
        break
    
    n += 1

print(n)

Submission status: Time Limit Exceeded

Solution code:
from math import ceil


def solve(string):
    a, b = map(int, string.split())
    ans = ceil(a / 0.08)
    while ans // 10 != b:
        ans += 1
    return str(ans) if ans * 2 // 25 == a else "-1"


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Time Limit Exceeded

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

# have to make a good guess on x
x = 1
while True:
    aval = a * 12.5 * x
    bval = b * 10 * x
    # temp = a * 12.5 + b * 10
    if int(aval) == int(bval):
        print(str(aval)[:-2])
        break

Submission status: Time Limit Exceeded

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

x = 1
while True:
    aval = a * 12.5 * x
    bval = b * 10 * x
    if aval == bval:
        print(str(aval)[:-2])
        break

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int, input().split())
n=b*10
if int(n*0.1)>b:
    print(-1)
while True:
    if int(n*0.1)>b:
        print(-1)
    elif int(n*0.08)==a:
        print(n)
        break
    else:
        n+=1

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import math
from decimal import *
A,B = list(map(int, input().split()))
ans = -1
for x in range(1, 50000):
    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: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
i=0
while i <= 1000:

    if a==int(i*0.08) and b==int(i*0.1):
        print(i)
print(-1)

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
i=0
while i <= 10000:

    if a==int(i*0.08) and b==int(i*0.1):
        print(i)
print(-1)

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
for i in range(10000000):
  if(i//12.5==a and i//10==b):
    print(i)
  else:
    print("-1")

Submission status: Time Limit Exceeded

Solution code:
from math import floor

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

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

print(res)

Submission status: Time Limit Exceeded

Solution code:
import math

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

ans = -1

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

Submission status: Time Limit Exceeded

Solution code:
import math

A, B = list(map(int, input().split()))
x_minA = math.ceil(100 / 8 * A)
x_minB =  10 * B
x_maxA = math.floor(100 / 8 * (A+1))
x_maxB = 10 * (B+1)
if x_minA > x_maxB or x_minB > x_maxA:
  print(-1)
else:
  x = max(x_minA, x_minB)
  while (x * 8 / 100 - A >= 1) or (x / 10 - B >= 1):
    print(x, x * 8 / 100, x / 10)
    x += 1
  
  print(x)

Submission status: Time Limit Exceeded

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

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

if b-a < b*0.8:
    i = 1
    while True:
        if a == int(i*0.08) and b == int(i*0.1):
            print(i)
            break
        i += 1
else:
    print(-1)

Submission status: Time Limit Exceeded

Solution code:
import math
A, B = map(int, input().split())
tmpa = math.floor(A / 0.08)
tmpb = math.floor(B / 0.1)
alst = []
blst = []

indexa = 0
while True:
    tmp = math.floor((tmpa + indexa) * 0.08)
    if tmp == A:
        alst.append(tmpa + indexa)
        indexa += 1
    elif tmp > A:
        break
    else:
        indexa += 1

indexb = 1
while True:
    tmp = math.floor((tmpb + indexb) * 0.1)
    if tmp == B:
        blst.append(tmpb + indexb)
        indexb += 1
    elif tmp == B:
        break
    else:
        indexb += 1
ans = -1
alst.sort()
blst.sort()
for i in alst:
    if blst.count(i) >= 1:
        ans = i
        break

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
a,b= map(int, input().split())
x=max(a//0.08,b//0.1)
if (a+1)/0.08<b/0.1 or (b+1)/0.1<a/0.08:
  print(-1)
  sys.exit()
t=0
while t==0:
  if int(x*0.08)==a and int(x*0.1)==b:
    print(int(x))
    t=1
  x+=1

Submission status: Time Limit Exceeded

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

is_true = False
for i in range(10**7):
    if a == int(i * 0.08) and b == int(i * 0.1):
        is_true = True
        break
if is_true:
    print(i)
else:
    print('-1')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
# 消費税8%でA円、10%のときB円の消費税が課される
# 税抜き価格は？
# 小数点以下切り捨て

# 税抜きx円
def tax(x):
  return 8 * x // 100, 10 * x // 100

# A = |.08x|
# B = |.10x|

# x >= A / 1.08
# x >= B / 1.10

x = int(min(A / 0.08, B / 0.1))
Xmax = x * 1.5
while x <= Xmax:
  a, b = tax(x)
#  print(x, a, b)
  if a == A and b == B:
    print(x)
    break
  x += 1
else:
  print(-1)

Submission status: Accepted

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

ans=-1
for n in range(10*b,10*(b+1)):
    if int(n*1.1)-b == int(n*1.08)-a:
        ans=n
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    a,b = map(int,input().split())
    
    tmp1=int(a/0.08)
    tmp2=int(b/0.10)

    ans=[]

    for i in range(min(tmp1,tmp2),max(tmp1,tmp2)+2):
        if int(i*0.08) == a and int(i*0.10) == b:
            ans.append(i)

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


if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
i = 1
f = 0
while True:
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        f = 1
        break
    if int(i*0.08)>a:
        break
    i += 1
if not f:
    print(-1)

Submission status: Accepted

Solution code:
def sep():
    return map(int,input().strip().split(" "))
def lis():
    return list(sep())

a,b=sep()
for i in range(1,10005):
    if (i*8)//100==a and (i*10)//100==b:
        print(i)
        quit()
print(-1)