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

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

    print(-1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
import sys
 
nums = list(map(int, input().split()))
a = nums[0]
b = nums[1]
 
for i in range(1200):
  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:
import math
 
A, B = list(map(int, input().split()))
x_minA = math.ceil(100 / 8 * A)
x_minB =  10 * B
x_maxA = math.floor(100 / 8 * (A+1))
x_maxB = 10 * (B+1)
if x_minA > x_maxB or x_minB > x_maxA:
  print(-1)
else:
  for x in range(max(x_minA, x_minB), min(x_maxA, x_maxB)+1):
    if int(x * 8 / 100) == A and int(x / 10)==B:
      print(x)
      break
  else:
    print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import floor
from sys import exit

A, B = map(int, input().split())
for N in range(1200):
    if floor(N * 0.08) == A and floor(N * 0.1) == B:
        print(N)
        exit()
print(-1)

Submission status: Accepted

Solution code:
#coding:utf-8
import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    A,B = LMIIS()
    #A:1.08 B:1.1
    from math import ceil,floor
    # print(A/0.08,B/0.1)
    # print(ceil(A/0.08),ceil(B/0.1))
    
    A_min = ceil(A/0.08)
    A_max = ceil((A+1)/0.08)-1
    B_min = ceil(B/0.1)
    B_max = ceil((B+1)/0.1)-1
    # print(A_min,A_max,B_min,B_max)
    if A_max < B_min or B_max < A_min:
        print(-1)
    else:
        print(max(A_min,B_min))
    
    # print(A_min,A_max,B_min,B_max)
    # for i in range(1,100000):
    #     if floor(i *0.08) == A and floor(i *0.1) == B:
    #         print(i)
    #         return
    # print(-1)

    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

import collections
import math


class Solution:
    def solve(self, A, B):
        for i in range(10**4):
            aTax, bTax = math.floor(i*0.08), math.floor(i * 0.1)

            if aTax == A and bTax == B:
                return i

        return -1


sol = Solution()

[A, B] = list(map(int, input().strip().split()))
print(sol.solve(A, B))

Submission status: Accepted

Solution code:
import math

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

for n in range(0, 10):
  for m in range(0, 10):
    x = math.floor((A + n/10) / 0.08 + 0.5)
    y = math.floor((B + m/10) / 0.1 + 0.5)
    if x == y:
      if math.floor(x * 0.08) == A and math.floor(y * 0.1):
        print(x)
        exit()
print("-1")

Submission status: Accepted

Solution code:
# coding: utf-8

a, b = map(int, input().split())
# print(a,b)
# x=-1
# y=-1

# xr=[]
# yr=[]
# for i in range(1,101):
#     if i*0.08//1==a:
#         # print("x:{}".format(i))
#         x=i
#         xr.append(x)
# for i in range(1,101):
#     if i *0.1//1==b:
#         # print("y:{}".format(i))
#         y=i
#         yr.append(y)
# flag=False
#
# result=[]
# for i in xr:
#     for j in yr:
#         if i==j:
#             result.append(i)
#
# if len(result)>0:
#     print(result[0])
# else:
#     print('-1')
flag =False
for i in range(1,1010):
    if i*0.08//1==a and i*0.1//1==b:
        print(i)
        flag=True
        break

if not flag:
    print(-1)

Submission status: Accepted

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

ans = -1
for yen in range(10000):
    a = int(yen * (8/100))
    b = int(yen * (10/100))
    if A == a and B == b:
        ans = yen
        break

print(ans)

Submission status: Accepted

Solution code:
import math
def main():
    a, b = map(int, input().split())
    ra = [math.ceil(i/0.08) for i in range(1, 102)]
    rb = [math.ceil(i/0.1) for i in range(1, 102)]
    x = ra[a-1] 
    while x < ra[a] :
        if int(x*0.1) == b:
            return x
        x+=1
    return -1



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

Submission status: Accepted

Solution code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    A, B = MI()
    for i in range(1009):
        if int(i*0.08) == A and int(i*0.1) == B: print(i); sys.exit()
    print(-1)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    A,B = map(int,input().split())
    ans = -1
    for num in range(10001,0,-1):
        a = int(num * 0.08)
        b = int(num * 0.10)
        if A==a and B==b:
            ans = num
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

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

    ans = -1
    flag = True

    for i in range(1,1010):
        if(math.floor(i*0.08) == A and math.floor(i*0.1) == B):
            ans = i
            flag = False
            break
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

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

flag = False
res = 1

while res < 1010:
    res_a = int(res * 0.08)
    res_b = int(res * 0.10)
    if res_a == A and res_b == B:
        flag = True
        break
    res += 1

if flag:
    print(res)
else:
    print(-1)

Submission status: Accepted

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

for i in range(10000):
    if i*8//100==a and i*10//100==b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
import math

def main():
    A,B = list(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)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b = (int(x) for x in input().split())


my_index = []
for i in range(1010):
    if int((i*0.08)) ==a and int((i*0.1))==b:
        my_index.append(i)
    if int((i*0.08)) ==b and int((i*0.1))==a:
        my_index.append(i)

if my_index != []:
    print(min(my_index))
else:
    print(-1)

Submission status: Accepted

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

    for x in range(1, 1010):
        if int(x * 0.08) == A and int(x * 0.1) == B:
            print(x)
            return

    print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

a = input1[0]
b = input1[1]

a1 = math.ceil(a / 0.08)
a2 = math.ceil((a+1) / 0.08)
b1 = math.ceil(b / 0.1)
b2 = math.ceil((b+1) / 0.1)
# alist = list(range(a1, a2))
# blist = list(range(b1, b2))

# print(alist)
# print(blist)
for i in range(a1, a2):
    for j in range(b1, b2):
        if i == j:
            print(i)
            # print(i * 0.08)
            # print(i * 0.1)
            exit(0)
print(-1)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
 
max_val = int(math.ceil(A / 0.07))
min_val = int(math.floor(B / 0.11))
 
for i in range(min_val, max_val + 1):
    if int(i * 0.08) > A or int(i * 0.1) > B:
        break
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit(0)
print(-1)

Submission status: Accepted

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

for n in range(1, 1001):
    if n // (1/0.08) == A and n // (1/0.1) == B:
        ans = n
        break

print(ans)

Submission status: Accepted

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

for i in range(1,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 = list(map(int, input().split()))

for x in range(1, 1000+1):
  if int(x * 0.08) == a and int(x * 0.1) == b:
    print(x)
    exit()
else:
  print('-1')

Submission status: Accepted

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

for i in range(1,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())
for i in range(1, 10000):
    if int(0.08*i) == A and int(0.1*i) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c = 1
while(True):
    if(int(c*0.08)==a and int(c*0.1)==b):
        print(c)
        exit()
    c+=1
    if(c==100000):
        print(-1)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#C
import math
A, B = list(map(int, input().split()))
ans1min = A/0.08
ans1max = (A+1)/0.08
ans2min = B/0.1
ans2max = (B+1)/0.1

#print(ans1min)
#print(ans2min)
if ans1min >= ans2min and ans1min < ans2max:
    print(math.ceil(ans1min))
elif ans1min <= ans2min and ans2min < ans1max:
    print(math.ceil(ans2min))
else:
    print('-1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math as mt
K = input().split(" ")
A = int(K[0])
B = int(K[1])
a = float(A*12.5)
t = float((A+1)*12.5)
t1 = mt.ceil(t)
b = B*10
a1 = mt.ceil(a)
A_data = []
B_data = []
for i in range(b,b+10):
    A_data.append(i)
for i in range(a1,t1):
    B_data.append(i)
A_set = set(A_data)
B_set = set(B_data)
AB_set = A_set & B_set
if AB_set:
    P = min(AB_set)
    print(P)
else:
    print(-1)

Submission status: Accepted

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

x = b * 10

for i in range(x, x+10):
   ta = (i * 0.08 * 10) // 10
   tb = (i * 0.10 * 10) // 10
   if ta == a and tb == b:
      print(i)
      exit()

print(-1)

Submission status: Accepted

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

mymax = int(100/0.1)
#print(mymax)
A, B = map(int,input().split())

for i in range(mymax + 1):
    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 = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

1, 2 and 3

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
a1=(a*100)//8
a2=((a+1)*100)//8
b1=b*10
b2=(b+1)*10
if (a*100)%8>0:
    a1+=1
if ((a+1)*100)%8>0:
    a2+=1
la=range(a1,a2)
lb=range(b1,b2)
l=list(set(la) & set(lb))
if len(l)==0:
    print("-1")
else:
   l.sort()
   print(l[0])

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
min = 13
max = 1000
result = -1
for i in range(min, max +1):
  if int(i*0.08) == a and int(i*0.1) == b:
    result = i
    break
print(result)

Submission status: Accepted

Solution code:
A_B = list(map(int, input().split()))
A = A_B[0]
B = A_B[1]

count = 1
while count * 0.08 // 1 != A or count * 0.1 // 1 != B:
    count += 1
    if count * 0.1 - 10 > B:
        print(-1)
        exit()
print(count)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
a_max = ( a + 1) // 0.08
b_max = ( b + 1) // 0.1
max = int(a_max) if a_max > b_max else int(b_max)
flg = 0
for i in range(1, max):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        flg = 1
        print(i)
        break

if flg == 0:
    print(-1)

Submission status: Accepted

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

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

temp_a1 = 100 * a // 8
temp_a2 = 100 * (a + 1) // 8
temp_b1 = 10 * b
temp_b2 = 10 * (b + 1)

result = -1
for i in range(min(int(temp_a1), int(temp_b1)), min(int(temp_a2), int(temp_b2))):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        result = i
        break

print(result)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
mina= 100
minb=100
a = set()
b = set()
C = A/0.08
D= B/0.1
E=(A+1)/0.08
F=(B+1)/0.1 
if C.is_integer() ==False:
  C= A//0.08 +1
if D.is_integer() ==False:
  D= B//0.1 +1

if E.is_integer() ==False:
  E= (A+1)//0.08 

if F.is_integer() ==False:
  F= (B+1)//0.1

C=int(C)
D=int(D)
E=int(E)
F=int(F)
for i in range(C,E):
  a.add(i)
for i in range(D,F):
  b.add(i)
c = a&b
d = list(c)
d.sort()
if len(d) ==0:
  print(-1)
else:
  print(d[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math


def solve(A: int, B: int):

    result = 100000
    count = 0
    for i in range(1, 10000 + 1):
        if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
            result = min(result, i)
            count += 1
    if count == 0:
        print(-1)
    else:
        print(result)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    a = math.ceil(A / 0.08)
    b = math.ceil(B / 0.1)
    # print(a , b)
    if math.floor(a * 0.08) == A and math.floor(a * 0.1) == B:
        ret = a
    elif math.floor(b * 0.08) == A and math.floor(b * 0.1) == B:
        ret = b
    else : 
        ret = -1
    print(ret)

Submission status: Accepted

Solution code:
cmin = lambda a,b : a if a<b else b
cmax = lambda a,b : a if a>b else b
iin = lambda : int(input())
lin = lambda : list(map(int,input().split()))
rin = lambda n : [int(input()) for _ in range(n)]

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

at = []
for i in range(1,1500):
    if int(i*0.08)==a: at += [i]

bt = []
for i in range(1,1500):
    if int(i*0.1)==b: bt += [i]

ans = set(at) & set(bt)

print(min(ans) if ans else -1)

Submission status: Accepted

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

yes = 0
no = 0
for tax_free in range(1,1011):
    if A == int(tax_free*0.08) and B == int(tax_free*0.1):
        yes += 1
        if yes == 1: Z = tax_free
        else: pass
    else:
        no += 1

if no == 1010: print(-1)
else: print(Z)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-03-07 21:21:27 +0900
# LastModified: 2020-03-07 22:31:57 +0900
#




def main():
    A,B = map(int,input().split())
    a_min = (A/0.08)
    a_max = (A+1)/0.08
    b_min = (B/0.1)
    b_max = (B+1)/0.1
    if a_min!=int(a_min):
        a_min = int(A/0.08)+1
    if b_min!=int(b_min):
        b_min = int(B/0.1)+1
    s_a = [i for i in range(int(a_min),int(a_max))]
    s_b = [i for i in range(int(b_min),int(b_max))]
    for common in s_a:
        if common in s_b:
            print(common)
            return
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans1 = int(A *100// 8) 
ans2 = int(B *100 // 10)
ans1_2 = int((A+1) *100 // 8)
ans2_2 = int((B+1) *100 // 10)
list1 = []
list2 = []

for i in range(ans1,ans1_2):
    if int(i * 0.08) == A: 
        list1.append(int(i))
for j in range(ans2,ans2_2):
    if int(j * 0.1) == B:
        list2.append(int(j))
if list1[0] == list2[0]:
    print(list1[0])
elif list1[0] > list2[0]:
    if list1[0] in list2:
        print(list1[0])
    else:
        print(-1)
elif list1[0] < list2[0]:
    if list2[0] in list1:
        print(list2[0])
    else:
        print(-1)

Submission status: Accepted

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

x_a = np.arange(math.ceil(12.5 * A), math.ceil(12.5 * (A + 1)))
x_b = np.arange(10 * B, 10 * (B + 1))

a_set = set(x_a)
b_set = set(x_b)
#aとbに共通するものを抽出
c_set = a_set & b_set
c = list(c_set)

if len(c) != 0:
    print(min(c))

else:
    print("-1")

Submission status: Accepted

Solution code:
import math;
a,b = map(int,input().split())
x = []
y = []
ans = -1
x.append(math.ceil(a*25/2))
x.append((a+1)*25//2-1)
y.append(b*10)
y.append((b+1)*10-1)
if min(x) < max(y) and min(y) < max(x) and min(y) <= min(x):
  ans = min(x)
elif min(x) < max(y) and min(y) < max(x) and min(x) < min(y):
  ans = min(y)
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    result = 1
    while True:
        a = int(result * 0.08)
        b = int(result * 0.1)
        if a == A and b == B:
            print(result)
            break
        if A < a and B < b:
            print(-1)
            break
        result += 1


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
i = input().split(' ')
A = int(i[0])
B = int(i[1])

for x in range(1,10000000):
    B_hat = int(x/10)
    if B_hat>100:
        break
    if int(x*2/25)==A and B_hat==B:
        print(x)
        exit()
print(-1)

Submission status: Accepted

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

#当てはまるxがあるかどうか
for x in range(1500):
  if a/0.08 <= x < (a+1)/0.08 and b/0.1<= x < (b+1)/0.1:
#あったらリストに追加する
    list.append(x)
#空集合かどうか確かめる
if len(list) == 0 :
  print(-1)
  
else:
  print(min(list))

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
l = list(range(1, 1001))
s = int(b / 0.1)
t = int(a / 0.08)
temp_a = int(a / 0.08)
temp_b = int(b / 0.1)
ans_8 = []
ans_10 = []
for i in l:
    if i >= t:
        temp = int(i * 0.08)
        if temp == a:
            ans_8.append(i)
for i in l:
    if i >= s:
        temp = int(i * 0.1)
        if temp == b:
            ans_10.append(i)
s = set(ans_8) & set(ans_10)
if s:
    print(min(s))
else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = (int(x) for x in input().split())
h = []
for i in range(1, 1100):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        h.append(i)
h.append(-1)
print(h[0])

Submission status: Accepted

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

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

if (A+1)*100%8==0:
  X2=X2-1

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



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

Submission status: Accepted

Solution code:
import math

num = {}

num = input().split()

# print(num)

answer1 = math.ceil(int(num[0]) / 0.08)
answer2 = math.ceil(int(num[1]) / 0.1)

kensyo1 = math.floor(answer1 * 0.1) == int(num[1])
kensyo2 = math.floor(answer2 * 0.08) == int(num[0])

# print(answer1, answer2)
# print(kensyo1, kensyo2)

if int(num[0]) < 0 or int(num[1]) < 0:
  print(-1)
elif kensyo1:
  print(answer1)
elif kensyo2:
  print(answer2)
else:
  print(-1)

Submission status: Accepted

Solution code:
import math
A, B =map(int,input().split())
a_assume=math.ceil(A/0.08)
a_upper_limit=math.ceil((A+1)/0.08)
b_upper_limit=(B+1)*10
upper_limit=min(a_upper_limit,b_upper_limit)
while a_assume<upper_limit:
  if B==math.floor(a_assume*0.1):
    print(a_assume)
    break
  else:
    a_assume+=1
if a_assume>=upper_limit:
  print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
list = []
#print(a)
#list = [x if a/0.08 <= x and (a+1)/0.08 >x]
for x in range(1500):
  if a/0.08 <= x < (a+1)/0.08 and b/0.1<= x < (b+1)/0.1:
    list.append(x)
    
if len(list) == 0 :
  print(-1)
  
else:
  print(min(list))

Submission status: Accepted

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

Submission status: Accepted

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

for p in range(1,1251):
  if math.floor(p * 0.08) == A and math.floor(p * 0.1) == B:
    ans = p
    break
print(ans)

Submission status: Accepted

Solution code:
import sys
import math

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

downera = math.ceil(100/8 * a)
uppera = math.floor(100/8 * (a+1))

downerb = 10 * b
upperb = 10 * (b+1)

if uppera < downerb or upperb < downera:
    print("-1")
    sys.exit()
for i in range(downera, uppera):
    if i >= downerb and i < upperb:
        print(i)
        sys.exit()

print("-1")

Submission status: Accepted

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

x = 0

ans = -1

while x <= 2000:
    x_a = int(0.08*x)
    x_b = int(0.10*x)

    if x_a == a and x_b == b:
        ans = x
        break

    x += 1

print(int(ans))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
flag=False
for i in range(b*10,(b+1)*10):
    x=i*8
    if 100*(a+1)>x>=100*a:
        flag=True
        ans=i
        break
print(ans if flag else -1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
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
    break

# 出力
if flag == 0:
  print(-1)
elif flag == 1:
  print(i)

Submission status: Accepted

Solution code:
import math

i = list(map(float, input().split()))
m=0

j=i[0]/0.08
k=math.ceil(j)

l=i[1]/0.10
n=math.ceil(l)

while n*0.10<math.ceil(i[1])+1:
	k=math.ceil(j)
	while k*0.08<math.ceil(i[0])+1:
		if k==n:
			m=1
			#print(k,n)
			break
		else:
			k+=1
			#print(k,n)
			continue
	else:
		n+=1
		#print(k,n)
		continue
	break
  
else:
	print('-1')

if m==1:
	print(k)

Submission status: Accepted

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

eight = int(math.ceil(A / 0.08))
ten = int(math.ceil(B / 0.1))

ans = 10000000000

for i in range(min(ten, eight), max(ten, eight)+1):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans = min(ans,i)


if ans == 10000000000:
    ans = -1
print(ans)

Submission status: Accepted

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

for i in range(10, 1251):
    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:
import math

list_8 = []
list_10 = []

for i in range(101):
  list_8.append( math.ceil((i+1) * 12.5) )
  list_10.append( (i+1) * 10 )
  
A, B = map(int, input().split())

A_ = list_8[A] - 1
A = list_8[A-1]
  
B_ = list_10[B] - 1
B = list_10[B-1]

if A <= B <= A_:
  print(B)
elif B <= A <= B_:
  print(A)
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
import math
a = list()
i = A/0.08
j = (A+1)/0.08
while i < j:
    if int(i) == i:
        k = int(i)
        a.append(k)
        i = i+1
    elif int(i) != i:
        k = int(i+1)
        a.append(k)
        i = i+1
ko = max(a)
if ko == j:
    a.remove(ko)

b = list()
p = B/0.10
q = (B+1)/0.10
while p < q:
    if int(p) == p:
        l = int(p)
        b.append(l)
        p = p+1
    elif int(p) != p:
        l = int(p+1)
        b.append(l)
        p = p+1
mo = max(b)
if mo == q:
    b.remove(mo)

a.append(1000000)
b.append(1000000)
c= set(a) & set(b)
m = min(c)
if m == 1000000:
    print("-1")
else:
    print(m)

Submission status: Accepted

Solution code:
#output <= 1000

nums = [int(e) for e in input().split()]
flag = 0
for i in range(1,1001):
  if ((((i * 8) // 100) == nums[0]) & (((i * 10) // 100) == nums[1])):
    flag = 1
    print(i)
    break

if flag == 0:
    print(-1)

Submission status: Accepted

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

a_min = float(a)*12.5
a_max = float(a+1)*12.5
b_min = float(b*10)
b_max = float((b+1)*10)

o_min = max(a_min, b_min)
o_max = min(a_max, b_max)

import math

if math.ceil(o_min) < o_max:
    print(str(math.ceil(o_min)))
else:
    print('-1')

Submission status: Accepted

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

for value in range(1002):
    if value==1001:
        print('-1')
        break

    if a == math.floor(value * 0.08) and b == math.floor(value * 0.1):
        print(int(value))
        break

Submission status: Accepted

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

tmp = int((a*12.5) // 1)
cnt = tmp
'''
while (cnt*0.08)//1 == a:
  cnt += 1
  
if cnt == tmp:
  if (cnt * 0.1)//1 == b:
    print(cnt)
    exit()
'''
for i in range(tmp, 10001):
  ans = (i * 0.08)//1
  bans = (i*0.1)//1
  #print(i ,ans)
  if (bans==b) and ans==a:
    print(i)
    exit()
  elif ans > a:
    break
print(-1)

Submission status: Accepted

Solution code:
import math

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

aa = math.ceil(A / 0.08)
bb = math.ceil(B / 0.1)


if aa > bb:
    if int(aa * 0.08) != A or int(aa * 0.1) != B:
        print('-1')
    else:
        print(aa)
else:
    if int(bb * 0.08) != A or int(bb * 0.1) != B:
        print('-1')
    else:
        print(bb)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if int(a/(0.08)) == int(b/(0.1)):
    mn = int(a/(0.08))
else:
    inter = abs(int(a/(0.08)) - int(b/(0.1)))
    mn = min(int(a/(0.08)) , int(b/(0.1)))
             
    for i in range(inter*2):
        if int(mn*(0.08))==a:
            if int(mn*(0.1))==b:
                break
        mn += 1
        if i ==inter*2-1:
            mn = -1
print(mn)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
# A-2の時 2<=A<3　の間の数字だということ Bも同じ
non_taxed = sorted([(A/0.08),((A+1)/0.08),(B/0.1),((B+1)/0.1)])

for m in range(int(non_taxed[0]),int(non_taxed[3])+1):
    if int(m*0.08) == A and int(m*0.1) == B:
        print(m)
        exit()
print(-1)