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:


A,B = list(map(int, input().split()))
A *= 10
B *= 10
a = [c for c in range(A,A+10)]
b = [c for c in range(B,B+10)]
cnt_a = []
cnt_b = []
for i in range(10):
    cnt_a.append(a[i]/0.08)
    cnt_b.append(b[i]/0.10)
ans = 10e7
is_true = False
for i in cnt_a:
    for j in cnt_b:
        if i == j:
            ans = min(ans, j)
            is_true = True
if is_true:
    print(int(ans//10))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:


A,B = list(map(int, input().split()))
A *= 10
B *= 10
a = [c for c in range(A,A+10)]
b = [c for c in range(B,B+10)]
cnt_a = []
cnt_b = []
for i in range(10):
    cnt_a.append(int(a[i]/0.08))
    cnt_b.append(int(b[i]/0.10))
ans = 10e7
is_true = False
for i in cnt_a:
    for j in cnt_b:
        if i == j:
            ans = min(ans, j)
            is_true = True
if is_true:
    print(ans//10)
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)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
a = 0
x = 1
while a == 0:
    if int(x * 0.08) == A:
        if int(x * 0.1) == B:
            a = 1
            print(x)
            exit()
        else:
            x += 1
    else:
        x += 1
    if x > B / 0.09:
        print(-1)
        a = 1

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
no_tax_a = int(a / 0.08)
no_tax_b = int(b / 0.10)

tmp = 0
for i in range(min(no_tax_a,no_tax_b),max(no_tax_a,no_tax_b)+1):
    if int(i * 0.08) == a and int(i * 0.10) == b:
        tmp = 1
        break
if tmp == 1:
    print(i)
else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(b,1001):
    if i*8//100  == a:
        ans = i
        break
else:
    ans = -1

print(ans)

Submission status: Wrong Answer

Solution code:
# ABC158 C - Tax Increase
a,b = map(int,input().split())
import math
c=10000
for i in range(101):
    if math.floor(i*0.08)==a and math.floor(i*0.10)==b:
        c = min(c,i)
if c==10000:
    print(-1)
    exit()
print(c)

Submission status: Wrong Answer

Solution code:
# ABC158 C - Tax Increase
a,b = map(int,input().split())
import math
c=10000
for i in range(100):
    if math.floor(i*0.08)==a and math.floor(i*0.10)==b:
        c = min(c,i)
if c==10000:
    print(-1)
    exit()
print(c)

Submission status: Wrong Answer

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

for i in range(a//2,a):
    aa = ( i * 8 ) // 100
    bb = ( i * 10 ) // 100
    if aa == a and bb == b:
        print(i)
        exit()
print("-1")

Submission status: Wrong Answer

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

for i in range(1,1010):
    aa = ( i * 8 ) // 100
    bb = ( i * 10 ) // 100
    if aa == a and bb == b:
        print(i)
        exit()

Submission status: Wrong Answer

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

for i in range(1,101):
    aa = ( i * 8 ) // 100
    bb = ( i * 10 ) // 100
    if aa == a and bb == b:
        print(i)
        exit()

Submission status: Wrong Answer

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

ans = -1

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

print(ans)

Submission status: Wrong Answer

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

a = [i for i in range(int(A*100/8 ), int((A+1)*100/8 ))]
b = [i for i in range(int(B*100/10), int((B+1)*100/10))]

ans = list(set(a) & set(b))
if ans and min(ans) > 0:
    print(min(ans))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
def tax_increase():
    """
    消費税率 8% → 消費税 A円
    消費税率 10% → 消費税 B円
    商品価格 X = A / 0.08  → 25A / 2
        　　 X = B / 0.1   → 10B
    消費税は切り捨てなので、消費税の範囲は
    A <= X < A+1
    """
    # 入力
    A, B = map(int, input().split())
    # 初期処理
    tax_excluded_price_list1 = list()
    tax_excluded_price_list2 = list()
    # 消費税率 8%
    tax_excluded_price_low = 25 * A / 2 # 税抜き価格1
    tax_excluded_price_low = int(tax_excluded_price_low) # 小数点以下切り捨て1
    tax_excluded_price_high = 25 * (A+1) / 2 # 税抜き価格2
    tax_excluded_price_high = int(tax_excluded_price_high) # 小数点以下切り捨て2
    # 税抜き価格の取り得る範囲
    for i in range(tax_excluded_price_low, tax_excluded_price_high+1):
        tax_excluded_price_list1.append(i)
    # 消費税率 10%
    tax_excluded_price_low = 10 * B # 税抜き価格1
    tax_excluded_price_low = int(tax_excluded_price_low) # 小数点以下切り捨て1
    tax_excluded_price_high = 10 * (B+1) # 税抜き価格2
    tax_excluded_price_high = int(tax_excluded_price_high) # 小数点以下切り捨て2
    # 税抜き価格の取り得る範囲
    for i in range(tax_excluded_price_low, tax_excluded_price_high+1):
        tax_excluded_price_list2.append(i)
    # 最も小さい金額で条件を満たすもの
    for i in tax_excluded_price_list1:
        if i in tax_excluded_price_list2:
            return i
    # 条件を満たす税抜き価格がない場合
    return '-1'
    
result = tax_increase()
print(result)

Submission status: Wrong Answer

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

a = [i for i in range(int(A*100/8), int((A+1)*100/8))]
b = [i for i in range(B*10, (B+1)*10)]

ans = list(set(a) & set(b))
if ans and min(ans) > 0:
	print(min(ans))
else:
	print(-1)

Submission status: Wrong Answer

Solution code:
# C Tax Increase

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

a = [i for i in range(int(A*100/8), int((A+1)*100/8))]
b = [i for i in range(B*10, (B+1)*10)]

ans = list(set(a) & set(b))
if ans:
  print(min(ans))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
# C Tax Increase

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

a = [i for i in range(int(A*12.5), int((A+1)*12.5))]
b = [i for i in range(B*10, (B+1)*10)]

ans = list(set(a) & set(b))
if ans:
  print(min(ans))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
# C Tax Increase

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

a = [i for i in range(int(A*100/8), int((A+1)*100/8))]
b = [i for i in range(B*10, (B+1)*10)]

ans = list(set(a) & set(b))
if ans:
  print(min(ans))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
# C Tax Increase

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

a = [i for i in range(A*100//8, (A+1)*100//8)]
b = [i for i in range(B*10, (B+1)*10)]

ans = list(set(a) & set(b))
if ans:
  print(min(ans))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
# C Tax Increase

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

a = [i for i in range(A*100//8, (A+1)*100//8)]
b = [i for i in range(B*10, (B+1)*10)]

for aa in a:
  if aa in b:
    print(aa)
    exit()
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
# C Tax Increase

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

a = [i for i in range(A*100//8, (A+1)*100//8)]
b = [i for i in range(B*10, (B+1)*10)]

if len(a) <= len(b):
  for aa in a:
    if aa in b:
      print(aa)
      exit()
  else:
    print(-1)
else:
  for bb in b:
    if bb in a:
      print(bb)
      exit()
  else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
a_list = []
b_list = []
flag = 0

if a == 0:
    a_list = [i for i in range(1,13)]
elif a == 1:
    a_list = [i for i in range(13,25)]
elif a == 2:
    a_list = [i for i in range(25,38)]
elif a == 3:
    a_list = [i for i in range(38,50)]
elif a == 4:
    a_list = [i for i in range(50,63)]
elif a == 5:
    a_list = [i for i in range(63,75)]
elif a == 6:
    a_list = [i for i in range(75,88)]
elif a == 7:
    a_list = [i for i in range(88,100)]
elif a == 8:
    a_list = [100]

for j in a_list:
    if int(j*1.1)-j == b:
        print(j)
        flag = 1
        break

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

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
a_list = []
b_list = []
flag = 0

if a == 0:
    a_list = [i for i in range(13)]
elif a == 1:
    a_list = [i for i in range(13,25)]
elif a == 2:
    a_list = [i for i in range(25,38)]
elif a == 3:
    a_list = [i for i in range(38,50)]
elif a == 4:
    a_list = [i for i in range(50,63)]
elif a == 5:
    a_list = [i for i in range(63,75)]
elif a == 6:
    a_list = [i for i in range(75,88)]
elif a == 7:
    a_list = [i for i in range(88,100)]
elif a == 8:
    a_list = [100]

for j in a_list:
    if int(j*1.1)-j == b:
        print(j)
        flag = 1
        break

if flag != 1:
    print('-1')

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
a_list = []
b_list = []
flag = 0

for i in range(1,101):
    if int(i*1.08)-i == a:
        a_list.append(i)

for j in a_list:
    if int(j*1.1)-j == b:
        print(j)
        flag = 1
        break

if flag != 1:
    print('-1')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if int(a / 0.08 * 0.1) == b:
  print(int(a / 0.08))
elif int(b / 0.1 * 0.08) == a:
  print(int(b / 0.1))
else:
  print(-1)

Submission status: Wrong Answer

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

if int(int(a / 0.08) * 0.1) == b:
  print(int(a / 0.08))
elif int(int(b / 0.1) * 0.08) == a:
  print(int(b / 0.1))
else:
  print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if int(a / 0.08 * 0.1) == b:
  print(int(a / 0.08 * 0.1))
elif int(b / 0.1 * 0.08) == a:
  print(int(b / 0.1 * 0.08))
else:
  print(-1)

Submission status: Wrong Answer

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

N = 1000
p1 = 0.08
p2 = 0.1

for i in range(1, N + 1):
    if int(i * p1) == A and int(i * p2):
        print(i)
        exit()

print("-1")

Submission status: Wrong Answer

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

N = 100
p1 = 0.08
p2 = 0.1

for i in range(1, N + 1):
    if int(i * p1) == A and int(i * p2):
        print(i)
        exit()

print("-1")

Submission status: Wrong Answer

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


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

  for i in range(101):
    if int(i * 0.08) == A and \
       int(i * 0.10) == B:

      print(i)
      return
  print(-1)


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

Submission status: Wrong Answer

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

a,b = I()
for i in range(1,101):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        sys.exit()

print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
 
e=0
t=0
 
for i in range(1,10000):
	if a<=i*0.08<a+1:
		e=i
	if b<=i*0.1<b+1:
		t=i
	if e!=0 and t!=0 and e==t:
		print(e)
		break
if e==0 and t==0:       
	print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

min_ans = int((12.5*A) // 1)
max_ans = int(-((-12.5*(A+1)) // 1))

ans = -1
for i in range(min_ans,max_ans):
  temp = 0.02*i + A -B 
  if 0 <= temp < 1:
    ans = i
    break

print(ans)

Submission status: Wrong Answer

Solution code:
#57
import decimal
a,b = map(int,input().split())

for i in range(1,10001):
    num1 = int(i*decimal.Decimal("0.08"))
    num2 = int(i*decimal.Decimal("0.1"))
    if num1 == a and num2 == b:
        print(i)
        break
    if i*decimal.Decimal("0.08") > a:
        print("-1")
        break

Submission status: Wrong Answer

Solution code:
#57
import decimal
a,b = map(int,input().split())

for i in range(1,10001):
    num1 = int(i*decimal.Decimal("0.08"))
    num2 = int(i*decimal.Decimal("0.1"))
    if num1 == a and num2 == b:
        print(i)
        break
    if i*0.08 >= a:
        print("-1")
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
N,M = map(int,input().split())
n = math.ceil(N/0.08)
m = int(M/0.1)
print(n,m)
ans = 2000
if int(n*0.1) ==M:
  ans = min(n,ans)
if int(m*0.08) ==N:
  ans =min(m,ans)
  
if int(n*0.1)!=M and int(m*0.08)!=N:
  ans = -1
  
print(ans)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
n = round(N/0.08)
m = round(M/0.1)

ans = 2000
if int(n*0.1) ==M:
  ans = min(n,ans)
if int(m*0.08) ==N:
  ans =min(m,ans)
  
if int(n*0.1)!=M and int(m*0.08)!=N:
  ans = -1
  
print(ans)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
c=[]
d=[]
i=int(A*100/8)
while i<(A+1)*100/8:
  c.append(i)
  i+=1
j=int(B*100/10)
while j<(B+1)*100/10:
  d.append(j)
  j+=1
if min(c[len(c)-1],d[len(d)-1])<max(c[0],d[0]):
  print(-1)
else:
  print(max(c[0],d[0]))

Submission status: Wrong Answer

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

A = []
for i in range(math.floor(a/0.08), math.floor((a+1)/0.08) + 1):
  A.append(i)
  
B = []
for i in range(math.floor(b/0.1), math.floor((b+1)/0.1) + 1):
  B.append(i)
  
C = set(A)&set(B)

if C:
  print(min(C))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
x=a/0.08
out=(a+1)/0.08
if out%1==0:
    out=int(out-1)
else:
    out//=1
if x%1!=0:
    x//=1
    x+=1
for i in range(int(x),int(out)+1):
    if i*0.1>=b:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:

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


def floor_inv(x, f):
    res = x // f
    if int(res * f) < x:
        res += 1
    return res


lb1 = floor_inv(A, 0.08)
ub1 = floor_inv(A + 1, 0.08)

lb2 = floor_inv(B, 0.10)
ub2 = floor_inv(B + 1, 0.10)

if ub1 <= lb2 or ub2 <= lb1:
    print(-1)
else:
    print(max(lb1, lb2))

Submission status: Wrong Answer

Solution code:

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


def floor_inv(x, f):
    res = int(x / f)
    if int(res * f) < x:
        res += 1
    return res


lb1 = floor_inv(A, 0.08)
ub1 = floor_inv(A + 1, 0.08)

lb2 = floor_inv(B, 0.10)
ub2 = floor_inv(B + 1, 0.10)

if ub1 < lb2 or ub2 < lb1:
    print(-1)
else:
    print(max(lb1, lb2))

Submission status: Wrong Answer

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

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 main():
    A,B = MI()
    for i in range(1000):
        if math.floor( i * 0.08 ) == A and math.floor(i * 0.1) == B:
            print(i)
            exit()

    print(-1)


main()

Submission status: Wrong Answer

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

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 main():
    A,B = MI()
    for i in range(101):
        if math.floor( i * 0.08 ) == A and math.floor(i * 0.1) == B:
            print(i)
            exit()

    print(-1)


main()

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=map(int,input().split())
test=int(a/8*100)
if int(test*8/100)==a and b==test//10:
    print(test)
else:print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
eight=[]
ten=[]
for a in range(1,1001):
    if math.floor(a*0.08)==A:
        eight.append(a)
    if math.floor(a*0.1)==B:
        ten.append(a)

for a in eight:
    if a in ten:
        print(a)
        break
    else:
        print("-1")
        break

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
lower_A = round(A/0.08)
if (A+1)/0.08-round((A+1)/0.08)!=0:
    upper_A = round((A+1)/0.08)-1
else:
    upper_A = round((A+1)/0.08)-1
lower_B = round(B/0.1)
if (B+1)/0.1-round((B+1)/0.1)!=0:
    upper_B = round((B+1)/0.1)-1
else:
    upper_B = round((B+1)/0.1)-1
    
#print("A = {}<=A<={} B = {}<=B<={}".format(lower_A,upper_A,lower_B,upper_B))
if (lower_A<=lower_B and lower_B<=upper_A) or (lower_B<=lower_A and lower_A<=upper_B)  :
    print(max(lower_A,lower_B))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
lower_A = round(A/0.08)
if (A+1)/0.08-round((A+1)/0.08)!=0:
    upper_A = round((A+1)/0.08)-1
else:
    upper_A = round((A+1)/0.08)-1
lower_B = round(B/0.1)
if (B+1)/0.1-round((B+1)/0.1)!=0:
    upper_B = round((B+1)/0.1)-1
else:
    upper_B = round((B+1)/0.1)-1
    
print("A = {}<=A<={} B = {}<=B<={}".format(lower_A,upper_A,lower_B,upper_B))
if (lower_A<=lower_B and lower_B<=upper_A) or (lower_B<=lower_A and lower_A<=upper_B)  :
    print(max(lower_A,lower_B))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
lower_A = round(A/0.08)
if (A+1)/0.08-round((A+1)/0.08)!=0:
    upper_A = round((A+1)/0.08)
else:
    upper_A = round((A+1)/0.08)-1
lower_B = round(B/0.1)
if (B+1)/0.1-round((B+1)/0.1)!=0:
    upper_B = round((B+1)/0.1)
else:
    upper_B = round((B+1)/0.1)-1
if (lower_A<=lower_B and lower_B<=upper_A) or (lower_B<=lower_A and lower_A<=upper_B)  :
    print(max(lower_A,lower_B))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
lower_A = round(A/0.08)
if (A+1)/0.08-round((A+1)/0.08)!=0:
    upper_A = round((A+1)/0.08)
else:
    upper_A = round((A+1)/0.08)-1
lower_B = round(B/0.1)
if (B+1)/0.1-round((B+1)/0.1)!=0:
    upper_B = round((B+1)/0.1)
else:
    upper_B = round((B+1)/0.1)-1
if lower_A<=lower_B and lower_B<=upper_A:
    print(max(lower_A,lower_B))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
a,b=map(int,input().split())

x = int((100*a)/8)
if int(x*0.1)==b:
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

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

x1 = a / 0.08
x2 = b / 0.1

if int(x2 * 0.08) == a:
    if int(x1 * 0.1) == b:
        print(int(min(x1, x2)))
    else:
        print(x2)
elif int(x1 * 0.1) == b:
    print(int(x1))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
for price in range(1,101) :
    if int(price*0.08) == a and int(price*0.10) == b :
        print(price)
        break
else :
    print("-1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():

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

    lo = max(1000 * a, 800 * b)
    hi = min(1000 * (a + 1), 800 + (b + 1))

    if lo < hi:
        print(math.ceil(lo / 80))
    else:
        print(-1)


main()

Submission status: Wrong Answer

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

    lo = int(max(a * 100 / 8, b * 10))
    hi = int(min((a + 1) * 100 / 8, (b + 1) * 10))

    if lo <= hi:
        print(lo)
    else:
        print(-1)


main()

Submission status: Wrong Answer

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

lo = int(max(a * 100 / 8, b * 10))
hi = int(min((a + 1) * 100 / 8, (b + 1) * 10))

if lo < hi:
  print(lo)
else:
  print(-1)

Submission status: Wrong Answer

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

ans = 1000
for n in range(1001):
  if n * 8 // 100 == a and n * 10 // 100 == b:
    ans = min(ans, n)

if ans < 1000:
  print(ans)
else:
  print(-1)

Submission status: Wrong Answer

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

import math
flag = True
for i in range(1009):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10):
        print(i)
        flag = False
        break
if flag:
    print(-1)

Submission status: Wrong Answer

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

import math
aS = math.ceil(a / 0.08)
al = math.floor((a + 1) / 0.08)
bs = math.ceil(b / 0.10)
bl = math.floor((b + 1) / 0.10)

flag = True
for i in range(1000):
    if aS <= i < al and bs <= i < bl:
        print(i)
        flag = False
        break
if flag:
    print(-1)

Submission status: Wrong Answer

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

import math
aS = math.ceil(a / 0.08)
al = math.floor((a + 1) / 0.08)
bs = math.ceil(b / 0.10)
bl = math.floor((b + 1) / 0.10)

for i in range(1000):
    if aS <= i < al and bs <= i < bl:
        print(i)
        break

Submission status: Wrong Answer

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

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

for i in range(A,B+1):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        break
    if int(i*0.08) != a or int(i*0.1) != b:
        print('-1')
        break

Submission status: Wrong Answer

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

A = int(a/0.08)
B = int(b/0.08)

for i in range(A,B+1):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        break
    if int(i*0.08) != a or int(i*0.1) != b:
        print('-1')
        break

Submission status: Wrong Answer

Solution code:
import math

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

n = math.floor(a / 0.08)
m = math.floor(b / 0.1)
n2 = n + 1
m2 = m + 1

p = math.floor(n * 0.08)
q = math.floor(n * 0.1)
x = math.floor(m * 0.08)
y = math.floor(m * 0.1)
p2 = math.floor(n2 * 0.08)
q2 = math.floor(n2 * 0.1)
x2 = math.floor(m2 * 0.08)
y2 = math.floor(m2 * 0.1)

if p == a and q == b and x == a and y == b:
    print(min(n,m))
elif p == a and q == b:
    print(n)
elif x == a and y == b:
    print(m)
if p2 == a and q2 == b and x2 == a and y2 == b:
    print(min(n2,m2))
elif p2 == a and q2 == b:
    print(n2)
elif x2 == a and y2 == b:
    print(m2)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

n = math.floor(a / 0.08)
m = math.floor(b / 0.1)

p = math.floor(n * 0.08)
q = math.floor(n * 0.1)
x = math.floor(m * 0.08)
y = math.floor(m * 0.1)

if p == a and q == b and x == a and y == b:
    print(min(n,m))
elif p == a and q == b:
    print(n)
elif x == a and y == b:
    print(m)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(float,input().split())
c = a*12.5+0.001
d = b*10+0.001
if(int(c/10)==int(d/10)):
  ans = max(int(c),int(d))
else:
  ans = -1
print(ans)

Submission status: Wrong Answer

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

a1 = math.ceil(A / 0.08)
a2 = math.floor((A+1) / 0.08)
b1 = math.ceil(B / 0.10)
b2 = math.floor((B+1) / 0.10)

ans = -1
for i in range(a1,a2+1):
    for j in range(b2,b1-1, -1):
        if i > j:
            break;
        if i == j:
            ans = i
            break;
    if ans > -1:
        break;
print(ans)

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.10)
b2 = math.ceil((B+1) / 0.10)

ans = -1
for i in range(a1,a2+1):
    for j in range(b2,b1-1, -1):
        if i > j:
            break;
        if i == j:
            ans = i
            break;
    if ans > -1:
        break;
print(ans)

Submission status: Wrong Answer

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

for n in range(1000):
    xa = int(n * 0.08)
    xb = int(n * 0.1)
    if a == xa and b == xb:
        print(n)
        exit()
print(-1)

Submission status: Wrong Answer

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

for n in range(10000):
    xa = n * 0.08
    xb = n * 0.1
    if a == xa and b == xb:
        print(n)
        exit()
print(-1)

Submission status: Wrong Answer

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

for n in range(1000):
    xa = n * 0.08
    xb = n * 0.1
    if a == xa and b == xb:
        print(n)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
A, B = [int(_) for _ in input().split()]
aa = [int(i * 0.08) for i in range(1, 100)]
bb = [int(i * 0.1) for i in range(1, 100)]
for i, a, b in zip(range(1, 100), aa, bb):
    if (a, b) == (A, B):
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

ax = math.floor(a/0.08)
bx = math.floor(b/0.1)

if ax == bx:
    print(ax)
    exit()

axs = [ax + i for i in range(13)]
bxs = [bx + i for i in range(10)]

xs = axs + bxs

l = [x for x in set(xs) if xs.count(x) > 1]

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

Submission status: Wrong Answer

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

if int(0.1 * a) != int(0.08 * b):
    print(-1)
    exit()

print(int(a/0.08))

Submission status: Wrong Answer

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

x = A / 0.08
y = B / 0.1

for i in range(int(y) - 1, int(x) + 1):
    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
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

x = A / 0.08
y = B / 0.1

for i in range(int(y), int(x) + 1):
    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())
a_left = a*12.5
a_right = (a+1)*12.5
b_left = b*10
b_right = (b+1)*10

if a_right < b_left:
  print(-1)
elif a_left > b_right:
  print(a_left)
else:
  print(int(max(a_left, b_left)))

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
#print(A/0.08)
#print(B/0.1)
ga = math.ceil(A/0.08)
gb = math.ceil(B/0.1)

for i in range(ga,gb+1):
  #print(math.floor(i*0.08) ,math.floor(i*0.1))
  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())
ah,bh=a+.99,b+.99
a1,a2=a/.08,ah/.08
b1,b2=b/.1,bh/.1
if a2<b1 or b2<a1: print(-1)
else:
    if b1<=a1<=b2: print(round(a1))
    elif a1<=b1<=a2: print(round(b1))
    elif b1<=a2<=b2: print(round(a2))
    elif a1<=b2<=a2: print(round(b2))