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 sys
input=sys.stdin.readline

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


ans=b*10



while int(ans*0.08) != a or int(ans*0.1) != b:
    ans+=1
    if int(ans*0.08) != a and int(ans*0.1) != b:
        print(-1)
        exit()

print(ans)

Submission status: Accepted

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(1, 1000+1):
        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: Accepted

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

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

Submission status: Accepted

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  a,b=LI()
  for i in range(100000):
    _a=i*0.08
    _b=i*0.1

    # print(int(_a),int(_b))

    if int(_a)==a and int(_b)==b:
      return i

  return -1

# main()
print(main())

Submission status: Accepted

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

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

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

print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

Solution code:
# /usr/bin/env python3


def compute(a, b):
    max_v = b * 200
    for v in range(1, max_v):
        if int(v * 0.08) == a and int(v * 0.1) == b:
            return v
    else:
        return None


def main():
    a, b = (int(x) for x in input().split())
    res = compute(a, b)
    print(-1 if res is None else res)


if __name__ == "__main__":
    main()

Submission status: Accepted

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


for i in range(1,2001):
    aa = floor(i * 0.08)
    bb = floor(i * 0.1)
    if aa == a and bb == b:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

    for x in range(1, 100*100):
        a = math.floor(x * 0.08)
        b = math.floor(x * 0.1)
        if a == A and b == B:
            print(x)
            return
    
    print(-1)
    return

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
from math import floor

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

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

Submission status: Accepted

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

Submission status: Accepted

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

n = 10**6
for i in range(n):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()
    elif int(i * 0.08) > A or int(i * 0.01) > B:
        print(-1)
        exit()

Submission status: Accepted

Solution code:
# coding:utf-8

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

for ans in range(1, 1001):
    if int(ans * 0.08) == A and int(ans * 0.1) == B:
        print(ans)
        exit(0)
print('-1')

Submission status: Accepted

Solution code:
import fractions

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

for i in range(1, 2000):
        #if fractions.floor(i * 0.08)==A:
        if (i*0.08)//1 == float(A) and (i*0.1)//1 == float(B):
                print(i)
                exit()
print('-1')

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    readline=stdin.readline
    A,B=map(int,readline().split())
    low=B*10
    high=B*10+9
    for n in range(low,high+1):
        if int(n*0.08)==A:
            print(n)
            break
    else:
        print(-1)
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve(inp):
    (A, B) = map(int, inp.readline().strip().split(' '))

    b1 = B * 10
    b2 = (B + 1) * 10
    for i in range(b1, b2 + 1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            return str(i)

    return "-1"


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

def price():
    a, b = map(int, input().split())

    x = int(a / 0.08)

    if x * 8 < 100 * a:
        x += 1
    while 100*a <= x*8 < 100*a + 100:
        if 100*b <= x*10 < 100*b + 100:
            return x
        x += 1
    return -1

print(price())

Submission status: Accepted

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, 10**5):
    if A == int(i * 0.08) and B == int(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(1, 10001):
    hachi = int(i * 0.08)
    jyu = int(i * 0.10)
    if hachi == A and jyu == B:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
u = max(10 * b, (25 * a) // 2 + (25 * a) % 2)
v = min(10 * b + 9, (25 * a + 24) // 2)
if u <= v:
    print(u)
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    a, b = rli()
    for i in range(10000):
        na = i*8//100
        nb = i*10//100
        if na == a and nb == b:
            print(i)
            return
    print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
loop = 100000
ans = loop
for i in range(loop):
  if i*0.08//1 == a and i*0.1//1==b:
    ans = min(ans,i)

if ans == loop:  
  ans = -1
  
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

def main():
    A,B=mis()
    for i in range(1000000):
        if math.floor(i*.08)==A and math.floor(i*.1)==B:
            print(i)
            return
    print(-1)

main()

Submission status: Accepted

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

a = (A * 100 + 7) // 8
b = ((A+1) * 100 + 7) // 8 - 1
c = B * 10
d = (B+1) * 10 - 1

ma = min(b, d)
mi = max(a, c)
print(mi if mi <= ma else -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:
A, B = map(int, input().split())

res = -1

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

print(res)

Submission status: Accepted

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

mina = 12.5 * A 
maxa = 12.5 * A + 12.5
minb = 10 * B 
maxb = 10 * B + 10

Min = int(min(mina, minb))
Max = int(max(maxa, maxb)) + 1

ans = -1
for i in range(Min, Max+2):
    if (mina <= i) and (minb <= i) and (i < maxa) and (i < maxb):
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import math

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

price_a_min = math.ceil(a * 12.5)
price_a_max = math.ceil((a + 1) * 12.5) - 1
price_b_min = math.ceil(b * 10)
price_b_max = math.ceil((b + 1) * 10) - 1

if price_a_min > price_b_max or price_b_min > price_a_max:
  print(-1)
else:
  print(max(price_a_min, price_b_min))

Submission status: Accepted

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

ans = -1
for i in range(1001):
    moneyA = int(i * 1.08)
    taxA = moneyA - i
    moneyB = int(i * 1.10)
    taxB = moneyB - i
    if A == taxA and B == taxB:
        ans = i
        break
print(ans)

Submission status: Accepted

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

for i in range(1,10000):
  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(2000):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

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

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

print(-1)

Submission status: Accepted

Solution code:
from math import floor

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

ans = 0
while ans != 100000:
    aq = floor(ans*0.08)
    bq = floor(ans*0.1)
    if (aq==a) and (bq==b):
        break
    else:
        ans+=1
if ans == 100000:
    ans = -1
print(ans)

Submission status: Accepted

Solution code:
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop
import sys
stdin = sys.stdin
mod = 10**9 + 7

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

a, b = na()

for n in range(10*b, 10*(b+1)):
    if int((n/100)*8) == a:
        print(n)
        quit()
print(-1)

Submission status: Accepted

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

def main():
    for x in range(2000):
        if x * 8 // 100 == A and x * 10// 100 == B:
            print(x)
            return

    print(-1)
    return


main()

Submission status: Accepted

Solution code:
import math
import sys

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

for c in range(1, 100 * 20 + 1):
    if math.floor(c * 0.08) == A and math.floor(c * 0.1) == B:
        print(c)
        sys.exit()
else:
    print(-1)

Submission status: Accepted

Solution code:
#a,b小さいのでこれで可
a,b = map(int, input().split( ))

mn = int(a/(0.1))-5
mx = int(b/0.08)+3

for i in range(mn,mx):
    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, raw_input().split())

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

print "-1"

Submission status: Accepted

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

for i in range(1, 10 ** 4):
    if int(i * 0.08) == A and int(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())
ans=-1
for i in range(0, 10100):
    if math.floor(0.08*i)==A and math.floor(0.1*i)==B:
        ans=i
        break
print(ans)

Submission status: Accepted

Solution code:
import sys
import math

input = sys.stdin.readline

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

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

print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    A, B = lr()
    for i in range(100000):
        if int(i*0.08) == A and int(i*0.1) == B:
            print(i)
            return
    print('-1')
resolve()

Submission status: Accepted

Solution code:
import sys
import math

a, b = [int(s) for s in sys.stdin.readline().strip().split()]

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

Submission status: Accepted

Solution code:
from math import ceil, floor

a, b = [int(v) for v in input().split()]
ca, cb = ceil(a / 0.08), ceil(b / 0.1)
res = max(ca, cb)
if ca != res and floor(res * 0.08) != a:
    print("-1")
elif cb != res and floor(res * 0.1) != b:
    print("-1")
else:
    print(res)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
lo=0
hi=1000
ans=-1 
for i in range(0,1099):
    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()))
for i in range(100000):
  if((i*108)//100==i+A and (i*110)//100==i+B):
    print(i)
    exit()
print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
for i in range(5000):
  z8=int(i*0.08)
  z10=int(i/10)
  if z8==a and z10==b:
    print(i)
    exit()
print("-1")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import numpy as np
import sys
for i in range(1, 1251):
  if np.floor(i*0.08) == A and np.floor(i*0.1) == B:
    print(i)
    sys.exit()
  else:
    pass
  
print(-1)

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

a,b = [int(i) for i in read().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 sys
a, b = map(int, input().split())
for i in range(10000):
  if  a <= i*8/100 < a+1 and b <= i/10 < b+1:
    print(i)
    sys.exit()
print(-1)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
ret = -1
for i in range(1, 1500):
    a = math.floor(i * 0.08)
    b = math.floor(i * 0.1) 
    if a == A and b == B:
        ret = i
        break

print(ret)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
a,b=map(int,input().split())
import math
for i in range(2000):
    x=math.floor(i*0.08)
    y=math.floor(i*0.1)
    if x==a and y==b:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

for i in range(1, 10 ** 6) :
  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 x in range(1, 10**5):
    if x*8//100 == A and x*10//100 == B:
        print(x)
        break
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
for i in range(10, (B+1)*10):
    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())

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

Submission status: Accepted

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

Solution code:
x,y=map(int,input().split())

for i in range(10**6):
    if int(i*0.08)==x and int(i*0.1)==y:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8


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

    for i in range(1, 10001):
        if int(i*1.08) - i == A and int(i*1.10) - i == B:
            return i

    return -1


print(main())

Submission status: Accepted

Solution code:
import sys

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

def main():
    for i in range(1, 1251):
        if i * 0.1 // 1 == b and i * 0.08 // 1 == a:
            return i
    return -1

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

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

flag=0

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

if not flag: print(-1)

Submission status: Accepted

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def ifn(): return float(input()) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return map(int, input().split()) #整数map取得
def fmn(): return map(float, input().split()) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

A,B = imn()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor

a, b = map(int, input().split())
ans = -1
for i in range(10, 100 * 10 + 1):
    if floor(i * 0.08) == a and floor(i * 0.1) == b:
        ans = i
        break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Solution code:
def solve(a, b):
    for i in range(1, 1001):
        res_a = int(i * 0.08)
        res_b = int(i * 0.10)
        if res_a == a and res_b == b:
            return i
    return -1


def main():
    a, b = map(int, input().split())
    res = solve(a, b)
    print(res)


def test():
    assert solve(2, 2) == 25
    assert solve(8, 10) == 100
    assert solve(19, 99) == -1


if __name__ == "__main__":
    test()
    main()

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import math
import collections
#n = int(input())
a, b = map(int, input().split())
#s = input()
#x = list(map(int, input().split()))

cnt = 1
while (cnt < 2000):
    if math.floor(cnt * 0.08) == a and math.floor(cnt * 0.1) == b:
        print(cnt)
        sys.exit()
    cnt += 1

print(-1)

Submission status: Accepted

Solution code:
import math
a, b = [int(x) for x in input().split()]
def solve(a, b):
    for i in range(1, 1001):
        if a == math.floor(i * 0.08) and b == math.floor(i * 0.1):
            return i
    return -1
print(solve(a, b))

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
flag=0
for i in range(0,5000):
    a=i*0.08
    b=i*0.10
    if (math.floor(a)==A)and(math.floor(b)==B):
        print(i)
        flag=1
        break
if flag==0:
    print("-1")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)


a,b = get_nums_l()

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    A, B = LI()

    for money in range(1, 2000):
        if int(money * 0.08) == A and int(money* 0.10) == B:
            print(money)
            return
    print(-1)
    return


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor


def main():
    a, b = map(int, input().split())
    tmp = True
    for n in range(1, 1251):
        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: Accepted

Solution code:
a,b=map(int,input().split())
c=max([a/0.08,b/0.1])
c=int(c)+(c!=int(c))
if int(c*0.08)==a and int(c*0.1)==b:
    print(c)
else:
    print(-1)