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 math
a,b = map(int, input().split())
ans = []
for i in range(1,101):
  if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
    ans.append(i)
if ans:
  print(min(ans))
else:
  print(-1)

Submission status: Wrong Answer

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

eightper = 0.08
tenper = 0.1
ans = -1
for i in range(100+1):
    if int(i*eightper)==a:
        if int(i*tenper)==b:
            ans=i
            break
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = [int(x) for x in input().split()]
if a%2 == 0:
  amax = round((a+1)*12.5)
  amin = a*12.5
else:
  amax = (a+1)*12.5
  amin = round(a*12.5)
bmax = int((b+1)*10)
bmin = int(b*10)
hantei = bmin
if amax <= bmin:
  hantei = str(-1)
elif bmax <= amin:
  hantei = str(-1)
elif bmin < amin:
  hantei = amin
print(hantei)

Submission status: Wrong Answer

Solution code:
import math

line = input().split(" ")

eight_tax = int(line[0])
ten_tax = int(line[1])

eight_side_price = math.floor(eight_tax / 0.08)
ten_side_price = math.floor(ten_tax / 0.1)

while(1):
    break_flg = 0
    for i in range(int(math.fabs(eight_side_price - ten_side_price)) + 1):
        target = eight_side_price if eight_side_price < ten_side_price else ten_side_price
        num = i + target
        if math.floor(num * 0.08) == eight_tax and math.floor(num * 0.1) == ten_tax:
            print(num)
            break_flg = 1

    if break_flg == 0:
        print("-1")
    break

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
max_a=a+0.99999999999999999999999999999
min_a=a
max_b=b+0.99999999999999999999999999999
min_b=b
max_an=max_a*100/8
min_an=min_a*100/8
max_bn=max_b*100/10
min_bn=min_b*100/10
if max_an<min_bn or max_bn<min_an:
    print(-1)
elif min_an<=min_bn:
    if min_b*100//10==max_a*100//8:
        print(-1)
    else:
        answer=min_b*100/10
        if answer*10//10==answer:
            print(min_b*100/10)
        else:
            print(min_b*100/10+1)
else :
    if max_b*100//10==min_a*100//8:
        print(-1)
    else:
        answer=min_a*100/8
        if answer*10//10==answer:
            print(min_a*100/8)
        else:
            print(min_a*100/8+1)

Submission status: Wrong Answer

Solution code:
A, B = (int(x) for x in input().split())
h = []
for i in range(0, 1000):
    if int(i * 8 / 100) == A and int(i / 10) == B:
        h.append(i)
        break
if h != []:
    print(h[0])
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

emin=math.ceil(a/0.08)
emax=math.ceil((a+1)/0.08)-1
tmin=math.ceil(b/0.1)
tmax=math.ceil((b+1)/0.1)-1

print(emin)
print(emax)
print(tmin)
print(tmax)

if tmin<=emin<=tmax:
    print(emin)
elif emin<=tmin<=emax:
    print(tmin)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
import math
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
x = math.floor(A / 0.08)
y = math.floor((A+1) / 0.08)

flag = 0
for i in range(x, y + 1):
    if math.floor(i * 0.10) == B:
        print(i)
        flag += 1
        break

if flag == 0:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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


def calc():
    global A, B

    for x in range(1000):
        a = math.floor(x * 0.08)
        b = math.floor(x * 0.1)

        if a == A and b == B:
            return x

    return -1


res = calc()
print(res)

Submission status: Wrong Answer

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

a1 = int(a / 0.08)
b1 = int(b / 0.1)

a2 = int((a+1) / 0.08) - 1
b2 = int((b+1) / 0.1) - 1

if b1 > a2 or a1 > b2:
  print(-1)
elif a1 < b1 and b1 < a2:
  print(b1)
else:
  print(a1)

Submission status: Wrong Answer

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

low =  math.floor(A / 0.08)
high = math.floor((A+1) / 0.08)

low_B = math.floor(B / 0.1)
high_B = math.floor((B+1) / 0.1)

# print(low,high)
# print(low_B,high_B)
is_found = False
for price in range(low,high) :
    # print(price)
    if (low_B <= price and price <= high_B) :
        # TODO high_Bは含んでいいんだっけ。。。
        is_found = True
        print(price)
        break

if (not is_found) :
    print("-1")

Submission status: Wrong Answer

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

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

p = int(A / 0.08)
q = int(B / 0.1)

min = -1

if p < q:
    for i in range(p, q+1):
        if i * 0.08 == A and i * 0.1 == B:
            min = i
            break
else:
    for i in range(q, p+1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            min = i
            break

print(min)

Submission status: Wrong Answer

Solution code:
A, B = [int(i) for i in input().strip().split()]

# X * 0.08 = A + a (0 <= a < 1)
# X * 0.10 = B + b (0 <= b < 1)

# X = A / 0.08 + a / 0.08
# 12.5*A <= X < 12.5*A + 12.5
#  thus
# 12.5*A <= X < 12.5*(A+1)
# 10  *B <= X < 10  *(B+1)

X_min = int(max(12.5*A, 10*B))
X_max = int(min(12.5*(A+1), 10*(B+1)))

if X_min <= X_max:
  print(X_min)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
diff = b - a
if diff > 20:
    print(-1)
else:
    min = diff * 50
    max = (diff + 1) * 50
    flg = 0
    for i in range(min, max + 1, 1):
        if(math.floor(i * 0.08) == a):
            if(math.floor(i * 0.1) == b):
                print(i)
                flg = 1
                break
    if flg == 0:
        print(-1)

Submission status: Wrong Answer

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

if __name__ == "__main__":
    A, B = map(int, input().split())
    par = A / B
    if par < 0.8:
        print("-1")
        exit(0)
    else:
        a = math.ceil(A / 0.08)
        b = math.ceil(B / 0.1)
        # print(a , b)
        ret = a
        print(a)

Submission status: Wrong Answer

Solution code:
from math import ceil

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

if b - a < 0 or b / a > 10 / 8:
    ans = -1
else:
    ans = ceil(max(a / 0.08, b / 0.1))
    if not(int(ans * 0.08) == a and int(ans * 0.1) == b):
        ans = -1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
min_8=math.ceil(A*(100/8))
max_8=int((A+1)*(100/8))
if max_8==(A+1)*(100/8):
    max_8-=1
min_10=B*10
max_10=int((B+1)*10)
if max_8 < min_10:
    print("-1")
elif min_8 > max_10:
    print("-1")
elif max_8 >= min_10:
    if min_8 < min_10:
        print(min_10)
    elif min_8 >= min_10:
        print(min_8)

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
A=math.ceil((a+1)/0.08)-1
B=math.ceil((b+1)/0.1)-1
A_=math.ceil(a/0.08)
B_=math.ceil(b/0.1)
C=(B//0.1)-(B//0.08)
if b>80 or A<B_ or b-a>C:
    print(-1)
else:
    print(A_)

Submission status: Wrong Answer

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

c = a/0.08
d = b/0.1

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

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<int(10*b):
  print(-1)
elif int(25*(a+1)/2)==int(10*b):
  if a%2==0:
    print(-1)
  else:
    print(int(10*b))
elif int(10*(b+1))<=int(25*a/2):
  print(-1)
elif int(10*(b+1)-1)==int(25*a/2):
  if a%2==1:
    print(-1)
  else:
    print(int(25*a/2))  
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
aa=[]
bb=[]
for a in range(A*10,(A+1)*10):
    aa.append(int(a/10/0.08))
for b in  range(B*10,(B++1)*10):
    bb.append(int(b/10/0.1))
l=list(set(aa)&set(bb))
l.sort()
if l:
    print(int(l[0]))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
ans=-1
for i in range(1000):
    #print(int(i*0.08))
    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())

p1 = int(a*100//8)
p2 = int(b*100//10)
#print(p1, p2)
for x in range(p2, p1+2):
    A = int(x*8//100)
    B = int(x*10//100)
    #print(x, A, B)
    if a==A and b==B:
        print(x)
        exit()
print(-1)

Submission status: Wrong Answer

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

a_plus = a+1
b_plus = b+1

price_a = int(a*(100/8))
price_aplus = int(a_plus*(100/8))
price_b = int(b*(100/10))
price_bplus = int(b_plus*(100/10))

#配列作成
if (a_plus*(100/8) % 10) != 0:
  al = list(range(price_a, price_aplus+1))
else:
  al = list(range(price_a, price_aplus))
bl = list(range(price_b, price_bplus))

ans = list(set(al) & set(bl))

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

Submission status: Wrong Answer

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

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

x1 = math.ceil(a / 0.08)
y1 = math.floor((a+1) / 0.08)
if y1 == (a+1) / 0.08:
    y1 -= 1

x2 = math.ceil(b / 0.1)
y2 = math.floor((b+1) / 0.1)
if y2 == (b+1) / 0.08:
    y2 -= 1

if max(x1, x2) > min(y1, y2):
    print(-1)
else:
    print(max(x1, x2))

Submission status: Wrong Answer

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

ans = []

for i in range(0, 10):
    for j in range(0, 10):
        a = A + (0.1 * i)
        b = B + (0.1 * j)
        #print(a, b)
        a = a * 12.5
        b = b * 10
        #print(a, b)
        if int(a) == int(b):
            ans.append(int(a))
#print(ans)
print(ans[0]) if ans else print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
A=math.ceil((a+1)/0.08)-1
B=math.ceil((b+1)/0.1)-1
A_=math.ceil(a/0.08)
B_=math.ceil(b/0.1)
C=(B//0.1)-(B_//0.08)
if b>80 or A<B_ or b-a>C:
    print(-1)
else:
    print(A_)

Submission status: Wrong Answer

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

d = ((100/8) * a)
e = ((100/10) * b)

k = (math.floor(d/10))
l = (math.floor(e/10))

if k != l:
    print('-1')
elif k == l:
    print(int(d))

Submission status: Wrong Answer

Solution code:
import math
a, b = list(map(int,input().split()))
ao = a / 0.08
ao1 = (a+1) / 0.08
bo = b / 0.1
bo1 = (b+1) / 0.1
if bo <= ao < bo1:
    print(math.ceil(ao))
elif ao <= bo < ao1:
    print(bo)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
nazos=10*B
if math.floor(nazos*0.08)==A and 13<=nazos<=1009:
  print(nazos)
else:
  while True:
    nazos+=1
    if math.floor(nazos*0.08)==A and nazos>=13:
      print(nazos)
      break
    if nazos>1009:
      print(-1)
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

pa=int(a/0.08)
al=[]
t=pa
while int(t*0.08)==a:
    al.append(t)
    t=t+1 

pb=int(b/0.1)
bl=[]
t=pb
while int(t*0.1)==b:
    bl.append(t)
    t=t+1

match=0
mp=0
ea=0
eb=0
if len(al)<=len(bl):
    kai=len(al)
else:
    kai=len(bl)

for f in range(kai):
    if al[ea]==bl[eb]:
        mp=al[ea]
        match=1
        break
    elif al[ea]>bl[eb]:
        eb=eb+1
    elif al[ea]<bl[eb]:
        ea=ea+1

if match==1:
    print(mp)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if (A/0.08)%1==0.0:
    a1=int(A/0.08)
else:
    a1=int(A/0.08)+1
if (A/0.08)%1!=0.0:
    a2=int((A+1)/0.08)
else:
    a2=int((A+1)/0.08)-1

if (B/0.1)%1==0.0:
    b1=int(B/0.1)
else:
    b1=int(B/0.08)+1
if (B/0.1)%1!=0.0:
    b2=int((B+1)/0.1)
else:
    b2=int((B+1)/0.1)-1

a=[]
b=[]
for i in range(a1,a2+1):
    s=i
    a.append(s)
for i in range(b1,b2+1):
    t=i
    b.append(t)
#print(a)
#print(b)
if max(a)<min(b):
    print(-1)
elif max(b)<min(a):
    print(-1)
elif min(a)>=min(b):
    print(min(a))
else:
    print(min(b))

Submission status: Wrong Answer

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

a = int(A*12.5)
b = B*10
ans = -1

if a < b:
    for i in range(a, b+1):
        if (int(i*0.1) == B) and (int(i*0.08) == A):
            ans = i

else:
    for i in range(b, a+1):
        if (int(i*0.1) == B) and (int(i*0.08) == A):
            ans = i

print(ans)

Submission status: Wrong Answer

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

A_min = math.ceil(A * 25 / 2)
A_max = math.floor((A + 1) * 25 / 2)
B_min = math.ceil(B * 10)
B_max = math.floor((B + 1) * 10)
# print(B_min, B_max)
A_list = list(range(A_min, A_max + 1))
B_list = list(range(B_min, B_max))
# print(A_list)
# print(B_list)

min_ans = -1
for num in A_list:
    if num in B_list:
        min_ans = num
        break
    else:
        continue

print(min_ans)

Submission status: Wrong Answer

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

# process/output
a = A*100//8
b = B*10

ans = a
if a < b:
    ans = b

if ans*8//100 == A and ans//10 == B:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

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

a_koho = int(A/0.08)
b_koho = int(A/0.1)

# print(a_koho,b_koho)

if a_koho == b_koho:
    # print(a_koho)
    exit()

start = min(a_koho,b_koho)
end = max(a_koho,b_koho)

for i in range(start,end+1):


    a = int(i*0.08)
    b = int(i*0.1)

    # print(a,b)

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

print("-1")

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<int(10*b):
  print(-1)
elif int(25*(a+1)/2)==int(10*b):
  if a%2==0:
    print(-1)
  else:
    print(int(25*a/2))
elif int(10*(b+1))<=int(25*a/2):
  print(-1)
elif int(10*(b+1)-1)==int(25*a/2):
  if a%2==1:
    print(-1)
  else:
    print(int(25*a/2))  
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
a,b=map(int, input().split())

x = math.floor(a/0.08)
#1の位が1-9
y = math.floor(b/0.1)
if math.floor((x + 1) * 0.08) == a:
    xx = x + 2
else:
    xx = x + 1

for i in range(y,y+10):
    for j in range(x, xx):
        if i == j:
            print(i)
            sys.exit(0)
print(-1)

Submission status: Wrong Answer

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

mid_a = 12.5 * a
mid_b = 10 * b

a_range = [
    i for i in range(
        math.ceil(mid_a),
        math.floor(
            mid_a +
            12 +
            1)) if i > 0]
b_range = [
    i for i in range(
        math.ceil(mid_b),
        math.floor(
            mid_b +
            9 +
            1)) if i > 0]

seki = list(set(a_range) & set(b_range)).sort()

if seki:
    print(seki[0])
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
a = list(map(int, input().split(" ")))
min8 = a[0]/0.08
max8 = (a[0]+1)/0.08
min10 = a[1]/0.1
max10 =(a[1]+1)/0.1
a = max(min8, min10)
if ((min8>max10) or (max8<min10)):
    print(-1)
else:
    print(Decimal(a).quantize(Decimal('0'), rounding = ROUND_HALF_UP))

Submission status: Wrong Answer

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

before_A = A/0.08
before_B = B/0.1

if before_A >= before_B:
    ans = before_B
    if int(before_B * 0.08) == A:
        print(int(ans))
    else:
        print(-1)
else:
    ans = before_A
    if int(before_B * 0.1) == B:
        print(int(ans))
    else:
        print(-1)

Submission status: Wrong Answer

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

minans = math.ceil(max(A/0.08,10*B))
maxans = int(min((A+1)/0.08,10*(B+1)))
# print(A/0.08,(A+1)/0.08)
# print(10*B,10*(B+1))
# print(minans,maxans)
if minans <= maxans:
    print(minans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from functools import lru_cache
from heapq import heappop,heappush
import time
import sys
input=readline = sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s

#main
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from functools import lru_cache
from heapq import heappop,heappush
import time
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s

#main
A,B=map(int,input().split())
#n*0.08=A         n*0.1=B
#n=A/0.08 n=B/0.1
c=[int(A/0.08),math.ceil((A+1)/0.08)]
d=[int(B/0.1),math.ceil((B+1)/0.1)]
ans=0
for a in range(min(c[0],d[0]),max(c[1],d[1])):
    if c[0]<=a and a<=c[1] and d[0]<=a and a<=d[1]:
        ans=a
        break
else:
    ans=-1
if(ans<=0):ans=-1
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split(' '))
import math
asil1_1 = (100*(A))/8
asil1_2 = (100*(A+1))/8
asil2_1 = 10*(B)
asil2_2 = 10*(B+1)

sonuc_1 = max(asil1_1, asil2_1)
sonuc_2 = min(asil2_2, asil1_2)
print(sonuc_1, sonuc_2)
if sonuc_1>=sonuc_2:
    print(-1)
else:
    print(math.ceil(sonuc_1))

Submission status: Wrong Answer

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

x = int(A/0.08)
y = int(B/0.10)

if abs(y-x)>=10:
    print(-1)
else:
    while((int(y*0.10)==B)and y<x):
        y+=1
    print(y)

Submission status: Wrong Answer

Solution code:

A, B = [int(i) for i in input().split()]

aa = A / 0.08
bb = B / 0.1


if aa > (bb + 10) or bb > (aa + 12.5):
    print('-1')
else:
    if aa > bb:
        print(aa)
    else:
        print(bb)

Submission status: Wrong Answer

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

Amin = 100*A//8
Amax = 0
if A%2 == 0:
    Amax = 100*(A + 1)//8
else:
    Amax = 100*(A + 1)//8 - 1
Bmin = 10*B
Bmax = 10*(B + 1) - 1
if Amin > Bmax or Bmin > Amax:
    print(-1)
else:
    if Amin < Bmin:
        print(Bmin)
    else:
        print(Amin)

Submission status: Wrong Answer

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

A = int(A/0.08)
B = int(B/0.1)
C = A - B
if C > 0:
    B = B + C

if A == B:
    print(A)
else:
    print(-1)

Submission status: Wrong Answer

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

X1=math.floor(A/0.08)
X2=math.floor((A+1)/0.08)

Y1=math.floor(B/0.1)
Y2=math.floor((B+1)/0.1)


if (Y1>=X2)or(X1>=Y2):
  print(-1)
elif X1>=Y1:
  print(X1)
else:
  print(Y1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
x=int(A/0.08)
y=int(B/0.1)
eight=[x]
ten=[y]
while int(x*0.08)==A:
    x+=1
    eight.append(x)
while int(y*0.1)==B:
    y+=1
    ten.append(y)
eight_set=set(eight)
ten_set=set(ten)
ans_set=eight_set&ten_set
ans=list(ans_set)
if len(ans)>0:
    print(min(ans))
else:
    print(-1)

Submission status: Wrong Answer

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

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

a_koho = int(A/0.08)
b_koho = int(A/0.1)

print(a_koho,b_koho)

if a_koho == b_koho:
    # print(a_koho)
    exit()

start = min(a_koho,b_koho)
end = max(a_koho,b_koho)

for i in range(start,end+1):


    a = int(i*0.08)
    b = int(i*0.1)

    # print(a,b)

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

print("-1")

Submission status: Wrong Answer

Solution code:
import math
import string


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):  # リストに重複した要素があるか判定（要素にリストがある場合）
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


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

for i in range(1, 101):
    aa = i*0.08
    aaa = math.floor(aa)
    bb = i*0.1
    bbb = math.floor(bb)
    if a == aaa and b == bbb:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
aa, bb = map(int,input().split())
a = aa / 0.08
b = bb / 0.1
c = []
if (a-int(a))>=0.75:
    for i in range(12):
        for j in range(9):
            if int(a)+i == int(b)+j:
                c.append(int(a)+i)
            else:
                pass
else:
    for i in range(11):
        for j in range(9):
            if int(a)+i == int(b)+j:
                c.append(int(a)+i)
            else:
                pass
if c==[]:
    print(-1)
elif (int(a)+i)<=0:
    print(-1)
else:
    print(*c[:1])

Submission status: Wrong Answer

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

import math

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

def tax_increase(a, b):
    tax8 = 12.5
    tax10 = 10

    price8 = math.floor(a * tax8)
    price10 = math.floor(b * tax10)

    # price8を10%で表せるか
    x = math.floor(price8 * 0.1)

    # price10を8%で表せるか
    y = math.floor(price10 * 0.08)

    if x == b or y == a:
        print(price8)
    else:
        print("-1")


tax_increase(a, b)

Submission status: Wrong Answer

Solution code:
#C
import sys

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

print(i)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
nazos=10*B
if math.floor(nazos*0.08)==A and 13<=nazos<=1009:
  print(nazos)
else:
  while True:
    nazos+=1
    if math.floor(nazos*0.08)==A:
      print(nazos)
      break
    if nazos>1009:
      print(-1)
      break

Submission status: Wrong Answer

Solution code:
import math
A,B = map(int,input().split())
min_8=math.ceil(A*(100/8))
max_8=int((A+1)*(100/8))
min_10=B*10
max_10=int((B+1)*10)
if max_8 < min_10:
    print("-1")
elif min_8 > max_10:
    print("-1")
elif max_8 >= min_10:
    if min_8 < min_10:
        print(min_10)
    elif min_8 >= min_10:
        print(min_8)

Submission status: Wrong Answer

Solution code:
import sys

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


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

A_ = []
B_ = []
for i in range(1, 1001):
	if i*8 //100 == A:
		A_.append(i)

	if i//10 == B:
		B_.append(i)

A_ = set(A_)
B_ = set(B_)
sel = A_ & B_
print(A_, B_)
if sel == set():
	print(-1)
else:
	print(min(sel))

Submission status: Wrong Answer

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

prc1 = A / 0.08
prc1e = (A+1) / 0.08
prc2 = B / 0.1
prc2e = (B+1) / 0.1

if prc1<=prc2<prc1e:
    print(int(prc2))
elif prc2<=prc1<prc2e:
    print(int(prc1))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
aa=[]
bb=[]
for a in range(A*10,(A+1)*10):
    aa.append(a/0.08)
for b in  range(B*10,(B++1)*10):
    bb.append(b/0.1)
l=list(set(aa)&set(bb))
l.sort()
if l:
    print(int(l[0])//10)
else:
    print(-1)

Submission status: Wrong Answer

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

AA = A*100//8
BB = B*10
AAA = [i for i in range(AA,(A+1)*100//8)]
BBB = [i for i in range(BB,(B+1)*10)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list and (12<min(AB_list)<=1000) else -1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<int(10*b):
  print(-1)
elif int(25*(a+1)/2)==int(10*b):
  if a%2==0:
    print(-1)
  else:
    print(int(25*a/2))
elif int(10*(b+1))<=int(25*a/2):
  print(-1)
elif int(10*(b+1)-1)==int(25*a/2):
  if a%2==1:
    print(-1)
  else:
    print(int(10*b))  
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
x_a = int(A * 100 / 8)
x_b = int(B * 100 / 10)
l = [i for i in range(x_b, x_a + 1)]
for n in l:
    if int(n * 0.08) == A and int(n * 0.10) == B:
        print(n)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
ta = a / 0.08
tb = b / 0.10
if (round(ta * 0.1) == b):
  print(round(ta))
elif (round(tb * 0.08) == a):
  print(round(tb))
else:
  print(-1)

Submission status: Wrong Answer

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

while PA <= 1000:
    if PA*0.1 >= B:
        break
    else:
        PA += 1

if A+1 > PA*0.08 >= A:
    print(PA)

else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import floor

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

x1b = round(100 * A / 8)
x2b = round(10 * B)

x1t = floor(100 * (A + 0.99999) / 8)
x2t = floor(10 * (B + 0.99999))

print('%d %d' % (x1b, x1t))
print('%d %d' % (x2b, x2t))

if (x2b <= x1t and x1b <= x2t) or (x1b <= x2t and x2b <= x1t):
    print(max(x1b, x2b))
else:
    print('-1')