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

def tax_increase(a, b):
    a_list = []
    b_list = []
    if (a+1.0)/0.08+1 == int((a+1.0)/0.08)+1:
        for i in range(math.ceil((a)/0.08), int((a+1.0)/0.08)):
            a_list.append(i)
    else:
        for i in range(math.ceil((a)/0.08), int((a+1.0)/0.08)+1):
            a_list.append(i)
    if (b+1.0)/0.1+1 == int((b+1.0)/0.1)+1:
        for i in range(math.ceil((b)/0.1), int((b+1.0)/0.1)):
            b_list.append(i)
    else:
        for i in range(math.ceil((b)/0.1), int((b+1.0)/0.1)+1):
            b_list.append(i)
    if a_list[0] == b_list[0]:
        return a_list[0]
    elif a_list[0] < b_list[0]:
        for a_i in a_list:
            if a_i in b_list:
                return a_i
    else:
        for b_i in b_list:
            if b_i in a_list:
                return b_i
    return -1

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

print(tax_increase(a, b))

Submission status: Accepted

Solution code:
import math


A, B = map(int, input().split())
for x in range(1, 1001):
    if math.floor(x * 0.08) == A and math.floor(x * 0.1) == B:
        print(x)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import math

def main():
    t8, t10 = map(int, input().split())

    notax = math.ceil(max(t8 / 0.08, t10 / 0.1))
    nt_max = min((t8 + 1) / 0.08, (t10 + 1) / 0.1)

    if notax < nt_max:
        print(notax)
    else:
        print(-1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if ((25*a)+1)//2 > 10*b+9 or ((25*(a+1))-1)//2  < 10*b:
    print(-1)
else:
    print(max(10*b,((25*a)+1)//2))

Submission status: Accepted

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

xa=int(12.5*a-0.0001)+1
xb=10*b
x=max(xa,xb)
ra=int(x*0.08)
rb=int(x*0.1)

if ra==a and rb==b:
    print(x)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
a_max = (a + 1)/0.08
a_min = a / 0.08
b_max = (b + 1)/0.1
b_min = b / 0.1
u = 0
for i in range(int(b_max) + 1):
    if a_min <= i < a_max and b_min <= i < b_max:
        print(i)
        break
    else:
        u += 1
if u == int(b_max) + 1:
    print(-1)

Submission status: Accepted

Solution code:
import math

a = list(map(int, input().split()))
b = -1
for i in range(1001):
    x = math.floor(i*0.08)
    y = math.floor(i*0.1)
    if a[0] == x and a[1] == y:
        b = i
        break

print(b)

Submission status: Accepted

Solution code:
from math import floor, ceil

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

#print(A/0.08,B/0.10)

candidates = [floor(A/0.08),ceil(A/0.08),floor(B/0.10),ceil(B/0.10)]

#print(candidates)

ans = -1
for candidate in candidates:
    #print(candidate*0.08,candidate*0.10)
    if floor(candidate*0.08) == A and floor(candidate*0.10) == B:
        ans = candidate
        break
print(ans)

Submission status: Accepted

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

import math

la = []
lb = []
for i in range(1001):
    if math.floor(0.08*i) == A:
        la.append(i)
    else:
        continue

for i in range(1001):
    if math.floor(0.1*i) == B:
        lb.append(i)
    else:
        continue

lab = set(la) & set(lb)

if not lab:
    print(-1)
else:
    print(min(lab))

Submission status: Accepted

Solution code:
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

def main():
    a,b = map(int,input().split())
    ans = []
    x = int(min(a//0.08,b//0.1))
    y = int(max((a+1)//0.08,b//0.1))
    for i in range(x,y+1):
        if int(i*0.08)==a and int(i*0.1)==b:
            ans.append(i)
    if len(ans):
        print(min(ans))
    else:
        print(-1)
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

priceA_min = math.ceil(A / 0.08)
priceA_max = math.ceil((A + 1) / 0.08)
priceB_min = math.ceil(B / 0.1)
priceB_max = math.ceil((B + 1) / 0.1)

priceAs = []
if priceA_min != priceA_max:
    price = priceA_min
    while True:
        if price >= priceA_max:
            break
        priceAs.append(price)
        price += 1
else:
    priceAs.append(priceA_min)

priceBs = []
if priceB_min != priceB_max:
    price = priceB_min
    while True:
        if price >= priceB_max:
            break
        priceBs.append(price)
        price += 1
else:
    priceBs.append(priceB_min)

P = False
for i in range(len(priceAs)):
    for j in range(len(priceBs)):
        if priceAs[i] == priceBs[j]:
            print(priceAs[i])
            P = True
            break
    if P == True:
        break
if P == False:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
b = b/0.1
b_list = [i+b for i in range(10)]
for i in b_list:
    if int(i*0.08) == a:
        print(int(i))
        exit()
print("-1")

Submission status: Accepted

Solution code:
# 2020/03/07
# AtCoder Beginner Contest 158 - C

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

ep = list()
tp = list()

# Calc
e_st = -1
e_ed = -1
t_st = -1
t_ed = -1

for i in range(1010):
    ep.append(int(i * 0.08))
    tp.append(int(i * 0.1))
    
    if e_st == -1 and ep[i] == a:
        e_st = i
    elif e_ed == -1 and e_st != -1 and ep[i] != ep[i-1]:
        e_ed = i - 1

    if t_st == -1 and tp[i] == b:
        t_st = i
    elif t_ed == -1 and t_st != -1 and tp[i] != tp[i-1]:
        t_ed = i - 1

ans = 0
if (e_ed < t_st and e_st < t_ed) or (t_ed < e_st and t_st < e_ed):
    ans = -1
else:
    ans = max(e_st, t_st)

# Output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

if a/(b+1) < 0.8 and 0.8 < (a+1)/b:
    mina = a/0.08
    minb = b/0.1
    bigger = max(mina, minb)
    print(math.ceil(bigger))
else:
    print(-1)

Submission status: Accepted

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

def no_tax(tax,tax_r):
    origin,min,max = 0,0,0
    while int(origin*tax_r) < tax:
        origin += 1
    min = origin
    while int(origin*tax_r) <= tax:
        origin += 1
    max = origin-1
    return (min,max)

A_min,A_max,B_min,B_max = \
no_tax(A,0.08)[0],no_tax(A,0.08)[1],no_tax(B,0.1)[0],no_tax(B,0.1)[1]

if A_min <= B_max and B_min <= A_max:
    print(max(A_min,B_min))
else:
    print(-1)

Submission status: Accepted

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

ans = -1
for x in range(20000):
  tmp1 = int(x*0.08)
  tmp2 = int(x*0.10)
  if((tmp1 == A)and(tmp2 == B)):
    ans = x
    break
print(ans)

Submission status: Accepted

Solution code:
import math

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

cnt = 0
for i in range(1,100000):
    X = math.floor(i * 0.08)
    Y = math.floor(i * 0.1)
    if A == X and B == Y:
        print(i)
        cnt += 1
        break
        
if cnt == 0:
    print(-1)

Submission status: Accepted

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


def main():
    x = int(A / 0.08) + 1
    y = int(B / 0.1) + 1

    p = max(x, y)
    correct = -1
    while True:
        if p < 0:
            break

        if int(p * 0.08) == A and int(p * 0.1) == B:
            correct = p

        p -= 1

    return correct


print(main())

Submission status: Accepted

Solution code:
from math import ceil
def main():
  a,b=map(int,input().split())
  for i in range(ceil(a/0.08),ceil((a+1)/0.08)):
    if int(i*0.1)==b:
      return i
  return -1
print(main())

Submission status: Accepted

Solution code:
a, b = map(int, open(0).read().split())

a_l = a / 0.08
a_r = (a + 1) / 0.08
b_l = b / 0.1
b_r = (b + 1) / 0.1

x_l = max(a_l, b_l)
x_r = min(a_r, b_r)

if x_l < x_r:
    if(x_l * 10 % 10 == 0):
        print(int(x_l))
    else:
        print(int(x_l + 1))
else:
    print(-1)

Submission status: Accepted

Solution code:

a,b = map(int,input().split())
a1=(a*100)//8
if (a*100)%8!=0:
    a1+=1
a2=(a+1)*100//8
b1=b*10
b2=(b+1)*10




for i in range(1,1250):
    if a1<=i<a2 and b1<=i<b2:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
from math import ceil

a, b = tuple(map(int, input().split()))
min_a = ceil(a / 0.08)
max_a = ceil((a + 1) / 0.08)
min_b = ceil(b / 0.1)
max_b = ceil((b + 1) / 0.1)

if (max_a <= min_b) or (max_b <= min_a):
    print(-1)
else:
    print(max(min_a, min_b))

Submission status: Accepted

Solution code:
import math
def ccc(a, b):

    for i in range(1, 100000):
        an = math.floor(i * 0.08)
        bn = math.floor(i * 0.1)
        if an == a and bn == b:
            return i
    return "-1"

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

a,b = map(lambda x: int(x), input().split())


hati_s = a/0.08
hati_l = (a+1)/0.08

ten_s = b/0.1
ten_l = (b+1)/0.1

#print(hati_s,hati_l,ten_s,ten_l)


def intersec(a_min,a_max,b_min,b_max):
    if a_min < b_min:
        if a_max < b_min:
            return [0,0]
        else:
            if a_max < b_max:
                return [b_min,b_max]
            else:
                return [b_min,a_max]
    else:
        if b_max < a_min:
            return [0,0]
        else:
            if b_max < a_max:
                return [a_min,a_max]
            else:
                return [a_min,a_max]


def min_int(pair):
    if pair == [0,0]:
        return -1
    else:
        return math.ceil(pair[0])



tmp = intersec(hati_s,hati_l,ten_s,ten_l)

if math.ceil(tmp[0]) == math.ceil(tmp[1]):
    print(-1)
else:
    tst = min_int(tmp)
    if math.floor(tst*0.08) == a and math.floor(tst*0.1) == b:
        print(tst)
    else:
        print(-1)

Submission status: Accepted

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

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

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

print("-1")

Submission status: Accepted

Solution code:
AB = input().split(' ')
A = int(AB[0])
B = int(AB[1])
predictA = round(A/0.08)
if predictA < A/0.08:
    predictA += 1
predict_maxA = round((A+1)/0.08)
if predict_maxA < (A+1)/0.08:
    predict_maxA += 1
predictB = B*10
predict_maxB = (B+1)*10
preA = [x for x in range(predictA,predict_maxA)]
preB = [x for x in range(predictB,predict_maxB)]
pre = preA + preB
res = [x for x in set(pre) if pre.count(x) > 1]
if len(res)>0:
    print(min(res))
else:
    print(-1)

Submission status: Accepted

Solution code:
def main():
	a,b = map(int,input().split())
	import math
	ans = 0
	i = 2
	while i <= 1250:
		if math.floor(i * 0.08) == a and  math.floor(i *0.1) == b:
			print(i)
			ans = 1
			break
		else:
			i += 1
	if ans == 0:
		print(-1)

if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

res1 = math.floor(a / 0.08)

while True:
    if math.floor(res1 * 0.08) != a:
        res1 += 1
    else:
        break

while True:

    if math.floor(res1 * 0.1) == b and math.floor(res1 * 0.08) == a:
        print(res1)
        break
    elif math.floor(res1 * 0.1) > b or math.floor(res1 * 0.08) > a:
        print(-1)
        break    
    else:
        res1 += 1

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
MAX = 1001
for i in range(1, MAX):
  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())
a=math.ceil(A/0.08)
list=[]
count=0
while math.floor((a+count)*0.08)==A:
    list.append(a+count)
    count+=1
suuji=0

for b in list:
    if math.floor(b*0.1)==B:
        print(b)
        break
    else:
        suuji+=1
if suuji==len(list):
    print(-1)
else:
    pass

Submission status: Accepted

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

a = math.ceil(A/0.08)
b = math.ceil(B/0.1)
a2 = math.ceil((A+1)/0.08)
b2 = math.ceil((B+1)/0.1)
ans = max(a,b)
if a > b:
    if a >= b2:
        ans = -1
else:
    if b >= a2:
        ans = -1
print(int(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

if a % 2 == 0:
    a_min = int(a * 12.5)
else:
    a_min = int(a * 12.5) + 1

if (a + 1) % 2 == 0:
    a_max = int((a + 1) * 12.5) - 1
else:
    a_max = int((a + 1) * 12.5)

b_min = b * 10
b_max = (b + 1) * 10 - 1

if a_max < b_min:
    print("-1")
elif a_min <= b_min:
    print(int(b_min))
elif b_max >= a_min:
    print(int(a_min))
else:
    print("-1")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a * 100 % 8 == 0:
    low = max(a * 100 // 8, b * 10)
else:
    low = max(a * 100 // 8 + 1, b * 10)
if 100 * (a + 1) % 8 == 0:
    a_ = 100 * (a + 1) // 8 - 1
else:
    a_ = 100 * (a + 1) // 8

high = min(a_, 10 * (b+1) -1)

if low <= high:
    print(low)
else:
    print(-1)

Submission status: Accepted

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

X = 0

if math.ceil(A * (100 / 8)) >= math.ceil(B * 10):
    X = math.ceil(A * (100 / 8))
    if math.floor(X * 0.08) == A and math.floor(X * 0.1) == B:
        print(X)
    else:
        print(-1)
else:
    X = math.ceil(B * 10)
    if math.floor(X * 0.08) == A and math.floor(X * 0.1) == B:
        print(X)
    else:
        print(-1)

Submission status: Accepted

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

A_down = (25 * A ) //2
A_up = (25 * (A + 1 )) //2

if (A_down * 8 )//100 != A:
    A_down += 1

if (A_up * 8 )//100 != A:
    A_up -= 1


B_down = 10 * B
B_up = 10 * (B + 1) - 1 

if A_up < B_down or B_up < A_down:
    print(-1)
else:
    if  B_down <= A_down <= B_up:
        print(A_down)
    elif A_down <= B_down <= A_up:
        print(B_down)
    else:
        print(-1)

Submission status: Accepted

Solution code:
import math
a, b = list(map(int, input().split(' ')))
x = 10 * b
result = -1
for i in range(x, x+10):
    if math.floor(i * 0.08) == a:
        result = i
        break
print(result)

Submission status: Accepted

Solution code:
import math

tax8 =0.08
tax10=0.1
# price = org * (1 + tax)
# org * tax = (price - org) = X
# org = X / tax

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

org_a = math.ceil(A / tax8)
org_b = math.ceil(B / tax10)

#print org_a, org_b

#print math.floor(org_a * tax8),  math.floor(org_a * tax10)
#print math.floor(org_b * tax8),  math.floor(org_b * tax10)

if math.floor(org_a * tax8) == A and  math.floor(org_a * tax10) == B:
    print int(org_a)
elif math.floor(org_b * tax8) == A and math.floor(org_b * tax10) == B:
    print int(org_b)
else:
    print -1

Submission status: Accepted

Solution code:
from math import ceil as c
a,b=map(int,input().split())
amin=c(a/0.08)
amax=c((a+1)/0.08)-1
bmin=b*10
if amax<bmin or bmin+9<amin:
    print(-1)
elif bmin<amin:
    print(amin)
else:
    print(bmin)

Submission status: Accepted

Solution code:
from math import floor
A, B = map(int, input().split())
for x in range(1, 1001):
    if floor(x * 0.08) == A and floor(x * 0.1) == B:
        print(x)
        break
else:
    print(-1)

Submission status: Accepted

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

index = 0
val_list = list(range(0, 1263))

is_exist = False
while len(val_list) > 0:
    mid = len(val_list) // 2
    av = int(val_list[mid] * 0.08)
    bv = int(val_list[mid] * 0.1)
    if av == A and bv == B:
        index = mid
        is_exist = True
        break
    else:
        if av > A or bv > B:
            val_list = val_list[:mid]
        else:
            val_list = val_list[mid+1:]

if is_exist:
    ans = 0
    for i in range(0, index+1):
        if int(val_list[i] * 0.08) == A and int(val_list[i] * 0.1) == B:
            ans = val_list[i]
            break
    print(ans)
else:
    print(-1)

Submission status: Accepted

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

number1 = A*100/8
number2 = B*100/10
if number1 != number1//1:
    number1 = number1//1 + 1
if number2 != number2//1:
    number2 = number2//1 + 1
number1 = int(number1)
number2 = int(number2)

if number1//10 == B:
    if number2*8//100 == A:
        if number1 <= number2:
            print(number1)
        else:
            print(number2)
    else:
        print(number1)
else:
    if number2*8//100 == A:
        print(number2)
    else:
        print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
x = int(100 * a / 8)
y = int(100 * b / 10)
ans = min(x, y)
count = 0
ansi = 0
for i in range(30):
    ansi = ans + i
    if int(ansi * 8 / 100) == a and int(ansi * 10 / 100) == b:
        break
    count += 1
if count == 30:
    print("-1")
else:
    print(ansi)

Submission status: Accepted

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


def main():
    A, B = map(int, input().split())
    range_min = int(max((A) / 0.08, (B) / 0.1))
    range_max = int(min((A + 1) / 0.08, (B + 1) / 0.1))

    for i in range(range_min, range_max + 1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            print(i)
            exit(0)
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

# S * 0.08 = A + a, S * 0.10 = B + b
#  A < B
# A <= S * 0.08 < A+1 B <= S * 0.10 < B+1

def getS(A, B):
    if A / 0.08 <= B / 0.10:
        start = int(A / 0.08)
        end = int((B + 1) // 0.10 + 1)
        for S in range(start, end):
            if int(S * 0.08) == A and int(S * 0.10) == B:
                return S
        return -1
    elif B / 0.10 < A / 0.08:
        start = int(B / 0.10)
        end = int((A + 1) // 0.08 + 1)
        for S in range(start, end):
            if int(S * 0.08) == A and int(S * 0.10) == B:
                return S
        return -1
    
print(getS(A, B))

Submission status: Accepted

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
  
  if i == 1250:
    print(-1)

Submission status: Accepted

Solution code:
import math
x = input().split()

A = int(x[0])
B = int(x[1])

T = "n"
for i in range(1500):
  if math.floor(0.08*i) == A and math.floor(0.1*i) == B:
    print(i)
    T = "y"
    break
if T == "n":
  print(-1)

Submission status: Accepted

Solution code:
import math

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

a_1 = math.ceil(a/0.08)
a_2 = math.ceil((a+1)/0.08)
b_1 = b * 10
b_2 = (b+1) * 10

if a_1 >=b_2 or b_1 >= a_2:
    print(-1)
else:
    print(max(a_1,b_1))

Submission status: Accepted

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

ans = -1
x = b * 10
for i in range(10):
    if math.floor((x + i) * 0.08) == a:
        ans = x + i
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor
def main():
    A, B = map(int, input().split())
    minX = -1
    fB = (B*10 // 10) * 10
    bXCands = [fB+i for i  in range(10)]
    for aXcand in bXCands:
        if int(aXcand * 0.08) == A:
            minX = aXcand
            break
    print(minX)



    # minX = -1
    # aX = int(A * 100 / 8)
    # if int(aX * 0.1) == B:
    #     minX = aX

    # bX = int(B * 100 / 10)
    # if int(bX * 0.08) == A:
    #     if minX == -1:
    #         minX = bX
    #     else:
    #         minX = min(aX, bX)
    # print(minX)
    

main()

Submission status: Accepted

Solution code:
# coding: utf-8
import math
a, b = map(float, input().split())
i = math.ceil(a/0.08)
while i*0.08 < a+1:
    #print(i)
    if math.floor(i*0.1) == b:
        print(i)
        break
    else:
        i += 1
else:
    print('-1')

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]
    
    (a, b) = [int(e) for e in lines[0].split(" ")]

    return (a, b)


def solve(a, b):

   
    x1f = math.floor(a / 0.08)
    x1c = math.ceil(a / 0.08)
    x2f = math.floor(b / 0.1)
    x2c = math.ceil(b / 0.1)

    both = []
    if math.floor(x1f * 0.08) == a and math.floor(x1f * 0.1) == b:
        both.append(x1f)

    if math.floor(x1c * 0.08) == a and math.floor(x1c * 0.1) == b:
        both.append(x1c)

    if math.floor(x2f * 0.08) == a and math.floor(x2f * 0.1) == b:
        both.append(x2f)

    if math.floor(x2c * 0.08) == a and math.floor(x2c * 0.1) == b:
        both.append(x2c)


    result = -1
    if len(both):
        result = min(both)
    

    return  result


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
ans = 0
for zeinuki in range(1,1001):
    if math.floor(zeinuki*0.08) == a and\
       math.floor(zeinuki*0.1)  == b:
        ans = zeinuki
        break
if ans == 0:
    print("-1")
else:
    print(ans)

Submission status: Accepted

Solution code:
def resolve():
    inf = 2000

    a,b =map(int, input().split())
    ax = [int(x*0.08) for x in range(inf)]
    bx = [int(y*0.1) for y in range(inf)]
    aans = []
    bans = []
    for i,j in enumerate(ax):
        if j == a:
            aans.append(i)
    for i,j in enumerate(bx):
        if j == b:
            bans.append(i)
    ans_set = set(aans) & set(bans)
    if len(ans_set)!=0:
        print(min(ans_set))
    else:
        print("-1")
    
if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
# coding: utf-8


def main():
    tax8, tax10 = map(int, input().split())

    rate8 = 0.08
    rate10 = 0.1
    value8 = tax8 / rate8
    value10 = tax10 / rate10

    price_min = int(min(value8, value10))
    price_max = int(max(value8, value10)) + 1

    # print('price_min, price_max', price_min, price_max)

    for price in range(price_min, price_max + 1):
        # print(int(price / (1 - rate8)), int(price / (1 - rate10)))
        if int(price * rate8) == tax8 and int(price * rate10) == tax10:
            print(price)
            return 0
    
    print('-1')

    return 0


if __name__ == '__main__':
    main()

Submission status: Accepted

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

num = math.ceil(25 / 2 * A)
A_list = []

if A % 2 == 0:
  while num <= math.floor(25 / 2 * (A + 1)):
    A_list.append(num)
    num += 1
else:
  while num < 25 / 2 * (A + 1):
    A_list.append(num)
    num += 1

res = -1
A_list.sort(reverse=True)
for item in A_list:
  if item >= 10 * B and item < 10 * (B + 1):
    res = item

print(res)

Submission status: Accepted

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

p = int(a // 0.08)
q = int(b // 0.1)
s = 13 if p < 24 else p - 12
e = 999 if q > 999 else q + 10
for i in range(s, e+1):
    if int(i * 0.08) == a and int(i *0.1) == b:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

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

ans = -1
for i in range(1, 1001):
    if math.floor(i * 0.08) == a and \
        math.floor(i * 0.1) == b:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math

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

X = 13

while math.floor(X * 0.08) != A or math.floor(X * 0.10) != B:
    X += 1
    if math.floor(X * 0.08) > A:
        X = -1
        break

print(X)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**9)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a,b = na()

c = int(min(a//0.08,b//0.1))

while True:
	d = int(c*0.08)
	e = int(c*0.1)
	if d == a and e == b:
		print(c)
		exit()
	if d > a or e > b:
		print(-1)
		exit()
	c+=1

Submission status: Accepted

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

Submission status: Accepted

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

minA = float(A) / 0.08
maxA = (float(A)+0.9) / 0.08
minB = float(B) / 0.1
maxB = (float(B)+0.9) / 0.1

if (minA >= minB)&(minA <= maxB):
	if (ceil(minA) < maxA) & (ceil(minA)< maxB):
		print(ceil(minA))
	else:
		print(-1)
elif(minB > minA)&(minB <= maxA):
	if (ceil(minB) < maxA) & (ceil(minB)< maxB):
		print(ceil(minB))
	else:
		print(-1)
else:
	print(-1)

Submission status: Accepted

Solution code:
from math import ceil

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

a_min = a * 100 / 8
a_max = (a + 1) * 100 / 8

b_min = b * 100 / 10
b_max = (b + 1) * 100 / 10

out = max(a_min, b_min)
print(ceil(out) if (out < a_max) & (out < b_max) else -1)

Submission status: Accepted

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

lsta = list(range(math.ceil(12.5*A), math.ceil((A+1)*12.5)))

ans = -1

for i in lsta:
    if int(i*0.1)==B:
        ans=i
        break
print(ans)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a,b = [int(a.strip()) for a in input().strip().split(' ')]
    min_a = int(12.5*a+0.5)
    max_a = int(12.5*(a+1)+0.5)
    # print(12.5*a+0.5)
    # print(max_a)
    # print(list(range(min_a,max_a)))

    min_b = 10*b
    max_b = 10*(b+1)

    flg = 0
    for i in range(min_a,max_a):
        if i in range(min_b,max_b):
            print(i)
            flg = 1
            break

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

price = "-1"
for x in range(1, 100000+1):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        price = x
        break

print(price)

Submission status: Accepted

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

tax1 = 0.08
tax2 = 0.1
ans = -1
for i in range(1, 1001):
    if A <= i * tax1 and i * tax1 < A + 1:
        if B <= i * tax2 and i * tax2 < B + 1:
            ans = i
            break

print(ans)

Submission status: Accepted

Solution code:
import sys
nums=input().rstrip().split(" ")
A=int(nums[0])
B=int(nums[1])
answer=0
for i in range(1,1500):
    #print(int(i*0.08))
    #print(int(i*0.1))
    if int(i*0.1)==B and int(i*0.08)==A:
        answer=i
        print(answer)
        sys.exit()
if answer==0:
    answer=-1
print(answer)

Submission status: Accepted

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

flag = False

X = min([(A*100)//8, B*10])

while  X*8 < A*100 + 100 and X*10 < B*100 + 100:
    if A*100 <= X*8 and B*100 <= X*10:
        flag = True
        break
    
    X += 1
    
if flag:
    print(X)
else:
    print(-1)

Submission status: Accepted

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

import math
A_under = math.ceil(A / 0.08)
A_over = math.ceil(((A+1) / 0.08) - 1)


for i in range(A_under, A_over+1):
  if math.floor(i * 0.1) == B:
    print(i)
    break
  elif i == A_over:
    print("-1")

Submission status: Accepted

Solution code:
from math import floor
def Main(A, B):
    a = A * 12.5
    b = B * 10
    st = floor(min(a, b))
    for i in range(st, 1251):
        if floor(i * 0.08) == A and floor(i * 0.1) == B:
            return i
    return -1 
                     

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

A_min = math.ceil(A / 0.08)
A_max = (A + 1) / 0.08

B_min = math.ceil(B / 0.1)
B_max = (B + 1) / 0.1

ans = max(A_min, B_min)
if ans < A_max and ans < B_max:
    print(ans)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

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

flag = -1
for i in range(10*B, (10*B)+9):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        flag = i
        break
print(flag)

Submission status: Accepted

Solution code:
import math
ab=list(map(int, input().split()))
a=ab[0]
b=ab[1]
a0=12.5*a
a1=12.5*(a+1)
b0=10*b
b1=10*(b+1)
answer=0
if(a0>=b1):
    answer=-1
elif(a1<=b0):
    answer=-1
else:
    if(a0<b0):
        answer=math.ceil(b0)
    else:
        answer=math.ceil(a0)
print(int(answer))

Submission status: Accepted

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


answer = -1

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

print(int(answer))

Submission status: Accepted

Solution code:
import sys

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

l = int(A / 0.08 + 1 - 1e-8)
r = int((A + 1) / 0.08 + 1 - 1e-8)

x = -1
for i in range(l, r):
    if int(i * 0.1) == B:
        x = i
        break

print(x)

Submission status: Accepted

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