Problem:


Score : 300 points

Problem Statement

Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)

Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.

If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.

Constraints

1 \leq A \leq B \leq 100

A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

If there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.

Sample Input 1

2 2

Sample Output 1

25

If the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:

When the consumption tax rate is 8 percent: \lfloor 25 \times 0.08 \rfloor = \lfloor 2 \rfloor = 2 yen.

When the consumption tax rate is 10 percent: \lfloor 25 \times 0.1 \rfloor = \lfloor 2.5 \rfloor = 2 yen.

Thus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.

Sample Input 2

8 10

Sample Output 2

100

If the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:

When the consumption tax rate is 8 percent: \lfloor 100 \times 0.08 \rfloor = 8 yen.

When the consumption tax rate is 10 percent: \lfloor 100 \times 0.1 \rfloor = 10 yen.

Sample Input 3

19 99

Sample Output 3

-1

There is no price before tax satisfying this condition, so print -1.



Sample input:
2 2


Sample output:
25

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
x = math.ceil(a/0.08)
y = math.ceil(b/0.10)
ans1 = 10**8
ans2 = 10**8
while math.floor(x*0.08) == a and math.floor(x*0.1) == b:
    ans1 = x
    x -= 1
while math.floor(y*0.08) == a and math.floor(y*0.1) == b:
    ans2 = y
    y -= 1
print(min(ans1,ans2) if min(ans1,ans2)!=10**8 else -1)

Submission status: Accepted

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

Submission status: Accepted

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

max_value = 1250

for i in range(1, max_value + 1):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
def main():
    A,B = map(int,input().split())
    a = A / 0.08
    b = B / 0.10
    ans = -1
    large = max(int(a),int(b))
    small = min(int(a),int(b))
    for num in range(large+2,small-2,-1):
        numa = int(num * 1.08)
        numb = int(num * 1.10)
        if numa == (A+num) and numb == (B+num):
            ans = num
            #print("ans:"+str(ans))

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

flg=0
X=1
# 処理
while X*0.1<=100:
    if int(X*0.08)==A and int(X*0.1)==B:
        flg=1
        result=X
        break
    X+=1
    

if flg==0:
    result=-1

print(result)

Submission status: Accepted

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

    array = []
    for i in range(1,1262):
        if int(i*0.08)==a and int(i*0.1)==b:
            print(i)
            return
    print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
import math
a=[]
for i in range(13,1010):
    if math.floor(i*0.08)==A and math.floor(i*0.10)==B:
        a.append(i)
if len(a)>=1:
    print(a[0])
else:
    print('-1')

Submission status: Accepted

Solution code:
import math

A,B = [int(i) for i in input().split()]
emax = (A + 1) / 0.08
emin = math.ceil(A / 0.08)
tmax = (B + 1) / 0.1
tmin = B / 0.1

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

Submission status: Accepted

Solution code:
import math

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

minA = 12.5 * A
if minA.is_integer() == True:
    minA = int(minA)
else:
    minA = math.ceil(minA)

maxA = 12.5 *(A+1)
if maxA.is_integer() == True:
    maxA = int(maxA-1)
else:
    maxA = math.floor(maxA)

minB = 10 * B
maxB = (10 * (B+1))-1

#print("{} {} {} {}".format(minA, maxA, minB, maxB))

if minA <= maxB and minB <= maxA:
    if minA < minB:
        print(minB)
    else:
        print(minA)
else:
    print(-1)

Submission status: Accepted

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


X1 = B*10
X2 = math.ceil((B+1)*10) - 1
X3 = math.ceil((A/0.08))
X4 = math.ceil(((A+1)/0.08)) - 1

# print(X1, X2, X3, X4)
if X3<=X1 and X1 <= X4 and X4 <= X2:
    print(int(X1))
elif X3<=X1 and X1 <= X2 and X2 <= X4:
    print(int(X1))
elif X1<=X3 and X3 <= X4 and X4 <= X2:
    print(int(X3))
elif X1<=X3 and X3 <= X2 and X2 <= X4:
    print(int(X3))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

res = -1
for pp in range(10, 1250):
    if int(pp * 0.08) == A and int(pp * 0.10) == B:
        res = pp
        break

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

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

print(-1)

Submission status: Accepted

Solution code:
import numpy as np
a = list(map(int,input().split()))
b = a[0]/0.08
c = (a[0]+1)/0.08
d = a[1]/0.1
e = (a[1]+1)/0.1
f=20000
if b<d:
    min=b
else :
    min =d
g=int(np.floor(min))
for i in range(g,10001):
    if i>=b and i<c:
        if i>=d and i<e:
            f = i
            break
if f==20000:
    print(-1)
else:
    print(f)

Submission status: Accepted

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

ans = ('-1')

for i in range(10001):
    z8 = math.floor(i * 0.08)
    z10 = math.floor(i * 0.1)

    if z8 == a and z10 == b:
        ans = i
        break

print(ans)

Submission status: Accepted

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


result = -1
for i in range(1, 1001):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        result = i
        break
print(result)

Submission status: Accepted

Solution code:
import math
import sys

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

minx = max(10*B, math.floor(12.5*A))
maxx = min(10*(B+1)-1, math.floor(12.5*(A+1)-1))
for i in range(minx, maxx+1):
    if (A <= i*0.08 < A+1) and (B <= i*0.1 < B+1):
        print(i)
        sys.exit()

print(-1)

Submission status: Accepted

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

a = int(A/0.08)
b = int(B/0.1)
aa=[]
bb=[]
if int(a*0.08)==A:
    aa.append(a)
if int(b*0.1)==B:
    bb.append(b)
au=a+1
ap=a-1
bu=b+1
bs=b-1
f1=True
f2=True
f3=True
f4=True

while f1==True or f2==True:
    if int(au*8/100) == A:
        aa.append(au)
        au += 1
    else:
        f1=False

    if int(ap*8/100) == A:
        aa.append(ap)
        ap -=1
    else:
        f2=False

while f3==True or f4==True:
    if int(bu*10/100) == B:
        bb.append(bu)
        bu += 1
    else:
        f3=False

    if int(bs*8/100) == B:
        bb.append(bs)
        bs -=1
    else:
        f4=False
cc=[]
for i in aa:
    for j in bb:
        if i==j:
            cc.append(j)
if len(cc)==0:
    print(-1)
else:
    print(min(cc))

Submission status: Accepted

Solution code:
import numpy as np

array = list(map(int,input().strip().split()))

a = array[0]
b = array[1]

min8 = a/0.08
max8 = (a+1)/0.08
min10 = b/0.1
max10 = (b+1)/0.1

def lists(a,b):
    if a%1==0:
        a2 = a
    else:
        a2 = int(a)+1
    if b%1==0:
        b2 = b-1
    else:
        b2 = int(b)
    return np.arange(a2,b2+1)

list8 = lists(min8,max8)
list10 = lists(min10,max10)

hosii = list(set(list8)&set(list10))
if len(hosii)>0:
    print(int(np.min(hosii)))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

TAXRATE8 = 0.08
TAXRATE10 = 0.1

tax8, tax10 = map(int, input().split())

amount8_min = math.ceil(tax8 / TAXRATE8)
amount8_max = math.floor((tax8+1) / TAXRATE8)
if ((tax8+1) / TAXRATE8).is_integer():
  amount8_max -= 1


amount10_min = math.ceil(tax10 / TAXRATE10)
amount10_max = math.floor((tax10+1) / TAXRATE10)
if ((tax10+1) / TAXRATE10).is_integer():
  amount10_max -= 1

ans_set = set(range(amount8_min, amount8_max)) & set(range(amount10_min, amount10_max))

if ans_set == set({}):
  print(-1)
else:
  print(min(ans_set))

Submission status: Accepted

Solution code:
from sys import stdin
import math

a, b = [int(x) for x in stdin.readline().rstrip().split()]

x1 = a / 0.08
x11 = (a + 1) / 0.08
x2 = b / 0.1
x22 = (b + 1) / 0.1

result = -1
if (x1 >= x2) and (x1 < x22):
    result = x1
if (x2 >= x1) and (x2 < x11):
    result = x2

print(math.ceil(result))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
import math
c = []
d =[]
for i in range(1300):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        c.append(i)
    else:
        d.append(i)
if len(c) ==0 :
    print(-1)
else:
    print(min(c))

Submission status: Accepted

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

def check(x):
    if floor(x*0.08) == A and floor(x*0.1) == B:
        return True
    return False

x = 1
while(x < 1251):
    if check(x):
        break
    x += 1

if x == 1251:
    print(-1)
else:
    print(x)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import sys

A, B = list(map(lambda x: int(x), input().split()))
ten_pats = [i for i in range(B*10, B*10 + 10)]

for num in ten_pats:
  if int(num * 0.08) == A:
    print(num)
    sys.exit()

print(-1)

Submission status: Accepted

Solution code:
# C
a,b = map(int, input().split())
if a > b:
    print(-1)
else:
    a_min, a_max, b_min, b_max = 0,0,0,0
    
    if (a*100)%8 == 0:
        a_min = a/0.08
    else:
        a_min = a/0.08 + 1
    a_max = a_min
    while int(a_max*0.08) == a:
        a_max += 1
    a_max -= 1
    
    b_min = b*10
    b_max = b_min
    while int(b_max*0.1) == b:
        b_max += 1
    b_max -= 1
    
    if b_max >= a_min and a_max >= b_min:
        print(int(max(a_min,b_min)))
    else:
        print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8
import math
 
a, b = map(int, raw_input().split())
 
xa = int(math.ceil(a / 0.08))
xb = int(math.ceil(b / 0.10))

z = 1e10
if int(xa * 0.10) == b and xa < z:
    z = xa
    #print 'xa',xa
if int(xb * 0.08) == a and xb < z:
    z = xb
    #print 'xb',xb

print [z, -1][z == 1e10]

Submission status: Accepted

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

a_nontax = 0
b_nontax = 0
kakaku = -1
a_nontax = int(A/0.08)
b_nontax = int(B/0.10) + 13
kakaku = -1
if a_nontax != b_nontax:
  start = 0
  end = 0
  if a_nontax > b_nontax:
    start = b_nontax
    end = a_nontax
  else:
    start = a_nontax
    end = b_nontax  
  
  for i in range(start, end + 1, 1):
    if int(i*0.08) == A and int(i*0.10) == B:
      kakaku = i
      break
else:
  kakaku = a_nontax  

print(kakaku)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
i = 1
found = False
while True:
    if int(i * 0.08) > a + 1 or int(i * 0.1) > b:
        break
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        found = True
        break
    i = i + 1
if not found:
    print(-1)

Submission status: Accepted

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

price_A = 0
price_B = 0

price_A = math.ceil(A / 0.08)
price_B = math.ceil(B / 0.1)

min_price = min(price_A, price_B)
max_price = max(price_A, price_B)

for i in range(min_price, max_price+1, 1):
    tax_A = int(i * 0.08)
    tax_B = int(i * 0.1)
#    print(" ", i, tax_A,tax_B)
    if tax_A == A and tax_B == B:
        print(i)
        sys.exit()

print(-1)

Submission status: Accepted

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

import math

Aset = set([i for i in range(math.ceil(A/0.08), math.floor((A+1)/0.08))])
Bset = set([i for i in range(math.ceil(B/0.10), math.floor((B+1)/0.10))])


ABset = Aset & Bset

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

Submission status: Accepted

Solution code:
import math
def keisan(a):
    return math.floor(a*0.08),math.floor(a*0.10)

A,B = map(int, input().split())
b = B*10
while b<1001:
    tempa,tempb = keisan(b)
    if tempa == A and tempb == B:
        print(b)
        exit()
    b += 1
print(-1)

Submission status: Accepted

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

res = -1

for i in range(1,3500):
    judge = True

    p = (i*8) // 100
    q = (i*10) // 100
    if a == p and b == q:
        res = i
        break


print(res)

Submission status: Accepted

Solution code:
import math


def find(a, b):
    for bxn in range(math.ceil(b / 0.1), math.ceil((b + 1) / 0.1)):
        for axn in range(math.ceil(a / 0.08), math.ceil((a + 1) / 0.08)):
            if axn == bxn:
                return axn
    return -1


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

Submission status: Accepted

Solution code:
import math

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

for i in range(1, 1300):
    if math.floor(i * 0.08) > 100:
        break
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
c = math.ceil(a*100/8)
d = math.ceil((a+1)*100/8)
e = math.ceil(b*100/10)
f = (b+1)*100//10
for i in range(d-c):
  if c+i>=e and c+i<f:
    print(c+i)
    break
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
 
A, B = list(map(int, input().split()))
 
rangeA = [A / 0.08, (A + 1) / 0.08]
rangeB = [B / 0.1, (B + 1) / 0.1]
 
if rangeA[0] < rangeB[0]:
  if math.ceil(rangeB[0]) < rangeA[1]:
    print(math.ceil(rangeB[0]))
    exit(0)
elif rangeA[0] > rangeB[0]:
  if math.ceil(rangeA[0]) < rangeB[1]:
    print(math.ceil(rangeA[0]))
    exit(0)
else:  # rangeA[0] == rangeB[0]
  if math.ceil(rangeA[0]) < rangeB[1] and math.ceil(rangeA[0]) < rangeA[1]: 
    print(math.ceil(rangeA[0]))
    exit(0)
print(-1)

Submission status: Accepted

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

Amin = A / 0.08
Amax = (A + 0.999999) / 0.08

Bmin = B / 0.10
Bmax = (B + 0.999999) / 0.10

Aset = set(list(range(math.ceil(Amin), math.floor(Amax))))
Bset = set(list(range(math.ceil(Bmin), math.floor(Bmax))))

result_set = Aset & Bset

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

Submission status: Accepted

Solution code:
A, B = map(int, input().rstrip().split())
ret = 1000000
for i in range(1, 10001):
    if int(i * 0.08) == A and int(i*0.1) == B and ret > i:
        ret = i
        break
if ret == 1000000:
    ret = -1
print(ret)

Submission status: Accepted

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

A_min = 12.5 * A
A_max = 12.5 * (A + 1)

B_min = 10 * B
B_max = 10 * (B + 1)


if A % 2 == 0:
    myList1 = list(range(int(A_min), int(A_max + 1)))
else:
    myList1 = list(range(int(A_min + 1), int(A_max)))

myList2 = list(range(int(B_min), int(B_max)))

mySet = list(set(myList1) & set(myList2))

mySet = [item for item in mySet if item >= 1]

if len(mySet) == 0:
    print(-1)
else:
    print(sorted(mySet)[0])

Submission status: Accepted

Solution code:
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

Submission status: Accepted

Solution code:
line = input()
a, b = line.split(" ")
a = int(a)
b = int(b)
flag = 0

# num_a = int(a / 0.08)

# if int(num_a * 0.1) == b:
#     print(num_a)
# else:
#     print("-1")

flag = 0
for i in range(1,1251):
    if int(i * 0.08) == a:
        if int(i * 0.1) == b:
            print(i)
            flag = 1
            break
if flag == 0:
    print("-1")

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
a, b = (int(i) for i in input().split())

p = []
answer=-1
for i in range(1,1001):
    if int(i*0.08) == a:
        p.append(i)

for i in p:
    if int(i*0.1) == b:
        answer = i
        break

print(answer)

Submission status: Accepted

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

n = int((a/0.08)//1)
ans = -1

for i in range(n,n+10**2):
  if int((i*0.08)//1) == a and int((i*0.1)//1) == b:
    ans = i
    break
  else:
    continue

print(ans)

Submission status: Accepted

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

price = math.ceil(a / 0.08)
#print(price)
price_ = math.floor(b / 0.1)
#print(price_)
if price < price_:
    start, end = price, price_
else:
    start, end = price_, price
for i in range(start, end+1):
    #print(math.floor(i * 0.08),math.floor(i * 0.1))
    #print(i)
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        exit()
if price == price_:
    print(price)
    exit()
print(-1)

Submission status: Accepted

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

for i in range(10, 1251):
    aa = int(i*0.08)
    bb = int(i*0.1)
    if aa == A and bb == B:
        print(i)
        exit()
print("-1")

Submission status: Accepted

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

UE_8 = math.ceil((A+1)/0.08)-1
SHITA_8 = A/0.08
UE_10 = math.ceil((B+1)/0.10)-1
SHITA_10 = B/0.10

if UE_8 < math.ceil(SHITA_10) or UE_10 < math.ceil(SHITA_8):
    print(-1)
else:
    i = math.ceil(SHITA_8)
    j = math.floor(UE_8)
    for n in range(int(i),int(j+1),1):
        if i < UE_10 and i >= SHITA_10:
            print(i)
            break
        i+=1

Submission status: Accepted

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

ax = int(a*100/8)
bx = int(b*10)

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

print(ans)

Submission status: Accepted

Solution code:
import sys
A,B =map(int, input().split())
x = 0
for b in range(B*10,B*10+10):
  if int(b*0.08) == A:
    print(b)
    sys.exit()
print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ans=0
b1=int(B/0.1)
b2=int((B+1)/0.1)
for i in range(b1,b2):
    a=int(i*0.08)
    if a==A:
        ans=i
        break
if ans==0:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
##C
A,B = map(int,input().split())
A1 = list()
B1 = list()
for i in range(1,1250):
    if int(i*0.08) == A:
        A1.append(i)
for j in A1:
    if int(j*0.1) == B:
        B1.append(j)
if not B1:
    print(-1)
else:
    print(min(B1))

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
a=set(range(math.ceil(A/0.08),int((A+1)/0.08)))
b=set(range(math.ceil(B/0.1),int((B+1)/0.1)))
s=a&b
print(min(a&b) if len(s)>0 else -1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
p=0;q=0;x=0;f=0
for i in range(13,1251):
  if int(i*0.08)==A and int(i*0.1)==B:
    print(i)
    f=1
    break
if f==0:
  print(-1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# @Time    : 2020/3/1 19:59
# @Author  : DIRICHLET
# @File    : main.py
a=[]
def myin(fun=int):
    global a
    a=list(map(fun,input().split()))
#myin(int)
a,b=map(int,input().split())
oner=(a+1)/0.08
if a%2==0:
    oner=a//2*25+13
    onel=a//2*25
else:
    oner=(a+1)/2*25
    onel=(a-1)//2*25+13
#*25/2
twol=b*10
twor=b*10+10
l=[[onel,oner],[twol,twor]]
if l[0][0]>l[1][0]:
    l = [[twol, twor],[onel, oner], ]

if l[1][0]<l[0][1]:
    print(l[1][0])
else:
    print(-1)

#print(a)
#[25,37.5) [20,30)
#[19-20) [99-100) 99.5-18.5=81/0.02=4050
#(231.35,243.75] (985,995]
#

Submission status: Accepted

Solution code:
from sys import stdin

def main():

    input = stdin.readline

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import ceil
from math import floor
A, B = map(int,input().split())
PA = A / 0.08
PA_max = (A + 1) /0.08
P = ceil(PA)
while P < PA_max:
    if floor(P * 0.1) == B:
        print(P)
        break
    P += 1
else:
    print(-1)

Submission status: Accepted

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

if ((a+1)/0.08).is_integer():
  s = [math.ceil(a/0.08), int((a+1)/0.08-1)]
else:
  s = [math.ceil(a/0.08), math.floor((a+1)/0.08-1)]
  
t = [int(b/0.1), int((b+1)/0.1 - 1)]

s_set = set([i for i in range(s[0], s[1]+1)])
t_set = set([i for i in range(t[0], t[1]+1)])

ans = list(s_set & t_set)
if ans:
  print(min(ans))
else:
  print(-1)

Submission status: Accepted

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

ans_min = min(a*100//8,b*100//10)
ans_max = max((a+1)*100//8-1,(b+1)*100//10-1)

for i in range(ans_min,ans_max+1):
    if a == i*8//100 and b == i*10//100:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
sisi = [min((A+1)*12.5 ,  (B+1)*10), max(A*12.5, B*10)]
sisi = [i-0.1 if i == int(i) else i for i in sisi]
print

if sisi[0] < sisi[1]:
    ans = -1
elif int(sisi[0]) == int(sisi[1]):
    ans = -1
else:
    ans = int(sisi[1]) +1

print(ans)

Submission status: Accepted

Solution code:
import math

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

x = a * 100 / 8
y = (a+1) * 100 / 8
z = b * 100 / 10
w = (b+1) * 100 / 10
    
if z <= x and x < w and w <= y:
    print(math.ceil(x))
elif x <= z and z < y and y <= w:
    print(math.ceil(z))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

inp = input().split(" ")
A, B = int(inp[0]), int(inp[1])

# print(int(A * 1/0.08))

possible = int(B * 1/0.10) // 10
# print(possible)

answer = []
for i in range(possible * 10, possible * 10 + 10):
  tax_a = int(i * 0.08)
  tax_b = int(i * 0.1)
  # print(tax_a, tax_b)
  if tax_a == A and tax_b == B:
    answer.append(i)

if len(answer) == 0:
  print(-1)
else:
  print(answer[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
a,b= map(int,input().split())
ju=ans=0
li=[]
li1=[]

i=0
for i in range(10001):
  if a==math.floor(i*0.08):
    li.append(i)
  if b==math.floor(i*0.1):
    li1.append(i)

li.sort()
li1.sort()

if len(li1)>0:
  ans=min(li1)
if len(li)>0:
  ju=min(li)
for i in range(len(li1)):
  if ju==li1[i]:
    print(ju)
    sys.exit()
for i in range(len(li)):
  if ans==li[i]:
    print(ans)
    sys.exit()
print('-1')

Submission status: Accepted

Solution code:
import math
import sys
A,B = map(int,input().split())
x = math.floor(A/0.08)
y = math.floor(B/0.1)
for i in range(min(x,y),max(x,y)+3):
    s = math.floor(i*0.08)
    t = math.floor(i*0.1)
    if s == A and t == B:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

# A*12.5 <= rangeA < (A+1)*12.5
rangeA = range(math.ceil(A * 12.5), math.ceil((A+1) * 12.5))
# B*10 <= rangeB < (B+1)*10
rangeB = range(math.ceil(B * 10), math.ceil((B+1) * 10))
# ans = min(common(rangeA, rangeB))
common = set(rangeA) & set(rangeB)
if len(common) > 0:
    print(min(common))
else:
    print(-1)

Submission status: Accepted

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

if a%2 == 1:
    xa = int(a*12.5)+1
else:
    xa = int(a*12.5)
xb = int(b*10)

flag = True
maxi = max(xa,xb)
mini = min(xa,xb)
for i in range(mini,maxi+1):
    if (int(0.08*i) == a) and (int(0.1*i) == b):
        print(i)
        flag = False
        break
        
if flag == True:
    print('-1')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if max(25*a,20*b) >= min(25*(a+1),20*(b+1)):
    ans = -1
else:
    ans = (max(25*a,20*b)+1) // 2

print(ans)

Submission status: Accepted

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

ans = -1
#a,bの最大値が100円までなので、消費税100円になる10000円まで実行すればOK
for i in range(1, 10001):
  if int(i * 0.08) == a and int(i * 0.10) == b:
    ans = i
    break

print(ans)

Submission status: Accepted

Solution code:
A, B = [int(y) for y in input().split(' ')]
if int((A/8) * 100) == (A/8) * 100:
  priceA_min = int((A/8) * 100)
else:
  priceA_min = int((A/8) * 100) + 1
if int(((A+1)/8) * 100) == ((A+1)/8) * 100:
  priceA_max = int(((A+1)/8) * 100) - 1
else:
  priceA_max = int(((A+1)/8) * 100)
found = False
for x in range(priceA_min,priceA_max+1,1):
  if int(x*0.1) == B:
    print(x)
    found = True
    break
if not found:
  print(-1)

Submission status: Accepted

Solution code:
import math

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

ans = []

true_A_max = A + 0.999
true_B_max = B + 0.999

X_A = math.floor(A / 0.08)
X_max_A = math.ceil(true_A_max /0.08)
X_B = math.floor(B / 0.1)
X_max_B = math.ceil(true_B_max /0.08)

if X_max_A - X_A >= X_max_B - X_B:
    X_min = X_B
    X_max = X_max_B

else:
    X_min = X_A
    X_max = X_max_A

for X in range(X_min, X_max):
    cal_A = math.floor(X * 0.08)
    cal_B = math.floor(X * 0.1)
    
    if cal_A == A and cal_B == B:
        ans.append(X)
            
if len(ans) > 0:
    print(min(ans))
else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if A%0.08 == 0:
    a_min = int(A/0.08)
else:
    a_min = int(A//0.08) + 1
a_max = (A+1)//0.08

result = -1
for i in range(int(a_min), int(a_max)+1):
    if (i*0.1//1 == B)*(i*0.08//1 == A):
        result = i
        break
print(result)

Submission status: Accepted

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

pa = [[] for i in range(110)]
pb = [[] for i in range(111)]

for i in range(1251):
  pa[int(i*0.08)].append(i)
  
for i in range(1101):
  pb[int(i*0.10)].append(i)
  
na = pa[a]
nb = pb[b]

for ca in na:
  if ca in nb:
    print(ca)
    exit()

print(-1)

Submission status: Accepted

Solution code:
import math

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

#x=A/0.08
#y=B/0.10

ans=9999
#max_y=( int(y) + 10 )%100
for i in range(1,1251):
  v_08 = math.floor(i * 0.08)
  v_10 = math.floor(i * 0.1)
  
  if v_08==A and v_10==B:
    ans=min(ans,i)

print(ans if ans != 9999 else -1)

Submission status: Accepted

Solution code:
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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


ARangemin = math.ceil(A * (100/8))
BRangemin = math.ceil(B * (100/10))

ARangemax = ARangemin
BRangemax = BRangemin
while int(ARangemax * 0.08) == A:
    ARangemax = ARangemax + 1
while int(BRangemax* 0.10) == B:
    BRangemax = BRangemax + 1
ARangemax = ARangemax -1
BRangemax = BRangemax -1

if ARangemax >= BRangemin or ARangemin >= BRangemax:
    if ARangemin >= BRangemax:
        print(-1)
    else:
        if ARangemin > BRangemin:
            print(ARangemin)
        else:
            print(BRangemin)
else:
    print(-1)

Submission status: Accepted

Solution code:
tax = []
a,b = map(int, input().split())
for i in range(1,10000):
  tax8 = int(i * 0.08)
  if tax8 == a:
    if int(i * 0.1) == b:
      tax.append(i)
if tax == []:
  print(-1)
else:
  print(tax[0])

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
tmpa = math.floor(A / 0.08)
tmpb = math.floor(B / 0.1)
alst = []
blst = []

indexa = 0
while True:
    tmp = math.floor((tmpa + indexa) * 0.08)
    if tmp == A:
        alst.append(tmpa + indexa)
        indexa += 1
    elif tmp > A:
        break
    else:
        indexa += 1

indexb = 0
while True:
    tmp = math.floor((tmpb + indexb) * 0.1)
    if tmp == B:
        blst.append(tmpb + indexb)
        indexb += 1
    elif tmp > B:
        break
    else:
        indexb += 1
ans = -1
alst.sort()
blst.sort()
for i in alst:
    if blst.count(i) >= 1:
        ans = i
        break

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import floor

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

num = int(-(-B // 0.1))

for i in range(10):
    if floor((num + i) * 0.08) == A:
        print(num + i)
        break
else:
    print(-1)

Submission status: Accepted

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