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:
import sys
A, B = list(map(int, input().split()))
for i in range(1,101):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        sys.exit(0)

print('-1')

Submission status: Wrong Answer

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

print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

a, b = map(int, input().split())
a1 = set([i for i in range(int(a/0.08),int((a+1)/0.08)+1)])
b1 = set([i for i in range(int(b/0.1), int((b+1)/0.1)+1)])
c = a1 & b1
if len(c) == 0:
  print(-1)
else:
  print(min(c))

Submission status: Wrong Answer

Solution code:
import math
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:
  A_min, B_min = B_min, A_min
  A_max, B_max = B_max, A_max
if A_min > B_max:
  print(-1)
  exit()
else:
  print(math.ceil(A_min))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
from decimal import Decimal as D

input = sys.stdin.readline


def ST():
    return input().rstrip()


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


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


def LI():
    return list(MI())


A, B = MI()

for i in range(1, 251):
    a = int(D(i) * D("0.08"))
    b = int(D(i) * D("0.1"))

    if A == a and B == b:
        print(i)
        exit()

print(-1)

Submission status: Wrong Answer

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

input = sys.stdin.readline


def ST():
    return input().rstrip()


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


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


def LI():
    return list(MI())


A, B = MI()

for i in range(1, 251):
    a = int(i * decimal.Decimal("0.08"))
    b = int(i * decimal.Decimal("0.1"))

    if A == a and B == b:
        print(i)
        exit()

print(-1)

Submission status: Wrong Answer

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

input = sys.stdin.readline


def ST():
    return input().rstrip()


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


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


def LI():
    return list(MI())


A, B = MI()

for i in range(1, 251):
    if int(i * decimal.Decimal(0.1)) == B and int(i * decimal.Decimal(0.08)) == A:
        print(i)
        exit()

print(-1)

Submission status: Wrong Answer

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

input = sys.stdin.readline


def ST():
    return input().rstrip()


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


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


def LI():
    return list(MI())


A, B = MI()

for i in range(1, 101):
    if int(i * decimal.Decimal(0.1)) == B and int(i * decimal.Decimal(0.08)) == A:
        print(i)
        exit()

print(-1)

Submission status: Wrong Answer

Solution code:
def check(x):
    if (x*10)//100>=b and (x*8)//100>=a: return True
    else: return False

a,b=map(int,input().split())
l=0 
r=10**9
while(l<r):
    mid=(l+r)//2
    if check(mid):r=mid
    else: l=mid+1
print(l if (l*10)//100 == (l*8)//100 else -1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
a_list = [int(a/0.08) + i for i in range(13)]
b_list = [int(b/0.1) + j for j in range(10)]
com = set(a_list) & set(b_list)

if len(com) == 0:
    print(-1)
elif len(com) != 0:
    if int(min(com)*0.08) != a or int(min(com)*0.1) != b:
        print(-1)
    else:
        print(min(com))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
a_list = [int(a/0.08) + i for i in range(13)]
b_list = [int(b/0.1) + j for j in range(10)]
com = set(a_list) & set(b_list)
print(a_list)
print(b_list)
print(com)

if len(com) == 0:
    print(-1)
elif len(com) != 0:
    if int(min(com)*0.08) != a or int(min(com)*0.1) != b:
        print(-1)
    else:
        print(min(com))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
a_list = [int(12.5*a + i) for i in range(13)]
b_list = [int(10*b + j) for j in range(10)]
com = set(a_list) & set(b_list)

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
a_list = [int(12.5*a + i) for i in range(12)]
b_list = [int(10*b + j) for j in range(10)]
com = set(a_list) & set(b_list)

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
a_list = [int(12.5*a + i) for i in range(8)]
b_list = [int(10*b + j) for j in range(10)]
com = set(a_list) & set(b_list)

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
def main():
    A, B = map(int, input().split())

    a = 25 * A // 2
    b = 10 * B
    if a // 100 == b // 100:
        print(a)
    else:
        print(-1)
    # print(a, b)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
def main():
    A, B = map(int, input().split())

    a = 25 * A // 2
    b = 10 * B
    if a // 10 == b // 10:
        print(a)
    else:
        print(-1)
    # print(a, b)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import numpy as np
import sys
A,B=map(int,input().split())

X=int(A/0.08)+1
Y=int(B/0.10)
answer=10**5

for i in range(Y,X):
    if int(i*0.08)==A and int(i*0.1)==B and answer>i:
        answer=i

if answer!=10**5:
    print(answer)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import numpy as np
import sys
A,B=map(int,input().split())

X=int(A/0.08)
Y=int(X*0.1)

if Y==B:
    print(X)
else:
    print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

def calc(percent,tax):
  return math.ceil((tax*100)/percent)


def main():
  print(calc(10,B) if calc(10,B)<=calc(8,A)<calc(10,B+1) else -1)

  
if __name__=='__main__':
  A, B = map(int, input().split())
  main()

Submission status: Wrong Answer

Solution code:
def calc(percent,tax):
  return -(-(tax*100)//percent)


def main():
  print(calc(8,A) if calc(10,B)<=calc(8,A)<calc(10,B+1) else -1)

  
if __name__=='__main__':
  A, B = map(int, input().split())
  main()

Submission status: Wrong Answer

Solution code:
def calc(percent,tax):
  return (tax*100)//percent


def main():
  print(calc(8,A) if calc(10,B)<=calc(8,A)<calc(10,B+1) else -1)

if __name__=='__main__':
  A, B = map(int, input().split())
  main()

Submission status: Wrong Answer

Solution code:
a = input().split()
b = int(a[0])
c = int(a[1])
import math

minb = math.ceil(b * 12.5)
maxb = math.floor((b+1) * 12.5)

minc = math.ceil(c * 10)
maxc = math.floor((c+1) * 10)

if max([minb,minc]) <= min([maxb,maxc]):
  print(max([minb,minc]))
else:
  print("-1")

Submission status: Wrong Answer

Solution code:
a = input().split()
b = float(a[0])
c = float(a[1])
import math

minb = math.ceil(b * 12.5)
maxb = math.floor((b+1) * 12.5)

minc = math.ceil(c * 10)
maxc = math.floor((c+1) * 10)

if max([minb,minc]) <= min([maxb,maxc]):
  print(max([minb,minc]))
else:
  print("-1")

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
ans = 0
AT = 0.08
BT = 0.1

a = A/AT
b = B/BT
aPlus = (A+1)/AT
bPlus = (B+1)/BT

if a == b :
    ans = a
elif a < b :
    if aPlus < b :
        ans = -1
    else :
        ans = b
elif b < a :
    if bPlus < a :
        ans = -1
    else :
        ans = a

# print(a,b)
# print(aPlus,bPlus)
print(math.ceil(ans))

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
ans = 0
AT = 0.08
BT = 0.1

a = A/AT
b = B/BT
aPlus = (A+1)/AT
bPlus = (B+1)/BT

if a == b :
    ans = a
elif a < b :
    if aPlus < b :
        ans = -1
    else :
        ans = b
elif b < a :
    if bPlus < a :
        ans = -1
    ans = a

# print(a,b)
# print(aPlus,bPlus)
print(math.ceil(ans))

Submission status: Wrong Answer

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

import math
limit = int(100 // 0.8 + 1)
for i in range(1,limit+10):
  v_a = i * 0.08
  v_b = i * 0.1
  if math.floor(v_a) == a and math.floor(v_b) == b:
    print(i)
    exit(0)

print(-1)

Submission status: Wrong Answer

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

import math
limit = int(100 // 0.8 + 1)
result = limit + 100
for i in range(1,limit+10):
  v_a = i * 0.08
  v_b = i * 0.1
  if math.floor(v_a) == a and math.floor(v_b) == b:
    result = min(result, i)

if result == limit + 100:
  print(-1)
else:
  print(result)

Submission status: Wrong Answer

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

import math
limit = int(100 // 0.8 + 1)
result = limit + 100
for i in range(1,limit+1):
  v_a = i * 0.08
  v_b = i * 0.1
  if math.floor(v_a) == a and math.floor(v_b) == b:
    result = min(result, i)

if result == limit + 100:
  print(-1)
else:
  print(result)

Submission status: Wrong Answer

Solution code:
A_tax, B_tax = map(int,input().split())

for i in range(100):
    for j in range(10):
        if (A_tax+i*0.01)/0.08 == (B_tax+j*0.1)/0.1:
            print(int((A_tax+i)/0.08))
            exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
A = int(a/0.08)
B = int(b/0.1)
al = []
bl = []
i = 1
while True:
  j = 0
  if(int((A+i)*0.08) == a):
    al.append(int(A+i))
  else:
    j += 1
  if(int((A-i)*0.08) == a):
    al.append(int(A-i))
  else:
    j += 1
  if(j==2):
    break
  i+=1
k = 1
while True:
  j = 0
  if(int((B+i)*0.08) == b):
    bl.append(int(B+i))
  else:
    j += 1
  if(int((B-i)*0.08) == b):
    bl.append(int(B-i))
  else:
    j += 1
  if(j==2):
    break
  k+=1
al.sort()
ans = -1
for i in range(len(al)):
  if(al[i] in bl):
    ans = al[i]
    break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

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


# xが１０円から１００００円まで

ans = -1

for i in range(10,10001):
    a1 = int(i*0.08)
    b1 = int(i*0.1)
    if (a1 == a and b1 == b):
        ans = int(i*1.008)
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil, floor

def main():
    a, b = map(int, input().split())
    p8_l = ceil(a / 0.08)
    p8_h = floor((a+1) / 0.08)
    p10_l = int(b / 0.10)
    p10_h = int((b+1) / 0.10) - 1
    if p8_h >= p10_h >= p8_l:
        print(p8_l)
    elif p8_l <= p10_l <= p8_h:
        print(p10_l)
    else:
        print(-1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from math import ceil

def main():
    a, b = map(int, input().split())
    p8_l = ceil(a / 0.08)
    p8_h = ceil((a+1) / 0.08)
    p10_l = int(b / 0.10)
    p10_h = int((b+1) / 0.10) - 1
    if p8_h >= p10_h >= p8_l:
        print(p8_l)
    elif p8_l <= p10_l <= p8_h:
        print(p10_l)
    else:
        print(-1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from math import ceil

def main():
    a, b = map(int, input().split())
    p8_l = ceil(a / 0.08)
    p8_h = ceil((a+1) / 0.08)
    p10_l = int(b / 0.10)
    p10_h = int((b+1) / 0.10) - 1
    if p10_h >= p8_l and p10_l <= p8_h:
        print(p8_l)
    elif p8_l <= p10_l and p10_l <= p8_h:
        print(p10_l)
    else:
        print(-1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from math import ceil

def main():
    a, b = map(int, input().split())
    p8_l = ceil(a / 0.08)
    p8_h = int((a+1) / 0.08)
    p10_l = int(b / 0.10)
    p10_h = int((b+1) / 0.10) - 1
    if p10_h >= p8_l and p10_l <= p8_h:
        print(p8_l)
    elif p8_l > p10_h:
        print(-1)
    elif p8_h < p10_l:
        print(-1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from math import modf

def main():
    a, b = map(int, input().split())
    i, p8_l = modf(a / 0.08)
    if i == 0.5:
        p8_l + 1
    p8_l = int(p8_l)
    p8_h = int((a+1) / 0.08)
    p10_l = int(b / 0.10)
    p10_h = int((b+1) / 0.10)
    if p10_h >= p8_l and p10_l <= p8_h:
        print(p8_l)
    elif p8_l > p10_h:
        print(-1)
    elif p8_h < p10_l:
        print(-1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    a, b = map(int, input().split())
    p8_l = int(a / 0.08)
    p8_h = int((a+1) / 0.08)
    p10_l = int(b / 0.10)
    p10_h = int((b+1) / 0.10)
    if p10_h >= p8_l and p10_l <= p8_h:
        print(p8_l)
    elif p8_l > p10_h:
        print(-1)
    elif p8_h < p10_l:
        print(-1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    a, b = map(int, input().split())
    p8_l = int(a / 0.08)
    p8_h = int((a+1) / 0.08)
    p10_l = int(b / 0.10)
    p10_h = int((b+1) / 0.10)
    if p10_h >= p8_l and p10_l <= p8_h:
        print(p8_l)
    else:
        print(-1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
tmp_a = int((a / 0.08) // 1)
tmp_b = int((b / 0.10) // 1)
check = True
for i in range(min(tmp_a,tmp_b), max(tmp_a, tmp_b) + 1):
    if int((i * 0.08)//1) == a and int((i * 0.10)//1) == b:
        print(i)
        check = False
        break
if check:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
tmp_a = int((a / 0.08) // 1)
tmp_b = int((a / 0.10) // 1)
check = True
for i in range(min(tmp_a,tmp_b), max(tmp_a, tmp_b) + 1):
    if int((i * 0.08)//1) == a and int((i * 0.10)//1) == b:
        print(i)
        check = False
        break
if check:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
tmp_a = int((a / 0.08) // 1)
tmp_b = int((a / 0.10) // 1)
check = True
for i in range(tmp_b, tmp_a + 1):
    if int((i * 0.08)//1) == a and int((i * 0.10)//1) == b:
        print(i)
        check = False
        break
if check:
    print(-1)

Submission status: Wrong Answer

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

ax = math.ceil(a*25/2)
ay = math.floor((a+1)*25/2)
bx = math.ceil(b*10)
by = math.floor((b+1)*10)

if ay < bx:
    print(-1)
else:
    print(ax)

Submission status: Wrong Answer

Solution code:
#C - Tax Increase
import math
A,B = map(int,input().split())

x = int(math.floor(A*(100/8)))
y = int((B*(100/10)))

ans = '-1'
for i in range(1,max(x,y)+1):
    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:
#C - Tax Increase
import math
A,B = map(int,input().split())

x = int(math.floor(A*(100/8)))
y = int((B*(100/10)))

ans = '-1'
for i in range(1,max(x,y)+1):
    if math.floor(i * 0.08)== A and math.floor(i*0.1) == B:
        ans = i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

def main():
    a, b = map(int, input().split())
    tmp_a_min = math.ceil(a / 0.08)
    tmp_a_max = math.ceil((a+1) / 0.08)
    tmp_b_min = math.ceil(b / 0.1)
    tmp_b_max = math.ceil((b+1) / 0.1)
    tmp_a = list(range(tmp_a_min, tmp_a_max))
    tmp_b = list(range(tmp_b_min, tmp_a_max))
    tmp = set(tmp_a) & set(tmp_b)
    if len(tmp) != 0:
        print(min(tmp))
    else:
        print(-1)
main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

def main():
    a, b = map(int, input().split())
    tmp_a_min = math.floor(a / 0.08)
    tmp_a_max = math.ceil((a+1) / 0.08)
    # print(tmp_a_min, tmp_a_max)
    for i in range(tmp_a_min, tmp_a_max):
        if math.floor(i * 0.1) == b:
            print(i)
            break
    else:
        print(-1)
main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

def main():
    a, b = map(int, input().split())
    tmp_a_min = math.floor(a / 0.08)
    tmp_a_max = math.floor((a+1) / 0.08)
    # print(tmp_a_min, tmp_a_max)
    for i in range(tmp_a_min, tmp_a_max):
        if math.floor(i * 0.1) == b:
            print(i)
            break
    else:
        print(-1)
main()

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i);  break
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0

for i in range(1,1010):
    A = 0.08 * a
    B = 0.1 * b
    if int(A) == int(B):
        print(int(A))
        cnt += 1
        break
if cnt == 0:
    print(-1)

Submission status: Wrong Answer

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

for i in range(10 ** 5):
  if (i * 0.08) == A and (i * 0.1) == B:
    print(i)
    sys.exit()
  else:
    continue
else:
  print(-1)

Submission status: Wrong Answer

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

X = math.ceil(A / 0.08)
Y = math.ceil(B / 0.1)
N = int((A+1) // 0.08)
M = int((B+1) // 0.1)

for i in range(X, N+1):
    LA.append(i)
for i in range(Y, M+1):
    LB.append(i)

ans = set(LA) & set(LB)
ans_list = list(ans)
if not ans_list:
    print(-1)
else:
    print(ans_list[0])

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
if max(12.5*A,10*B) > min(12.5*(A+1),10*(B+1)):
  print(-1)
else:
  print(math.ceil(max(12.5*A,10*B)))

Submission status: Wrong Answer

Solution code:
import math
a,b = [float(i) for i in input().split()]
ans = 1000000000
flag = False

for i in range(1,1000):
    ans8 = int(math.floor(i*0.08))
    ans10 = int(math.floor(i*0.1))
#     print(ans8,ans10)
    if ans8 == a and ans10 == b:
        ans = min(ans, i) # 更新する必要がある．
        flag = True

if flag is True:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(1,100000):
    ans8 = int(math.floor(i*0.08))
    ans10 = int(math.floor(i*0.1))
#     print(ans8,ans10)
    if ans8 == a and ans10 == b:
        print(i)
        break
    elif i == 100:
        print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for X in range(1,1000):
    if (X*108//100-X)==A and (X*110//100-X)==B:
        print(X)
        exit()
print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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

max_A = (A+1)*12.5
min_A = (A)*12.5
max_B = (B+1)*10.0
min_B = B*10.0

if min_A <= max_B and min_A >= min_B:
    print(ceil(min_A))
elif min_B <= max_A and min_B >= min_A:
    print(ceil(min_B))
else:
    print(-1)

Submission status: Wrong Answer

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

x1 = (A+1)*12.5
x2 = (A)*12.5
x3 = (B+1)*10.0
x4 = B*10.0

result1 = list(range(int(x2), int(x1)+2))
result2 = list(range(int(x4), int(x3)+2))

if min(result1) in result2:
    print(min(result1))
elif min(result2) in result1:
    print(min(result2))
else:
    print(-1)

Submission status: Wrong Answer

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

x1 = (A+1)*12.5
x2 = (A)*12.5
x3 = (B+1)*10.0
x4 = B*10.0

result1 = list(range(int(x2), int(x1)+1))
result2 = list(range(int(x4), int(x3)+1))

if min(result1) in result2:
    print(min(result1))
elif min(result2) in result1:
    print(min(result2))
else:
    print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
mi = 10 * B - 1
x = 0
ma = 11 * B + 1


while x == 0:
    if int(mi * 0.08) == A and int(mi * 0.1) == B:
        x = 1
    elif mi == ma:
        x = 1
        mi = -1
    else:
        mi += 1
print(mi)

Submission status: Wrong Answer

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

it10 = 1/0.1
it08 = 1/0.08

# 消費税額を入力し、その範囲を出力する
def taxrange10(x):
  # 通常の回答
  normal_answer = x * it10
  # 範囲は、整数かつ元々の値の大きさに依存する
  # 2円では、20〜29円までOK
  # つまり、normal_answerが20とすると、1桁の最大の数まで許容できる
  # 200だと、200~209まで
  max_answer = normal_answer + 9
  return int(normal_answer), int(max_answer)

def taxrange08(x):
  # 通常の回答
  normal_answer = x * it08
  # 範囲は、整数かつ元々の値の大きさに依存する
  # 2円では、13~24円まで（12.5*2-1)
  # 200円では、2500-1=2499円
  max_answer = normal_answer + it08
  return int(normal_answer), int(max_answer)


A_taxr = taxrange08(A)
B_taxr = taxrange10(B)

A_list = list(range(A_taxr[0], A_taxr[1]+1))
B_list = list(range(B_taxr[0], B_taxr[1]+1))

ans = list(set(A_list)&set(B_list))
if len(ans) == 0:
  print(-1)
else:
  print(min(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
X008=int(A/0.08)
X010=int(B/0.1)
if X008 == X010:
    print(X010)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
ok = True
for i in range(b*10+1):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    ok = False
    break
if ok: print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
c = int(a*(5/4))
d = a*(11/8)
if c<=b and b<d:
  print(max(int(12.5*a),int(10*b)))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
c = a*(5/4)
d = a*(11/8)
if c<=b and b<d:
  print(max(int(12.5*a),int(10*b)))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
c = int(a*(5/4))
if c==b:
  print(max(int(12.5*a),int(10*b)))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
A,B = int(a*(12.5)),int(b*10.0)
if A>B:
  if int(A*0.1)!=b:
    print(-1)
  else:
    print(A)
else:
  if int(B*0.08)!=a:
    print(-1)
  else:
    print(B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
if 100*A/8==10*B:
    print(int(100*A/8))
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import math
answer = 0
score = list(map(int,input().split()))
Alist = []
for i in range(100):
    if math.floor((i+1)*0.08) == score[0]:
        Alist.append(i+1)
for j in range(100):
    if math.floor((j+1)*0.10) == score[1]:
        if j+1 in Alist:
            print(j+1)
            answer = 1
            break
if answer == 0:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
x=max(N//0.08+1,M//0.1+1)
y=min((N+1)/0.08, (M+1)/0.1)
print( -1 if y<x else int(x))

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())

x=max(N/0.08,M/0.1)
y=min((N+1)/0.08, (M+1)/0.1)
print( -1 if y<x else int(x))

Submission status: Wrong Answer

Solution code:
import math

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

ans = 0

for i in range(110):
    if math.floor((i*8)/100) == A and math.floor((i*1)/10) == B:
        ans = i
        print(ans)
        break

if ans == 0:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from functools import reduce, lru_cache
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline().rstrip())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIR1(n): return [LI1() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

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

for n in range(2000):
    if int(n * 0.08) == A and int(n * 0.1) == B:
        print(n)
        break

Submission status: Wrong Answer

Solution code:

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

lb_a = int(-(-A // 0.08))
ub_a = int((A + 1) / 0.08)

lb_b = int(-(-B // 0.1))
ub_b = int((B + 1) / 0.1)

if ub_b < lb_a or ub_a < lb_b:
    print(-1)
else:
    print(max(lb_a, lb_b))

Submission status: Wrong Answer

Solution code:

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

lb_a = int(-(-A // 0.08))
ub_a = int((A + 1) / 0.08)

lb_b = int(-(-B // 0.1))
ub_b = int((B + 1) / 0.1)

if ub_b < lb_a or ub_a < lb_b:
    print(-1)
else:
    print(lb_a)

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc158/tasks/abc158_c
import math
e,t = map(int,input().split())
t_s = list(range(math.ceil(t/0.1),math.ceil(t/0.1)+100))
ans = -1
for i in t_s:
    if math.floor(i*0.08) == e:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


A,B = list(map(int, input().split()))
ans = 10e7
for i in range(1,1010):
    a = int(i*0.08)
    b = int(i*0.10)
    if a == A and b == B:
        ans = min(ans, i)
print(ans)

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)
    """
    print("#########" + str(i) + "#############")
    print(cnt_a)
    print(cnt_b)
    """
ans = 10e7
is_true = False
for i in cnt_a:
    for j in cnt_b:
        if int(i/10) == int(j/10):
            ans = min(ans, int(j/10))
            is_true = True
if is_true:
    print(ans)
else:
    print(-1)