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:
a, b = map(int, input().split())

pa = int(a * 100/8)
pb = int(b * 100/10)

ans1 = None
ans2 = None

for price in range(pb-1, pa+2):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans1 = price
        break

for price in range(pa-1, pb+2):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans2 = price
        break

if ans1 is None and ans2 is None:
    print(-1)
elif ans2 is None:
    print(ans1)
elif ans1 is None:
    print(ans2)
else:
    print(min(ans1,ans2))

Submission status: Accepted

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

f= False

for i in range(1011):
  t1 = math.floor(i*0.08)
  t2 = math.floor(i*0.1)
  if t1 == a and t2 == b:
    ans = i
    f = True
    break

if f:
  print(ans)
else:
  print(-1)

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math

A,B = [int(x) for x in stdin.readline().rstrip().split()]
N1=int(A*100/8)
N2=int(B*10)
for i in range(B*20):
    N1=math.floor(i*0.08)
    if N1==A:
        N2=math.floor(i*0.1)
        if N2==B:
              print(i)
              sys.exit(0)
print(-1)

Submission status: Accepted

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

ans = -1

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import math
a,b = map(int,input().split())
kou = []
ans = 0
for i in range(10):
    kou.append(b*10 + i)
for i in range(10):
    if (kou[i] * 8)//100 == a:
        print(kou[i])
        ans = 1
        break

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x == A) and (y == B)

answer = -1
for n in range(20000):
    if test(n):
        answer = n
        break
print(answer)

Submission status: Accepted

Solution code:
import sys, math
A,B=map(int,input().split())
C=math.ceil(A/0.08)
D=math.ceil(B/0.1)

Clis=[]
Dlis=[]

for i in range(C-13,C+14):
  if math.floor(i*0.08)==A:
    Clis.append(i)

for j in range(D-10,D+11):
  if math.floor(j*0.1)==B:
    Dlis.append(j)

for k in Clis:
  if k in Dlis:
    print(k)
    sys.exit()
print(-1)

Submission status: Accepted

Solution code:
tax_8, tax_10 = map(int, input().split())

k = int(tax_8 / 0.08)
kk = int((tax_8+1) / 0.08)
kkk = int(tax_10 / 0.1)
kkkk = int((tax_10+1) / 0.1)

for i in range(min(k, kkk), max(kk, kkkk)):
    if int(i * 0.08) is tax_8 and int(i * 0.1) is tax_10:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

r = -1
for p in range(max(x1,x2), min(y1,y2)):
    r = p
    break
print(r)

Submission status: Accepted

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

res1 = int(a // 0.08)
res11 = int((a + 1) // 0.08)
res2 = int(b // 0.1)
res21 = int((b + 1) // 0.1)
ans = -1

#print(res1)
#print(res11)
#print(res2)
#print(res21)

ran1 = max(res1, res2)
ran2 = min(res11, res21)
for i in range(ran1-1, ran2):
    ans1 = int(i * 0.08)
    ans2 = int(i * 0.1)
    if ans1 == a and ans2 == b:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math


def resolve():
    a, b = map(int, input().split())

    for i in range(10000):
        t8 = math.floor(i * 0.08)
        t10 = math.floor(i * 0.1)

        if t8 == a and t10 == b:
            print(i)
            return

    print(-1)
    
resolve()

Submission status: Accepted

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

def isOK(num):
    tax8 = num * 8 // 100
    tax10 = num * 10 // 100
    if tax8 == A and tax10 == B:
        return True
    else:
        return False

for i in range(1, 100001):
    if isOK(i):
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

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

for i in range(1, 2000):
  if(math.floor(i*0.08) == A and math.floor(i*0.10) == B and flag == True):
    print(i)
    flag=False

if(flag==True):
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
for num in range(1,10000):
    ai = num//(100/8)
    bi = num//(100/10)
    if (ai>100) or (bi>100):
        pass
    if (a==int(ai)) and (b==int(bi)):
        print(num)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
import math
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b = IL()

ans = 1
while ans < 10000:
  if int(ans*0.08) == a and int(ans*0.10) == b:
    print(ans)
    exit()
  ans += 1
print(-1)

Submission status: Accepted

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

min_a = int(a//0.08+1)
max_a = (a+1)//0.08
min_b = int(b//0.1+1)
max_b =  (b+1)//0.1

if min_a < min_b:
    if max_a >= min_b:
        print(min_b)
    else:
        print(-1)
else:
    if max_b >= min_a:
        print(min_a)
    else:
        print(-1)

Submission status: Accepted

Solution code:
import math
a, b = [int(i) for i in input().split()]
# int(0.08x)=a
# int(0.1x) = b
first = [math.ceil(12.5*a), math.floor(12.5*a+12.5)]
second = [10*b, 10*b+9]
if second[0] < first[1] and first[0] < second[1]:
    print(max(second[0], first[0]))
else:
    print(-1)

Submission status: Accepted

Solution code:
from math import ceil, floor
A, B = map(int, input().split())
A_min = ceil(A*(100/8))
A_max = floor((A+1)*(100/8)) if A%2!=1 else (A+1)*(100/8)-1
B_min = ceil(B*10)
B_max = floor(((B+1)*10))-1
if A_min>B_max or A_max<B_min:
  print(-1)
elif A_min>=B_min:
  print(A_min)
elif B_min>=A_min:
  print(B_min)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if (a / 0.08) == int(a / 0.08):
    a1 = a / 0.08
else:
    a1 = int(a / 0.08) + 1
if ((a + 1) / 0.08) == int((a + 1) / 0.08):
    a2 = ((a + 1) / 0.08) - 1
else:
    a2 = int((a + 1) / 0.08)
if (b / 0.1) == int(b / 0.1):
    b1 = b / 0.1
else:
    b1 = int(b / 0.1) + 1
if ((b + 1) / 0.1) == int((b + 1) / 0.1):
    b2 = ((b + 1) / 0.1) - 1
else:
    b2 = int((b + 1) / 0.1)
if a1 == a2:
    ans = a1
    if b1 <= ans <= b2:
        ans = a1
    else:
        ans = -1
elif a1 > b2 or b1 > a2:
    ans = -1
elif a1 >= b1:
    ans = a1
else:
    ans = b1
print(int(ans))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a, b = tuple([int(s) for s in input().split()])
    tr, cr = 0.08, 0.1

    tr_a = int(a / tr)
    tr_b = int(b / cr)

    i = min([tr_a, tr_b])
    while i <= max([tr_a, tr_b]):
        if int(i * tr) == a and int(i * cr) == b:
            break
        else:
            i += 1

    if int(i * tr) == a and int(i * cr) == b:
        print(i)
    else:
        print(-1)

Submission status: Accepted

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

x = 1
while int(x * 0.08) <= a or int(x * 0.1) <= b:
    if int(x*0.08) == a and int(x * 0.1) == b:
        print(x)
        exit()
    x += 1
print(-1)

Submission status: Accepted

Solution code:



def m():
	a, b=map(int, input().split())
	x=10*b
	
	for i in range(10):
		y=int((x+i)*0.08)
		if y==a:
			print(x+i)
			return
	
	print('-1')
	return
	
m()

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

A, B = read_int()

ra = 0.08
rb = 0.1
def solve():
    ans = -1
    aM = int((A + 1) // ra)
    am = int(A / ra)
    bM = int((B + 1) // rb)
    bm = int(B / rb)

    lb = min(am, bm)
    ub = max(aM, bM)
    for n in range(ub, lb - 1, -1):
        # print(n, int(math.floor(n * ra)), int(math.floor(n * rb)))
        if int(math.floor(n * ra)) == A and int(math.floor(n * rb)) == B:
            ans = n
    return ans

if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

_a = int(a / 0.08)
_b = int(b / 0.1)

m = min(_a, _b)

ans = -1

while m < 1010:
    if int(m * 0.08) == a and int(m * 0.1) == b:
        ans = m
        break
    m += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

    ans = -1
    for i in range(10000, 0, -1):
        if i//12.5 == a and i//10 == b:
            ans = i

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

a_cand = list(range(math.ceil(a * 100 / 8), (a+1)* 100 // 8))
b_cand = list(range(math.ceil(b * 100 /10), (b+1)* 100 // 10))

if min(a_cand) > max(b_cand) or min(b_cand) > max(a_cand):
    print(-1)
else:
    print(max(min(a_cand),min(b_cand)))

Submission status: Accepted

Solution code:
import numpy as np
A, B = map(int, input().split())

x_A_max = (A+1)/0.08
x_A_min = np.ceil(A/0.08)

x_B_max = (B+1)/0.1
x_B_min = np.ceil(B/0.1)

if (x_A_max<=x_B_min)or(x_A_min>=x_B_max):
    print(-1)
elif x_A_min<x_B_min:
    print(int(x_B_min))
else:
    print(int(x_A_min))

Submission status: Accepted

Solution code:
import math

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


ans = -1

for i in range(1, 1251):
    
    a = int(math.floor(i * 0.08))
    b = int(math.floor(i * 0.1))

    if (a == A and b == B):
        ans = i
        break

print(ans)

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

def read():
    A, B = list(map(int, input().strip().split()))
    return A, B

def solve(A, B, INF= 100000000):
    min_v = INF
    for i in range(1, 1000000):
        a = math.floor(i * 0.08)
        b = math.floor(i * 0.10)
        if a == A and b == B:
            return i
    return -1


if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
AB = input().split()

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

## x * 0.08 = A
## x * 0.1 = B

if A % 0.08 > 0:
  AA = A//0.08 + 1
else:
  AA = A//0.08
if B % 0.1 > 0:
  BB = B//0.1 + 1
else:
  BB = B//0.1
  
if AA > BB:
  solution = int(AA)
else:
  solution = int(BB)
  
if int(solution * 0.08) != A or int(solution * 0.1) != B:
  print(-1)
else:
  print(solution)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

def main():
    A,B = map(int, readline().decode('utf-8').split())
    eight_start = int(-(-A//0.08))
    eight_end = int(-(-(A+1)//0.08))
    for i in range(eight_start,eight_end):
        ten = int(i * 0.1)
        if ten == B:
            print(i)
            break
    else:
        print('-1')

    return
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if A%2==0:
    set1={i for i in range((25*A)//2,(25*A+25)//2+1)}
    set2={i for i in range(10*B,10*B+10)}
    ans=set1.intersection(set2)
    if len(ans)>0:
        print(min(ans))
    else:
        print(-1)
else:
    set1={i for i in range((25*A)//2+1,(25*A+25)//2)}
    set2={i for i in range(10*B,10*B+10)}
    ans=set1.intersection(set2)
    if len(ans)>0:
        print(min(ans))
    else:
        print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for i in range(10000):
    if A==  i//12.5 and B == i//10:
        print(i)
        break
else:
    print('-1')

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
x = math.ceil(A*12.5)
ans = -1
while(x < B*10+10):
    if((math.floor(x*0.08) == A) & (math.floor(x*0.1)==B)):
        ans = x
        break
    x+=1
print(ans)

Submission status: Accepted

Solution code:
import math
a, b= map(int, input().split())
for n in range(1, 20000):
  if math.floor(n*0.08) == a and math.floor(n*0.1) == b:
    break
    
if n != 19999:
  print(n)
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())
import math
num = -1

for i in range(100000):
    if a == math.floor(i*0.08):
        if b == math.floor(i*0.1):
            num = i
            break
print(int(num))

Submission status: Accepted

Solution code:
from math import floor, ceil

def main():
  a, b = list(map(int, input().split()))
  a_min = ceil(a*12.5)
  a_max = (a+1)*12.5
  b_min = ceil(b*10)
  b_max = (b+1)*10
  
  if(b_min <= a_min and a_min<b_max):
    print(a_min)
    return
  if(a_min <= b_min and b_min<a_max):
    print(b_min)
    return
  print(-1)
  return

main()

Submission status: Accepted

Solution code:
S = [int(x) for x in input().split()]
A = S[0]
B = S[1]
ans = -1

for i in range(1000):
    num = (i+1)
    MotoA = int(num * 0.08)
    MotoB = int(num * 0.1)
    if MotoA == A and MotoB ==B:
        ans = num
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

#処理
c=0
d=0
c=max([math.floor(A/0.08),math.floor(B/0.1)])
d=min([math.ceil((A+1)/0.08),math.ceil((B+1)/0.1)])
z=-1
for i in range(c,d+1):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        z=i
        break
print(z)

Submission status: Accepted

Solution code:
def main():
  import sys
  import math
  input = sys.stdin.readline
  a,b=map(int,input().split())
  if b>=10:
    for i in range(b*10,b*10+10):
      if a==math.floor(i*0.08):
        print(i)
        exit()
    print(-1)
  else:
    for i in range(b*10,b*10+10):
      if a==math.floor(i*0.08):
        print(i)
        exit()
    print(-1)
if __name__=='__main__':
  main()

Submission status: Accepted

Solution code:
from sys import stdin
import math
A,B = [int(x) for x in stdin.readline().rstrip().split()]
f = False
for i in range(1,100000):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        print(i)
        f = True
        break
if not f:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = list(map(int, input().split()))
ans = -1
for i in range(1100):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
        ans = i
        break

print(ans)

Submission status: Accepted

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

A_max = int((A+1)/0.08)-1

  
  
if int(B/0.1) == (B/0.1):
  B_min = int(B/0.1)
else:
  B_min = int(B/0.1)+1

B_max = int((B+1)/0.1)-1

if (A_max < B_min) or (B_max < A_min):
  print(-1)
elif A_min >= B_min:
  print(A_min)
else:
  print(B_min)

Submission status: Accepted

Solution code:
a, b  = [int(x) for x in input().split()]
ra = int(b / 10 * 100)
for n in range(ra, ra + 100):
    if int(n * 0.08) == a and int(n * 0.1) ==  b:
        print(n)
        exit()
print(-1)

Submission status: Accepted

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

mina = math.ceil(A/0.08)
if math.floor((A+1)/0.08) == (A+1)/0.08:
  maxa = (A+1)/0.08 -1
else:
  maxa = math.floor((A+1)/0.08)
minb = math.ceil(B/0.1)
if math.floor((B+1)/0.1) == (B+1)/0.1:
  maxb = (B+1)/0.1 -1
else:
  maxb = math.floor((B+1)/0.1)

if maxa < minb or maxb < mina:
  print(-1)
else:
  print(max(mina,minb))

Submission status: Accepted

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

ans=-1
for i in range(b_min,b_min+10):
    if int(i*0.08)==a:
        ans=i
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

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

a_min = math.ceil(a*12.5)
a_max = math.ceil((a+1)*12.5)
b_min = math.ceil(b*10)
b_max = math.ceil((b+1)*10)

ab_and = set(range(a_min, a_max)) & set(range(b_min, b_max))

if not ab_and:
    print(-1)
    sys.exit()

ab_and_sort = sorted(list(ab_and))

print(ab_and_sort[0])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

# resultの初期値を最低値にセット
resultTmp = B * 10
result = 0
isHit = False
isFirstHit = True
while resultTmp < B * 10 + 10:
    if math.floor(resultTmp * 0.08) == A and math.floor(resultTmp * 0.1) == B:
        isHit = True
        if isFirstHit:
            result = resultTmp
            isFirstHit = False
    resultTmp += 1

if isHit:
    print(result)
else:
    print(-1)

Submission status: Accepted

Solution code:
import numpy as np
import math

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

answer = -1
for i in range(1000, 1, -1):
    check1 = math.floor(i * 0.08)
    check2 = math.floor(i * 0.1)
    if ((check1 == A) & (check2 == B)):
        answer = i
print(answer)

Submission status: Accepted

Solution code:
import math

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

for i in range(1100):
  x = i+1
  if math.floor(x*1.08) == A + x and math.floor(x*1.1) == B + x:
    print(x)
    break
  if x == 1100:
    print(-1)

Submission status: Accepted

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

x_min_A = A / 0.08
x_Max_A = (A + 1) / 0.08
x_min_B = B / 0.10
x_Max_B = (B + 1) / 0.10

x_min = max(x_min_A, x_min_B)
x_Max = min(x_Max_A, x_Max_B)

x = math.ceil(x_min)
if x < x_Max:
  print(x)
else:
  print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

for i in range(1 ,1001):
    aa = int(i * 0.08)
    bb = int(i * 0.1)
    if a == aa and b == bb:
        print(i)
        sys.exit()

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
List = [int(i) for i in input().split()]
zei8min = List[0] * 25 / 2
zei8max = (List[0] + 1) * 25 / 2
for i in range(math.ceil(zei8min),math.floor(zei8max)):
    if math.floor(i * 0.1) == List[1]:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

ans = -1
for i in range(10, 10**3+1):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

def main():
    A,B = map(int,input().split())
    for x in range(3000):
        if math.floor(x*0.08) == A and math.floor(x*0.1) == B:
            print(x)
            exit()

    print(-1)



if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
import math
if 10*(b+1) <= 12.5*a or 12.5*(a+1) <= 10*b:
  print(-1)
else:
  print(max(math.ceil(12.5*a), 10*b))

Submission status: Accepted

Solution code:
from collections import deque
import sys
input = sys.stdin.readline
import bisect as bi
from operator import mul
from functools import reduce
import math

def fast_comb(a,b,mod):
    up = reduce(lambda x,y: x*y%mod, range(a,a-b,-1))
    down = reduce(lambda x,y: x*y%mod, range(1,b+1))
    return (up * pow(down, mod-2, mod)) % mod

def prime(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]:
            continue
        for j in range(i*2, n+1, i):
            is_prime[j] = False
    return is_prime

def readlines(n):
    for _ in range(n):
        map(int, input().split())
        yield

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

    for i in range(20000):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)

        if (a, b) == (a_, b_):
            print(i)
            return

    print(-1)





main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
i=0
while(True):
    xa=int(i*0.08)
    xb=int(i*0.10)
    if(xa==a and xb==b):
        print(i)
        break
    elif(xa>a and xb>b):
        print(-1)
        break
    else:
        i+=1

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
Ax = A * 25
if Ax & 1:
    Ax += 1
Ay = (A + 1) * 25
if Ay & 1:
    Ay += 1
Ax //= 2
Ay //= 2
Bx = B * 10
By = (B + 1) * 10

if Ay <= Bx or By <= Ax:
    print(-1)
else:
    ans = max(Bx, Ax)
    print(ans)

Submission status: Accepted

Solution code:
#def main(S, b):

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

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

    print(ans)

Submission status: Accepted

Solution code:
import math

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

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


print(cnt)

Submission status: Accepted

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

ans=-1
for k in range(10**4):
    hati=k*8//100
    ju=k//10
    if(hati==a and ju==b):
        ans=k
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a, b = map(int, input().split())
    ans = 0
    alist = []
    blist=[]
    for i in range(1300):
        tax = int(i * 1.08 - i)
        if int(tax) == a:
            alist.append(i)


    for i in range(1100):
        tax = int(i * 1.1 - i)
        if int(tax) == b:
            blist.append(i)

    ablist = set(alist) & set(blist)
    ablist = list(ablist)

    if len(ablist) == 0:
        print(-1)
    else:
        ablist.sort()

        print(ablist[0])

Submission status: Accepted

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

Submission status: Accepted

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

x = [int(A // 0.08), int(B // 0.1), math.ceil((A+1) // 0.08), int(math.ceil((B+1) // 0.1))]
for i in range(min(x), max(x)+1, 1):
    if int(i * 0.08)  ==  A and B ==  int(i* 0.1):
        print(i)
        break
    if i == max(x):
        print(-1)

Submission status: Accepted

Solution code:
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = map(int, sys.stdin.readline().split())

    ret = -1
    for a in range(1, 1250):
        tmpA = math.floor(a * 0.08)
        tmpB = math.floor(a * 0.1)
        if (tmpA == A and tmpB == B):
            ret = a
            break

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for i in range(1, 10 ** 5):
    if a <= 0.08 *i < (a+1) and b <= 0.10 * i < b+1:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
def inputs(): return [int(x) for x in input().split()]
a,b = inputs()
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:
# -*- coding: utf-8 -*-

import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

a, b = MAP()

for x in range(100000):
    if int(x * 1.08) == x + a and int(x * 1.1) == x + b:
        print(x)
        exit()
print(-1)

Submission status: Accepted

Solution code:
#n = int(input())
a, b = [int(x) for x in input().split()]
#n, m = [int(x) for x in input().split()]

for i in range(int(101/0.08)+1):
  i+=1
  if int(i*(0.08)) == a and int(i*(0.10)) == b:
    print(i)
    quit()

print(-1)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
al=A*12.5
ar=(A+0.99)*12.5
bl=B*10
br=(B+0.9)*10
if bl>ar or br<al:
  print(-1)
elif al<bl:
  print(math.ceil(bl))
elif bl<=al:
  print(math.ceil(al))

Submission status: Accepted

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

for i in range(B * 10, B * 15):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        ans = i
        break
print(ans)

Submission status: Accepted

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

def floor(x, f):
    res = int(x / f)
    if int(res * f) < x:
        res += 1
    return res

ra = [floor(A, 0.08), floor(A + 1, 0.08)]
rb = [floor(B, 0.1), floor(B + 1, 0.1)]

if ra[1] <= rb[0] or rb[1] <= ra[0]:
    print(-1)
else:
    print(max(ra[0], rb[0]))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
for i in range(2*10**3):
    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())
ans = -1
for i in range(1, 1100):
    if i * 0.08 // 1 == a and i * 0.1 // 1 == b:
        ans = i
        break
print(ans)