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:
#!/usr/bin/env python3
import sys
from decimal import Decimal as D

input = sys.stdin.readline


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


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


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


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


A, B = MI()

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

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

print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ca_min = 100*A / 8
ca_max = 100*(A+1) / 8

cb_min = 10*B
cb_max = 10*(B+1)

# ca_min<= ca < ca_max
# cb_min<= cb < cb_max

AA = []
BB = []

for i in range(1, 1001):
  if ca_min<= int(i) < ca_max:
    AA.append(int(i))

for i in range(1, 1001):
  if cb_min<= int(i) < cb_max:
    BB.append(int(i))

CC = set(AA) & set(BB)

if CC == set():
  print(-1)
else:
  print(min(CC))

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
amin = A/0.08
amax = (A+1)/0.08
bmin = B/0.1
bmax = (B+1)/0.1

if bmin == amax or amin == bmax:
    print(-1)
else:
    ans = max(amin, bmin)
    ans = math.ceil(ans)
    if ans < amax and ans < bmax:
        print(ans)
    else:
        print(-1)

Submission status: Accepted

Solution code:
import math

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

A_min = math.ceil(12.5*A)
A_max = math.ceil(12.5*(A+1)) - 1

B_min = math.ceil(10*B)
B_max = math.ceil(10*(B+1)) - 1

for i in range(B_min, B_max+1):
    if A_min <= i <= A_max:
        print(i)
        break
    if i == B_max:
        print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=[int(x) for x in input().split()]
c=0
for i in range(1,12501):
  if int(0.08*i)==a and int(0.1*i)==b:
    ans=i
    c=1
    break
if c==1:
  print(ans)
else:
  print(-1)

Submission status: Accepted

Solution code:
import sys
#h,w=map(int,input().split())
#S=[list(map(int,input().split())) for _ in range(h)]
a,b=map(int,input().split())
for i in range(2000):
    if int(i*8/100)==a and int(i*10/100)==b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if a%2 == 0:
  	a_list = [int(a/0.08) + i for i in range(13)]
else:
  	a_list = [int(a/0.08) + i for i in range(1,13)]
b_list = [int(b/0.1) + j for j in range(10)]
com = set(a_list) & set(b_list)
if len(com) == 0:
    print(-1)
elif len(com) != 0:
    if int(min(com)*0.08) != a or int(min(com)*0.1) != b:
        print(-1)
    else:
        print(min(com))

Submission status: Accepted

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

    for price in [str(x) for x in range(10, 1001)]:
        a = str(int(price) * 8)
        a = int(a[:-2]) if len(a) >= 3 else 0
        b = int(price[:-1]) if len(price) >= 2 else 0
        if a == A and b == B and a <= 100 and b <= 100:
            print(price)
            return
    print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
a_s=a/0.08
a_t=(a+1)/0.08
b_s=b/0.1
b_t=(b+1)/0.1

a0=int(a_s)
a1=int(a_t)
b0=int(b_s)
b1=int(b_t)


if (a_s-a0)>0:
  a0+=1
if (a_t-a1)<=0:
  a1-=1
if (b_s-b0)>0:
  b0+=1
if (b_t-b1)<=0:
  b1-=1

lista=[i for i in range(a0,a1+1)]
listb=[i for i in range(b0,b1+1)]

ansl=[]
for j in range(len(lista)):
  if lista[j] in listb:
    ansl.append(lista[j])

if not ansl==[]:
  ans=ansl[0]
  print(ans)
else:
  print(-1)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
ans = -1
for x in range(1010):
    a = int((x*0.08))
    b = int(x*0.1)
    if a == A and b == B:
        print(x)
        sys.exit()
print(ans)

Submission status: Accepted

Solution code:
import math
def abc158c_tax_increase():
    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)
            return
    print('-1')

abc158c_tax_increase()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1270):
  x = i * 8
  y = x / 100
  z = i * 10
  q = z / 100
  if a == int(y) and b == int(q):
    if ans == 0:
      ans = i
    else:
      ans = min(ans, i)

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

Submission status: Accepted

Solution code:
def resolve():
    A, B = list(map(int, input().split()))
    import math
    for i in range(1, math.ceil(100/0.08)+1):
        if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
            print(i)
            return
    print(-1)


if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

minb = math.ceil(b * 12.5)

if b % 2 == 1:
  maxb = int((b+1) * 12.5 - 1)
else:
  maxb = int(math.floor((b+1) * 12.5))

minc = c * 10
maxc = (c+1) * 10 - 1

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

Submission status: Accepted

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

for i in range(1, 1251):
    aa = (i * 0.08) // 1
    bb = (i * 0.1) // 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())
ans = 0
AT = 0.08
BT = 0.1

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
import sys
input = lambda: sys.stdin.readline().strip()
a, b = [int(x) for x in input().split()]
try:
    print(next(x for x in range(2000) if 8 * x // 100 == a and 10 * x // 100 == b))
except StopIteration:
    print(-1)

Submission status: Accepted

Solution code:
import math

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

for i in range(1,10001):
  if math.floor(i*(8/100)) == a and math.floor(i*(10/100)) == b:
    ans=i
    break
    
print(ans)

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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

for i in range(1,1001):
    if floor(i*0.08) == A_tax and floor(i*0.1) == B_tax:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
import math
import sys
A,B = map(int,input().split())
for i in range(B*10,B*10+10):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

x = 1
while x <= 1100:
    if (x*8//100) == a and (x//10) == b:
        print(x)
        break
    x += 1
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
A, B = list(map(int, input().split()))
ans = -1
low = math.floor(min(A//0.08, B//0.1))
hig = math.ceil(max((A+1)//0.08, (B+1)//0.1))
for i in range(low, hig):
   a = math.floor(i * 0.08)
   b = math.floor(i * 0.1)
   if A == a and B == b:
     ans = i
     break
print(ans)

Submission status: Accepted

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

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


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

ans = -1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil, floor

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

Submission status: Accepted

Solution code:
import math


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

ans = -1

for i in range(0, 1251):
    tax_a = int(i * 0.08)
    tax_b = int(i * 0.1)

    if tax_a == a and tax_b == b:
        ans = i
        break

print(ans)

Submission status: Accepted

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

astart, aend = int(a//0.08+1), int((a+1)//0.08) #[astart, aend)
bstart, bend = int(b//0.10+1), int((b+1)//0.10)

alst = set(range(astart,aend))
blst = set(range(bstart,bend))
share = alst & blst

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
cnt = 0
for i in range(1101):
    if (i*8)//100 == a and(i*10)//100 == b:
        print(i)
        break
    else:
        cnt += 1
        if cnt == 1101:
            print(-1)
            break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
x1 = math.ceil(A / 0.08)
x2 = (A+1) / 0.08
y1 = math.ceil(B / 0.10)
y2 = (B+1) / 0.10

while x1 < x2:
    if y1 <= x1 < y2:
        print(x1)
        exit(0)
    x1 += 1
print(-1)

Submission status: Accepted

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

	flg = False
	for x in range(1,1001):
		tmp1 = math.floor(x * 0.08)
		tmp2 = math.floor(x * 0.1)
		if tmp1 == a and tmp2 == b:
			print(x)
			flg = True
			break
	if flg == False:
		print("-1")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
hachi = []
ju = []
kane = -1

for i in range(1250):
    if (i*8)//100 == a:
        hachi.append(i)
    if i//10 == b:
        ju.append(i)

for j in range(1250):
    if (1250-j in hachi)and(1250-j in ju):
        kane = 1250-j

print(kane)

Submission status: Accepted

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

ans = '-1'
for i in range(1,10**5):
    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())

A=[]
B=[]

for x in range(1,20001):
  if (x*8)//100==a:
    A.append(x)
  if (x*10)//100==b:
    B.append(x)
    
c=set(A)&set(B)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8
import math

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

Submission status: Accepted

Solution code:
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()
import math

def resolve():
    import sys
    input = sys.stdin.readline
    a, b = [int(x) for x in input().rstrip().split(" ")]

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



if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
cand = range(b*10, b*10+10)
out = -1
for el in cand:
    if math.floor(el * 0.08) == a:
        out = el
        break
    else:
        continue
print(out)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    A,B = map(int,input().split())
    for i in range(1,1251):
        A_tmp,B_tmp = int(i*0.08),int(i*0.10)
        if A is A_tmp and B is B_tmp:
            print(i)
            exit()
    print(-1)

Submission status: Accepted

Solution code:
from math import floor
from math import ceil
a,b = map(int,input().split())
n = floor(a / 0.08)
m = floor(b / 0.1)
n2 = ceil(a / 0.08)
m2 = ceil(b / 0.1)
p = floor(n * 0.08)
q = floor(n * 0.1)
p2 = floor(n2 * 0.08)
q2 = floor(n2 * 0.1)
x = floor(m * 0.08)
y = floor(m * 0.1)
x2 = floor(m2 * 0.08)
y2 = floor(m2 * 0.1)
if p == a and q == b and x == a and y == b:
    print(min(n,m))
elif p == a and q == b:
    print(n)
elif x == a and y == b:
    print(m)
elif p2 == a and q2 == b and x2 == a and y2 == b:
    print(min(n2,m2))
elif p2 == a and q2 == b:
    print(n2)
elif x2 == a and y2 == b:
    print(m2)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
flag = False
for i in range(1300):
  if i * 8 // 100 == a and i * 10 // 100 == b:
    flag = True
    break
if flag:
  print(i)
else:
  print(-1)

Submission status: Accepted

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

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
else:
    print('-1')

Submission status: Accepted

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

cnt = 0

for i in range(1,1010):
    A = int(i * 8 //100)
    B = int(i * 10 //100)
    if (A == a) and (B == b):
        print(i)
        cnt += 1
        break

if cnt == 0:
    print(-1)

Submission status: Accepted

Solution code:
import math

A, B = list(map(lambda x : int(x), input().split(" ")))

minPA = A * 12.5
maxPA = (A + 1) * 12.5
minPB = B * 10
maxPB = (B + 1) * 10

if max([maxPA, maxPB]) - min([minPA, minPB]) >= 22.5:
  print(-1)
else:
  m = max([minPA, minPB])
  M = min([maxPA, maxPB])
  if M - m >= M - int(M):
    print(math.ceil(m))
  else:
    print(-1)

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
 
for i in range(10 ** 5):
  if int(i * 0.08) == A and int(i * 0.1) == B:
    print(i)
    sys.exit()
  else:
    continue
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

#0.10%を基準にする
k_min = B * 10
k_max = (B+1) * 10

ans = -1
for k in range(k_min, k_max):
    if k * 8 // 100 == A:
        ans = k
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

for i in range(1,10000):
    ans8 = int(math.floor(i*0.08))
    ans10 = int(math.floor(i*0.1))
#     print(ans8,ans10)
    if ans8 == a and ans10 == b:
        ans = min(ans, i)
        flag = True

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

Submission status: Accepted

Solution code:
import math

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

ma = int(a//0.08)
mb = int(b//0.1)


fmindi = False
mindi = 9999999999999

for x in range(min(ma,mb),max(ma,mb)+2):
    j = math.floor(x*0.08)
    e = math.floor(x*0.1)
    if j == a and e == b:
        fmindi = True
        mindi = min(mindi,x)

print(mindi if fmindi else -1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
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:
A, B = map(int,input().split())
mi = 10 * B - 1
x = 0
ma = 15 * B + 1


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

Submission status: Accepted

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

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

print(ans if ans <1100 else -1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for i in range(1011):
    if i // 12.5 == a and i // 10 == b:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for i in range(1011):
    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())
r = -1
for i in range(1, 1111):
    if A == math.floor(i*0.08) and B == math.floor(i*0.10):
        r = i
        break

print(r)

Submission status: Accepted

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

ans_A = 0
ans_B = 0
for i in range(1500):
  ans_A = (i*8//100)
  ans_B = (i//10)
  if(ans_A==A)and(ans_B==B):
    print(i)
    sys.exit()
print(-1)

Submission status: Accepted

Solution code:
def solve():
    import math
    A,B = [int(i) for i in input().split()]
    A_orig = math.ceil(A/0.08)
    A_orig_next = math.ceil((A+1)/0.08)
    B_orig = math.ceil(B/0.1)
    B_orig_next = math.ceil((B+1)/0.1)
    ans = -1
    for i in range(A_orig, A_orig_next):
        if B_orig <= i < B_orig_next:
            ans = i
            break
    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys


def resolve(in_):
    A, B = map(int, in_.readline().split())

    for i in range(1, 1251):
        if i * 8 // 100 == A and i // 10 == B:
            return i 

    return -1


def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
# たかだか1250円
for i in range(1300):
    a = (i * 8) // 100
    b = i //10
    if A == a and B == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b = inintm()

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

print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

for n in range(10000):
  if int(0.08*n)==A and int(0.10*n)==B:
    print(n)
    exit()

print(-1)

Submission status: Accepted

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

for i in range(1,1000001):
  aans=0.08*i
  bans=0.10*i
  if int(aans)==a and int(bans)==b:
    print(i)
    exit()

print("-1")

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
A1=int((a//0.08)//1)
A2=int((a+2//0.08)//1)
B1=b*10
B2=(b+2)*10
s=min(A1,A2,B1,B2)
t=max(A1,A2,B1,B2)
ans=-1
for i in range(s,t+1):
    if i*0.08//1==a and i*0.1//1==b:
        ans=i
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def check( a,b ):
  g=math.ceil(a*100/8)
  
  for i in range(100):
      if b==int((g+i)*10/100):
          break
  
  if a!=int((g+i)*8/100):
      ans = "-1"
  else:
      ans = g+i
  return ans


a,b = map(int,input().split())
ans = check(a,b)
print(ans)

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)
        exit()
print('-1')

Submission status: Accepted

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

for i in range(1,1001):
    x1 = math.floor(i*0.08)
    x2 = math.floor(i*0.10)
    if x1 == a and x2 == b:
        print(i)
        flg = 0
        break
    else:
        pass
    
if flg:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
ans=max(math.ceil(a/0.08),b*10)
au=math.ceil((a+1)/0.08)
bu=(b+1)*10
print(ans if ans < au and ans < bu else -1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

ans = 0

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

if ans == 0:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = list(map(int, input().split()))
for i in range(1, 1250):
    p8 = math.floor(i * 0.08)
    p10 = math.floor(i * 0.10)
    if p8 == a and p10 == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
x0 = math.ceil(a * 100 / 8)
x1 = math.ceil((a + 1) * 100 / 8)
y0 = b * 10
y1 = (b + 1) * 10
if y1 <= x0 or x1 <= y0:
    print(-1)
else:
    print(max(x0, y0))

Submission status: Accepted

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

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

print(-1)

Submission status: Accepted

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