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:
def solve():
    a,b=map(int,input().split())
    start=int(a*12.5)
    end=int(b*9.9)
    for i in range(end,start+1):
        if(int(i*0.08)==a and int(i*0.1)==b):
            print(i)
            return
    print(-1)


solve()

Submission status: Wrong Answer

Solution code:
import math

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

if b==B:
    print(a)
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import sys

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

A = math.floor(a / 0.08)
B = math.floor(b / 0.10)

if A < B:
    print('-1')
elif A == B:
    print(int(B))
else:
    start = B
    goal = math.floor((a+0.99) / 0.08)
    for i in range(start,goal):
        if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
            print(i)
            sys.exit()
    print('-1')

Submission status: Wrong Answer

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a,b = m()

aaa = a * 100 // 8

aa = (a+1) * 100 // 8

bbb = b * 100 // 10

bb = (b+1) * 100 // 10


p = set(range(aaa,aa))
pp = set(range(bbb,bb))

ppp = p & pp

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
Ax = A * 25 / 2
Ay = (A + 1) * 25 / 2
Bx = B * 10
By = (B + 1) * 10

if Ay <= Bx or By <= Ax:
    print(-1)
else:
    print(int(max(Bx, Ax)))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
a = max(A/0.08, B/0.10)
b = min((A+1)/0.08, (B+1)/0.10)
if a < b:
  print(int(a))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
def main():
    A, B = [int(x) for x in input().split()]
    max_b = (B+1) * 10 - 1
    min_b = (B-1) * 10 + 1
    for num in range(min_b, max_b + 1):
        val = int(num * 0.08)
        if val == A:
            print(num)
            return
        elif val > A:
            print(-1)
            return
    print(-1)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

min_ans = int(A / 0.08)

kouho = [min_ans]
to_continue = True
while to_continue:
    min_ans += 1
    if int(min_ans * 0.08) == A:
        kouho.append(min_ans)
    else:
        break

print_flag = False
for i in kouho:
    if (int(i * 0.1) == B):
        print_flag = True
        print(i)
        break
    
if print_flag == False:
    print('No')

Submission status: Wrong Answer

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

x = a/0.08
ans = 0
while True:    
    y = int(x * 0.1)
    if (y == b):
        ans = 1
        break
    x += 1
    if int((x) * 0.08) > a:
        break

if ans == 1:
    print (int(x))
else:
    print (-1)

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]


def main():
    A, B = map(int, input().split())
    if A / 0.08 < B / 0.1:
        print(-1)
        exit()
    for n in range(int(A / 0.08), 10 * B + 10):
        if int(n * 0.08) == A and int(n * 0.1) == B:
            print(n)
            exit()
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys,math

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	A,B = MI()
	A,B = min(A,B),max(A,B)
	tmpa = math.ceil(A / 0.08)
	tmpa1 = int((A+1) / 0.08)
	tmpb = math.ceil(B / 0.10)
	tmpb1 = int((B+1) / 0.10)
	if(tmpa1 < tmpb):
		print(-1)
	else:
		print(tmpa)

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

amin = (((a/0.08)*-1)//1)*-1
amax = ((a+1)/0.09)//1

bmin = (((b/0.08)*-1)//1)*-1
bmax = ((b+1)/0.1)//1

if amin <= bmax:
    ans = amin
elif bmin <= amax:
    ans = bmin
else:
    ans = -1

print(int(ans))

Submission status: Wrong Answer

Solution code:

import glob


# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\158\\C'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        q = [int(i) for i in self.input_data().split()]

        A = q[0]
        B = q[1]

        no_tax_A = int(A / 0.08) # + 0 - 12
        no_tax_B = int(B / 0.1)  # + 0 - 9

        if no_tax_A == no_tax_B:
            result = no_tax_A
        elif no_tax_A > no_tax_B:
            if no_tax_A - no_tax_B <= 9:
                result = no_tax_A
            else:
                result = -1
        else:
            if no_tax_B - no_tax_A <= 12:
                result = no_tax_B
            else:
                result = -1

        print(str(result))

solver = Solver(REL_PATH)
solver.exec_resolve()

Submission status: Wrong Answer

Solution code:
A, B = list(map(int,input().split()))
p_list = list(range(10*B,10*(B+11)))
ans = -1
for p in p_list:
    if int(p*(0.08)) == A:
        ans = p
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

N_a_min = int(12.5 * A)
N_a_max = int(12.5 * (A+1))
N_b_min = 10 * B
N_b_max = 10 * (B+1)

N_a_list = [a for a in range(N_a_min, N_a_max)]
N_b_list = [b for b in range(N_b_min, N_b_max)]

N_a_b_and = list(set(N_a_list) & set(N_b_list))
try:
    print(min(N_a_b_and))
except:
    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:
a, b = map(int, input().split(' '))

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

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
i = -1
atax = -1
btax = -1
while not ((atax == a and btax == b) or (btax > 100)):
    i += 1
    atax = math.floor(i * 0.08)
    btax = math.floor(i * 0.1)
if i > 100:
    print(-1)
else:
    print(i)

Submission status: Wrong Answer

Solution code:
mi = lambda : map(int,input().split())

a,b = mi()

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

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

Solution code:

a, b = list(map(int, input().split()))
ans = -1
for p in range(1000):
    togo = int(p*0.08)
    forhere = int(p*0.1)
    
    if togo == a and forhere == b:
        ans = p
        break
    
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
t=a/0.08*0.1
if int(t)==b:
  print(int(a/0.08))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
def main():
    A,B=map(int, input().split())
    X=[]
    for i in range(1,1000):
        if math.floor(i * 0.08) == A:
            X.append(i)
    for x in X:
        if math.floor(x * 0.10) == B:
            print(x)
            return
    print(-1)
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(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:
a,b=[float(i) for i in input().split(" ")]

taxA=a/8*100
taxB=b/10*100

for i in range(int(taxB),int(taxA)+1):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        exit(0)

print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
p=0;q=0
p=A/0.08
q=p//10
if q==B:
  print(p)
else:
  print(-1)

Submission status: Wrong Answer

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

mn=max(b*10,a*12.5)
if mn==a*12.5 and a%2==1:
    mn=int(mn)+1
mx=min((b+1)/0.1,(a+1)/0.08)
if mn<=mx:
    print(int(mn))
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

def check(X):
  global A
  global B
  return (int)(X*0.08) == A and (int)(X*0.1) == B

for x in range(1, max(A, B)*11):
  if check(x):
    print(x)
    exit(0)

print(-1)

Submission status: Wrong Answer

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

no_tax = a*100 / 8
if a*100 % 8 != 0:
    no_tax += 1

if round(no_tax * 0.1) == b:
    print(int(no_tax))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
a=A/0.08
b=(A+1)/0.08
c=B/0.1
d=(B+1)/0.1
if b<=c or d<=a:
  print(-1)
else:
  t=int(max(a,c))
  print(t)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
A_range = [math.ceil(100*A/8),100*(A+1)//8]
B_range = [10*B,10*(B+1)]

if(min(A_range[1],B_range[1])<max(A_range[0],B_range[0])):
    print("-1")
else:
    print(max(A_range[0],B_range[0]))

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys
input = sys.stdin.readline
import bisect as bi
from operator import mul
from functools import reduce
import math

def fast_comb(a,b,mod):
    up = reduce(lambda x,y: x*y%mod, range(a,a-b,-1))
    down = reduce(lambda x,y: x*y%mod, range(1,b+1))
    return (up * pow(down, mod-2, mod)) % mod

def prime(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

def readlines(n):
    for _ in range(n):
        map(int, input().split())
        yield

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

    x1 = a / 0.08
    x2 = b / 0.1

    l,r = (x1, x2) if x1<=x2 else (x2, x1)
    for i in range(int(l),int(r+1)):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)

        if (a_, b_) == (a, b):
            print(i)
            return

    print(-1)





main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

org_a = int(a / 0.08)
org_b = int(b / 0.1)
org = max(org_a, org_b)

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

Submission status: Wrong Answer

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

Xb = [i for i in range(10*B, 10*(B+1))]
Xa = [i for i in range(int(A/0.08), int((A+1)/0.08))]

S  = set(Xb) & set(Xa)

if len(S) != 0:
    print(min(list(S)))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
A_under = A * 25 // 2
A_top = (A + 1) * 25 // 2 - 1
B_under = B * 10
B_top = B * 10 + 9

ans = -1

for p in range(A_under, A_top + 1):
    if B_under <= p <= B_top:
        ans = p
        break

print(ans)

Submission status: Wrong Answer

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

ans = int(a*12.5)
if ans // 10 == b:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
s = sorted([int(A * 12.5), int(B * 10)])
for x in range(s[0], s[1] + 1):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
a_tax = math.floor(a/0.08)
b_tax = math.floor(b/0.1)
ans = -1
K = [i for i in range(b_tax, a_tax+1)]
for k in K:
    if math.floor(k*0.08) == a and math.floor(k*0.1) == b:
        ans = k
        break
print(ans)

Submission status: Wrong Answer

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

for x in range(1,101):
  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:
import math
a,b = map(int,input().split())
flag = False
for i in range(1,101):
    ans1 = math.floor(i*0.08)
    ans2 = math.floor(i*0.1)
    if ans1==a and ans2==b:
        ans = i
        flag = True
        break
if flag == True:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

pa = int(a * 100/8)
pb = int(b * 100/10)

for price in range(pb, pa+1):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        print(price)
        exit()

print(-1)

Submission status: Wrong Answer

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

mina = math.floor(A/0.08)
if math.floor((A+1)/0.08) == (A+1)/0.08:
  maxa = (A+1)/0.08 -1
else:
  maxa = math.floor((A+1)/0.08)
minb = math.floor(B/0.1)
if math.floor((B+1)/0.1) == (B+1)/0.1:
  maxb = (B+1)/0.1 -1
else:
  maxb = math.floor((B+1)/0.1)

if maxa < minb or maxb < mina:
  print(-1)
else:
  print(max(mina,minb))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
yenA = int(A / 1.08)
yenB = int(B / 1.1)
if yenA == yenB:
    print(yenA)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(A: int, B: int):
    
    from math import floor
    ans = INF
    for i in range(1, 101):
        for j in range(1, 101):
            if floor(i*0.08) == A and floor(i*0.1) == B:
                ans = min(ans, i)

    if ans != INF:
        print(ans)
    else:
        print(-1)

    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:
from math import ceil
a, b = map(int, input().split())
for i in range(int(a / 0.08), ceil((a + 1) / 0.08)):
    if int(i * 0.1) == b:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

ans=-1

for i in range(1,101):
	a = int(i * 0.08)
	if A!=a: continue
	
	b = int(i * 0.1)
	if B!=b: continue
	
	ans=i
	break

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
  a, b = input_list()
  ans = []
  for i in range(1, 101):
    ai = i * 0.08
    bi = i * 0.1
    if int(ai) == a and int(bi) == b:
      ans.append(i)
  if len(ans) == 0:
    print(-1)
  else:
    print(min(ans))
    
def input_list():
  return map(int, input().split())

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

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

import math
import fractions
from functools import reduce
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B=[int(x) for x in input().rstrip().split()]
count=0
for i in range(1,101):
    ans1=int(0.08*i)
    ans2=int(0.1*i)
    if ans1==A and ans2==B:
        print(i)
        count=1
        break
if count==0:
    print(-1)

Submission status: Wrong Answer

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

ans = 1

while True:
    if ans == 801:
        ans = -1
        break
    if int(ans * 0.08) == A and int(ans * 0.1) == B:
        break
    ans += 1

print(ans)

Submission status: Wrong Answer

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

a_min = a/0.08
a_max = (a+1)/0.08
b_min = b/0.1
b_max = (b+1)/0.1

if a_min <= b_min:
    if b_min < a_max:
        print(int(b_min))
    else:
        print('-1')
else:
    if a_min < b_max:
        print(int(a_min))
    else:
        print('-1')

Submission status: Wrong Answer

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

flg = 0
for i in range(1, math.ceil(max(a,b)//0.08)):
    aa = math.floor(i * 0.08)
    bb = math.floor(i * 0.1)
    if a == aa and b == bb:
        print(i)
        flg = 1
        exit()

if flg == 0:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
x = int(a / 0.08)
x_upp = int((a+1)/0.08)
y = int(b / 0.1)
y_upp = int((b+1)/0.1)
lst1 = list(i for i in range(x, x_upp+1))
lst2 = list(i for i in range(y, y_upp+1))

res = -1
for n in lst1:
    if n in lst2:
        res = n
        break
print(res)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
x = math.ceil(a / 0.08)
y = math.ceil(b / 0.1)
if math.floor(x * 0.08) == math.floor(y * 0.1):
    print(max(x, y))
else:
    print(-1)

Submission status: Wrong Answer

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

x = floor(a / 0.08)
y = floor(b / 0.1)

x, y = min(x, y), max(x, y)
for i in range(x, y + 1):
    if floor(i * 0.08) == a and floor(i * 0.1) == b:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B= map(int,input().split())
min_x = math.ceil(max(A/8,B/10)*100)
max_x = (min((A+1)/8,(B+1)/10)*100)

if max_x-min_x>0:
    ans = min_x
else:
    ans = -1
print(ans)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())

x = int(n/0.08)
y = int(x*0.1)

if m == y:
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
a = int(A / 0.08)
ans_lst = []
while True:
    if int(a * 0.08) == A:
        ans_lst.append(a)
    else:
        break
    a += 1
for i in ans_lst:
    if int(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
vA=[]
vB=[]
for i in range(101):
    if int(i*0.08) == A: vA.append(i)
    if int(i*0.1) == B: vB.append(i)
        
ans=10000

for i in vA:
    if i in vB:ans=min(ans,i)
for i in vB:
    if i in vA:ans=min(ans,i)

if ans==10000: ans=-1        

print(ans)

Submission status: Wrong Answer

Solution code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    A, B = MI()
    A = int(A/0.08)
    B = int(B/0.1)
    if A==B:
        print(A)
    else:
        print(-1)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

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

minA = math.floor(A / 0.08)
minB = math.floor(B / 0.1)
small = min(minA, minB)
large = max(minA, minB)

#print (minA,minB)

for i in range(small, large+1):
    if (math.floor(i * 0.08) == A and math.floor(i * 0.1) == B):
        print (i)
        exit(0)
print ("-1")

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
x7 = math.floor(a / 0.08)
x10 = math.floor(b / 0.1)

for i in range(x10 - 1, x7 + 2):
    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:
A, B = map(int, input().split())
ans = -1
for i in range(1251):
  if int(i / 0.08) == A and int(i / 0.1) == B:
    ans = i
    break

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import math as m

def main(**kwargs):
    if len(range(max(int(a / 0.08), int(b / 0.1)), min(int((a + 1) / 0.08 + 1), int((b + 1) / 0.1 + 1)))) > 0:
        res = max(int(a / 0.08), int(b / 0.1))
        
    else:
        res = -1

    return res

if __name__ == "__main__":
    cin = np.array(input().split(" ")).astype("int")
    a, b, *_ = cin

    cout = main(a=a, b=b)
    print(cout)

Submission status: Wrong Answer

Solution code:
a, b = input().split()
a, b = int(a), int(b)
# ans_a = (0.08) / a
# ans_b = (0.1) / b
ans_a = a / 0.08

# ans_b = b /0.1
ans_b = ans_a * 0.1

# print("a", ans_a)
# print("b", ans_b)

if b != int(ans_b):
    print("-1")
else:
    print(int(ans_a))

Submission status: Wrong Answer

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

ans = 10**9
for i in range(1, 101):
    if (i*8)//100 == a and (i*10)//100 == b:
        ans = min(ans, i)
if ans == 10**9:
    print(-1)
else:
    print(ans)

Submission status: Wrong Answer

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


def solve(A: int, B: int):
    # INF = 1001001
    ans = 1
    for _ in range(101):
        e = math.floor(ans * 0.08)
        t = math.floor(ans * 0.1)
        if e == A and t == B:
            print(ans)
            return
        ans += 1
    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: Wrong Answer

Solution code:
d8 = {}
d10 = {}
for i in range(1, 10000):
    if int(i * 0.08) not in d8:
        d8[int(i * 0.08)] = i
    if int(i * 0.1) not in d10:
        d10[int(i * 0.1)] = i

A, B = map(int, input().rstrip().split())
a = d8.get(A, None)
b = d10.get(B, None)
if a != b or a is None or b is None:
    print(-1)
else:
    print(a)

Submission status: Wrong Answer

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
    else:
        break
indexb = 0
while True:
    tmp = math.floor((tmpb + indexb) * 0.1)
    if tmp == B:
        blst.append(tmpb + indexb)
        indexb += 1
    else:
        break
ans = -1
for i in alst:
    if blst.count(i) == 1:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a1 = math.ceil( A /0.08 )
a2 = math.ceil( (A+1) /0.08 )

b1 = math.ceil( B /0.1 )
b2 = math.ceil( (B+1) /0.1 )

ans = max(a1,b1)
if ans >= a1 and ans <= a2 and ans >= b1 and ans <= b2:
  print(ans)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
from math import floor
A, B = map(int, input().split())
OK = False
for n in range(1, 1001):
    if int(floor(n*0.08)) == A and int(floor(n*0.10)) == B:
        OK = True
        ans = n
print(ans if OK else '-1')

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    a, b = map(int, input().split())
    x = a*100//8
    y = b*10

    res = int(max(x, y))
    if res > 100:
        print(-1)
    else:
        print(res)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin
a,b = [int(x) for x in stdin.readline().rstrip().split()]
x = a * 25 // 2
y = b * 10
ant = 0
while int(x * 0.08) == a:
    if int(x * 0.1) == b:
        ant = 1
        print(x)
        break
    x += 1
if ant == 0:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = [int(i) for i in input().split()]
# int(0.08x)=a
# int(0.1x) = b
first = [math.ceil(12.5*a), math.floor(12.5*a+12.5)]
second = [10*b, 10*b+10]
if second[0] <= first[1] and first[0] <= second[1]:
    print(max(second[0], first[0]))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip() 
import math

def resolve():
    A, B = map(int, input().split())
    ans = -1
    for i in range(1000):
        if math.floor(i*0.08)==A and math.floor(i*0.10)==B:
            ans = i
            break
    print(ans)


if __name__ == '__main__':
    resolve()