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 as m

a, b = map(int, input().split())
cost = -1
flg = 0

while flg == 0 and cost < 10 ** 6 / 1.5:
    cost += 1
    aAns = m.floor(cost * 0.08)
    bAns = m.floor(cost * 0.1)
    if aAns == a and bAns == b:
        flg = 1

print(cost if flg == 1 else -1)

Submission status: Accepted

Solution code:
from math import floor

a, b = [int(i) for i in input().split()]
for i in range(1, 1011):
    if floor(i * 0.08) == a and floor(i * 0.1) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

while int(tmp_cost*0.08) <= a and int(tmp_cost*0.1) <= b:
    if int(tmp_cost*0.08) == a and int(tmp_cost*0.1) == b:
        ans = tmp_cost
        break
    else:
        tmp_cost += 1
print(ans)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
for i in range(1,1200):
    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()))

begin = int(min(A // 0.08, B // 0.10))
end = int(max((A + 1) // 0.08, (B + 1) // 0.10))

for n in range(begin, end+1):
    if int(n * 0.08) == A and int(n * 0.1) == B:
        print(n)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
from math import ceil
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    x1 = ceil(A / 0.08)
    x2 = ceil(B / 0.1)

    if int(x1 * 0.1) == B:
        print(x1)
    elif int(x2 * 0.08) == A:
        print(x2)
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor, ceil

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

min1 = A/0.08
max1 = (A+0.9999999)/0.08
min2 = B/0.1
max2 = (B+0.9999999)/0.1

rangeMin = ceil(max(min1, min2))
rangeMax = floor(min(max1, max2))
if rangeMin > rangeMax:
    print(-1)
else:
    print(rangeMin)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
# x = (a * 100) // 8
y = (b * 100) // 10

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

Submission status: Accepted

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

for i in range(1,10000):
  if int(math.floor(i*0.08))==A and int(math.floor(i*0.1))==B:
    if math.floor(i*0.1) <= 100:
      print(i)
      exit()
    else:
      break

print(-1)

Submission status: Accepted

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

for i in range(3000):
    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 = map(int, input().split())
ans = -1
for i in range(a, 1251):
    if int(i * 0.08) == a and  int(i * 0.1) == b and int(i * 0.08) >= a:
        ans = i 
        break
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if A%2==0:
    if (B*10+9)<25*A//2 or (25*A//2+12)<B*10:
        print("-1")
    else:
        print(max(B*10,25*A//2))
else :
    if (B*10+9)<int(25*A/2)+1 or 25*(A+1)//2-1<B*10:
        print("-1")
    else:
        print(max(B*10,int(25*A/2)+1))

Submission status: Accepted

Solution code:
a,b=map(int,input().split());l=max(a*25+1>>1,b*10);print(l*(~a/.08<-l>~b*10)or-1)

Submission status: Accepted

Solution code:
import math

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

result = -1

for n in range(10000):
    if math.floor(n*0.08) == a and math.floor(n*0.1) == b:
        result = n
        break
print(result)

Submission status: Accepted

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

import math 
a = [x for x in range(math.ceil(A*12.5),math.ceil((A+1)*12.5))]
b = [x for x in range(math.ceil(B*10),math.ceil((B+1)*10))]

c = set(a) & set(b)

if c != set():
  print(min(c))
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

input = sys.stdin

def tax(pct8, pct10):
    pct8low_x10 = pct8 * 125
    if pct8low_x10 % 10 == 0:
        pct8low = pct8low_x10 // 10
    else:
        pct8low = pct8low_x10 // 10 + 1

    pct8high_x10 = (pct8 + 1) * 125

    if pct8high_x10 % 10 == 0:
        pct8high = pct8high_x10 // 10 - 1
    else:
        pct8high = pct8high_x10 // 10

    pct10low = pct10 * 10
    pct10high = (pct10 + 1) * 10 - 1

    if pct8high < pct10low or pct10high < pct8low:
        return -1
    else:
        return max(pct8low, pct10low)

#def test():
#    for i in range(1, 100+1):
#        for j in range(1, 100+1):
#            price = tax(i, j)
#            if price > 0:
#                if int(price *.08) != i or int(price * .1) != j:
#                    print(f"Wrong! tax({i},{j}) -> {price} but price*0.8={int(price*0.08)} and price*0.1={int(price*0.1)}")

pct8, pct10 = map(int, input.readline().split(" "))
print(tax(pct8, pct10))
#test()

Submission status: Accepted

Solution code:
a,b=map(int,input().split());l=max(0--a*25//2,b*10);print(l*(~a*25//2<-l>~b*10)or-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split());l=max(0--a*25//2,b*10);print(l*(-~a*25//2>l<-~b*10)or-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
result = True
for a in range(1, 1001):
    if int(a * 0.08) == A and int(a * 0.1) == B:
        print(a)
        result = False
        break
        exit()
        
if result:
    print("-1")

Submission status: Accepted

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

Min8 = A // 0.08 + 1
Min10 = B // 0.1 + 1

Max10 = (B+1) // 0.1
Max8 = (A+1) // 0.08

if Min10 >= Min8 and Max8 >= Min10:
    print(int(Min10))
elif Min8 >= Min10 and Max10 >= Min8:
    print(int(Min8))
else:
    print(-1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def main():
    A,B = map(int,input().split())
    for i in range(1,1010):
        if int(0.08*i)==A and int(0.1*i)==B:
            print(i)
            return
    print('-1')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
a = math.ceil(A / 0.08)
b = math.ceil(B / 0.1)
ans = max(a, b)

if math.floor(ans * 0.08) == A and math.floor(ans * 0.1) == B:
    print(ans)
else:
    print(-1)

Submission status: Accepted

Solution code:
import numpy as np

s = np.array(input().split()).astype(int)
# =============================================================================
# if s.find("A") >= 0 and s.find("B") >= 0:
#     print("Yes")
# else:
#     print("No")
# =============================================================================

# =============================================================================
# N,A,B = s
# 
# print(N//(A+B)*A + np.array([N%(A+B),A]).min())
# =============================================================================

A,B = s

eight =  100/8
ten = 100/10
x1 = A*eight
x2 = A*ten
ans = []

for i in np.arange(0,np.array([x1,x2]).max().astype(int) + 100):
    if int(i * 1/eight) == A and int(i * 1/ten) == B:
        ans.append(i)
if len(ans) == 0:
    print(-1)
else:
    print(np.array(ans).min().astype(int))

Submission status: Accepted

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

for i in range(1009):
    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:
import math
A, B = map(int, input().split())
max_price = math.ceil((A+0.99999)/0.08)
min_price = math.floor((B/0.1))
found = 0
for price in range(min_price, max_price+1):
  if math.floor(price*0.08) == A and math.floor(price*0.1) == B:
    print(price)
    found = 1
    break
if found == 0:
  print(-1)

Submission status: Accepted

Solution code:
tax8, tax10 = map(int, input().split())

for i in range(1, 1001):
    if (int(i * 0.08) == tax8) and (int(i * 0.1) == tax10):
        print(i)
        exit()
print("-1")

Submission status: Accepted

Solution code:


from math import ceil, sqrt, floor

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

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

Submission status: Accepted

Solution code:
import math
a,b = [int(x) for x in input().split()]
if a%2 == 0:
  amax = math.ceil((a+1)*12.5)
  amin = a*12.5
else:
  amax = (a+1)*12.5
  amin = math.ceil(a*12.5)
bmax = int((b+1)*10)
bmin = int(b*10)
hantei = bmin
if amax <= bmin:
  hantei = -1
elif bmax <= amin:
  hantei = -1
elif bmin < amin:
  hantei = amin
print(int(hantei))

Submission status: Accepted

Solution code:
#abc158c
import sys
a,b=map(int,raw_input().split())
s=[]
for i in range(1100):
 s.append([i,int(i*0.08),int(i*0.1)])
for i in range(1100):
 if s[i][1]==a and s[i][2]==b:
  print s[i][0]
  sys.exit()
print -1

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for i in range(10, 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(1001):
    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:
from math import floor
a, b = map(int, input().split())
ans = -1
for i in range(10101):
  if floor(i*0.08) == a and floor(i*0.1) == b:
    ans = i
    break
print(ans)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ans = 0
while 1:
    C = int(ans*0.08)
    D = int(ans*0.1)
    if C == A and D == B:
        print(ans)
        break
    if C > A or D > B:
        print(-1)
        break
    ans += 1

Submission status: Accepted

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

check = False
for i in range(1, 10000):
    a_check = A <= i * 0.08 and i * 0.08 < (A+1)
    b_check = B <= i * 0.1 and i * 0.1 < (B+1)
    if a_check and b_check:
        print(i)
        check = True
        break

if check == False:
    print(-1)

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
ans = 0
while 1:
    C = math.floor(ans*0.08)
    D = math.floor(ans*0.1)
    if C == A and D == B:
        print(ans)
        break
    if C > A or D > B:
        print(-1)
        break
    ans += 1

Submission status: Accepted

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

for i in range(10001):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        break
    elif i==10000:
        print(-1)

Submission status: Accepted

Solution code:
S=list(map(int,input().split()))
A=S[0]
B=S[1]
if A%2==0:
    C=int(A/0.08)
    E=int((A+1)/0.08)
else:
    C=int(A/0.08)+1
    E=int((A+1)/0.08)-1
D=int(B/0.1)
n=max(C,D)

F=int((B+1)/0.1)-1
m=min(E,F)
if n<=m:
    print(int(n))
else:
    print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    a, b = LI()
    for i in range(10 ** 5):
        if int(i * 0.08) == a and int(i * 0.1) == b:
            print(i)
            return
    print(-1)
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split(' '))) 
 
res = -1
# 最大で1009円まで
for i in range(1, 1010):
  q_A = int(i * 0.08)
  q_B = int(i * 0.1)
  if q_A == A and q_B == B:
    res = i
    break
  else:
    continue
 
print(res)

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]
A = a/0.08
B = b*10
if B-10 <= A < B+10:
    print(int(max(A, B)+0.5))
else:
    print(-1)

Submission status: Accepted

Solution code:
A,B = [int(i) for i in input().split()]
for i in range(11000):
    if int(i*0.08) == A and int(i*0.10) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
a, b = map(int, input().split())
c = max(ceil(a / 0.08), ceil(b / 0.10))
if c < min(int((a + 1) / 0.08), int((b + 1) / 0.10)):
    print(c)
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=-1
for i in range(1,int(100*100/8)+1):
    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())
li=[]
for n in range(int(100/0.08)):
  if int(n*0.08)==a and int(n*0.1)==b:
    li.append(n)
if li == []:
    print('-1')
else:
    print(li[0])

Submission status: Accepted

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

if __name__ == '__main__':
  main()

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

Submission status: Accepted

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

mini_8 = a / 0.08
maxi_8 = mini_8 + 12.5
mini_8 = math.ceil(mini_8)
if maxi_8 - int(maxi_8) == 0:
    maxi_8 = int(maxi_8 - 1)
else:
    maxi_8 = int(maxi_8)

mini_10 = b / 0.1
maxi_10 = mini_10 + 9

for i in range(mini_8, maxi_8+1):
    if mini_10 <= i and i <= maxi_10:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
min1 = a / 0.08
max1 = (a+1) / 0.08
min2 = b / 0.1
max2 = (b+1) / 0.1

if max1 <= min2 or max2 <= min1:
    print('-1')
else:
    print(max(math.ceil(min1), math.ceil(min2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

b = B*(100/10)
b_floor = math.floor(b)
b_sample = []

a = A*(100/8)
a_floor = math.floor(a)
a_sample = []

for i in range(-12,13):
    a_floor += i
    if a < 0:
        continue
    else:
        x = a_floor*(0.08)
        x_floor = math.floor(x)
        if x_floor == A:
            a_sample.append(a_floor)
            a_floor = math.floor(a)
            continue
        else:
            a_floor = math.floor(a)

for i in range(10):
    b_floor += i
    y = b_floor*(0.10)
    y_floor = math.floor(y)
    if y_floor == B:
        b_sample.append(b_floor)
        b_floor = math.floor(b)
        continue
    else:
        b_floor = math.floor(b)

ans = []
for x in a_sample:
    for y in b_sample:
        if x == y:
            ans.append(x)
            continue


if len(ans) > 0:
    print(min(ans))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1100):
    x = i * 8 // 100
    y = i * 1 // 10
    if(x == a and y == b):
        print(i)
        exit()
else:
    print(-1)

Submission status: Accepted

Solution code:
from math import floor , ceil

num = [int(_) for _ in input().split()]

x = ceil(num[0] / (8 / 100))
y = round(num[1] / (10 / 100))

if x == y:
    print(x)
    exit()
else:
    for temp in range(min(x,y), max(x,y)+1 ):
        if floor(temp * 0.08) == num[0] and floor(temp * 0.10) == num[1]:
            print("{}".format(temp))
            exit()
print(-1)

Submission status: Accepted

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

max_x = min((A+1)/0.08, (B+1)/0.1)
min_x = max(A/0.08, B/0.1) 

ans = -1
for i in list(reversed(range(int(min_x-1), int(max_x+1)))):
    if min_x <= i and i< max_x:
        ans = i

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#python3
from math import ceil
def main():
    a, b = map(int, input().split())
    a1 = 12.5*a
    a2 = 12.5*(a+1)
    b1 = 10*b
    b2 = 10*(b+1)
    if a2 <= b1:
        print('-1')
        return 
    if b2 <= a1:
        print('-1')
        return
    ans = max(ceil(a1), b1)
    print(ans)
main()

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


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

Submission status: Accepted

Solution code:
import math

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

price_a = math.ceil(A*100/8)
price_b = int(B*100/10)

if(int(price_a * 1.10) - B == price_a) :
  print(price_a)
  exit()
if(int(price_b * 1.08) - A == price_b) :
  print(price_b)
  exit()
  
print(-1)

Submission status: Accepted

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

for i in range(1,1250):
    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())
ans = -1
for i in range(13, 1001):
    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())
i=0
ans=-1
while i<=1010:
    i=i+1
    if int(i*0.08)==A and int(i*0.1)==B:
        ans=i
        print(ans)
        break
else:
    print(ans)

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:
from math import *
A,B = map(int,input().split())

#A = x*.08
#x1 = A / 0.08
#x2 = B / 0.1

x = 0
ans = -1
while x <= 2000:
    x += 1
    if floor(x*0.08) == A and floor(x*0.1) == B:
        ans = x
        break

print(ans)

Submission status: Accepted

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

x=[a//0.08,(a+1)//0.08]
if int(x[0])%25!=0: x[0]+=1
y=[b//0.1,(b+1)//0.1]
if int(y[0]%10!=0): y[0]+=1
if x[0]<y[0]:x,y=y,x
print(int(x[0]) if x[0]<y[1] else -1)

Submission status: Accepted

Solution code:
ans=[]
anskouho=[]
A,B=map(int,input().split())
for i in range(1,1009):
    if int(i*8/100)==A and int(i*0.1)==B:
        ans.append(i)
        anskouho.append(min(ans))
    else:
        anskouho.append(-1)
print(max(anskouho))

Submission status: Accepted

Solution code:
s = list(map(int, input().split()))
n = s[0]
a = s[1]
flag=0
ans=0
for i in range(1009):
    za=int(i*0.08)
    zb=int(i*0.1)
    if za==n and zb==a:
        flag=1
        ans=i
        break
if flag:
    print(ans)
else:
    print(-1)

Submission status: Accepted

Solution code:
a8, b10 = map(int, input().split())
min8 = a8 / 0.08
max8 = (a8+1) / 0.08 

min10 = b10 / 0.1
max10 = (b10+1) / 0.1 
list10 = [i for i in range(int(min10), int(max10))]
if int(min8) - min8 != 0:
    min8 = int(min8) + 1
if int(max8) - max8 != 0:
    max8 = int(max8) + 1
flg = 0 
for i in range(int(min8), int(max8)):
    if i in list10:
        print(i)
        flg = 1
        break
if flg == 0:
    print(-1)

Submission status: Accepted

Solution code:
from math import floor
def main():
    a, b = map(int, input().split())
    for i in range(1, 1010):
        x1 = floor(i*0.08)
        x2 = floor(i*0.1)
        if x1 == a and x2 == b:
            print(i)
            return
    print('-1')
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 最大で1009まで見れば良いアプローチ

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

ans = -1
for i in range(1010):
    # i は元の金額
    # そこから 8% と 10% を求めた時に等しくなれば終了
    if i*8//100 == A and i//10 == B:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


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

for i in range(1, 10000):
    aa = i*0.08
    aaa = math.floor(aa)
    bb = i*0.1
    bbb = math.floor(bb)
    if a == aaa and b == bbb:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
a,b = input().split()
a,b = [int(a), int(b)]
min_a = (a * 100) / 8
if min_a != ((a * 100) // 8):
  min_a += 0.5
  
max_a = ((a + 1) * 100) / 8
min_b = b * 10
max_b = (b + 1) * 10

if min_a >= min_b and min_a < max_b:
  print(int(min_a))
elif min_b >= min_a and min_b < max_a:
  print(min_b)
else:
  print('-1')

Submission status: Accepted

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

p = []
for i in range(10, 2000):
  if int(i*0.08) == a:
    if int(i*0.1) == b:
      p.append(i)

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

Submission status: Accepted

Solution code:
# C - Tax Increase
A,B = map(int,input().split())
a = (A*100+8-1)//8
b = (B*100+10-1)//10

aa = a*8//100
ab = a*10//100
ba = b*8//100
bb = b*10//100

if aa==A and ab==B: print(min(a,b) if ba==A and bb==B else a)
else: print(b if ba==A and bb==B else -1)

Submission status: Accepted

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

x_low = (A * 100 + 7) // 8
x_high = ((A + 1) * 100 + 7) // 8 - 1
y_low = (B * 100 + 9) // 10
y_high = ((B + 1) * 100 + 9) // 10 - 1

result = max(x_low, y_low)
if result > min(x_high, y_high):
    result = -1
print(result)

Submission status: Accepted

Solution code:
# C - Tax Increase
A,B = map(int,input().split())
a = (A*100+8-1)//8
b = (B*100+10-1)//10

aa = a*8//100
ab = a*10//100
ba = b*8//100
bb = b*10//100

if aa==A and ab==B:
    if ba==A and bb==B:
        print(min(a,b))
    else:
        print(a)
else:
    if ba==A and bb==B:
        print(b)
    else:
        print(-1)

Submission status: Accepted

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

a_low = (A * 100 + 7) // 8
a_high = ((A + 1) * 100 + 7) // 8 - 1
b_low = (B * 100 + 9) // 10
b_high = ((B + 1) * 100 + 9) // 10 - 1

c = max(a_low, b_low)
if c <= min(a_high, b_high):
    print(c)
else:
    print(-1)

Submission status: Accepted

Solution code:
def rounder(x):
    flt = x - int(x)
    if flt>=0.5:
        return int(x)+1
    else:
        return int(x)

def main():
    a, b = map(int, input().split())
    A = list(range(rounder(a/0.08), rounder((a+1)/0.08)))
    B = list(range(rounder(b/0.10), rounder((b+1)/0.10)))
    r = -1

    for i in range(len(B)):
        if B[i] in A:
            r = B[i]
            break
    print(r)

main()

Submission status: Accepted

Solution code:
#python3
from math import floor
def main():
    a, b = map(int, input().split())
    for i in range(1, 1200):
        x1 = floor(i*0.08)
        x2 = floor(i*0.1)
        if x1 == a and x2 == b:
            print(i)
            return
    print('-1')
main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
 
money = 1
while money < 1010:
  if a ==int(0.08*money) and b == int(0.10*money):
    print(money)
    break
  money+=1
  if money ==1010:
    print(-1)

Submission status: Accepted

Solution code:
import sys

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

for n in range(1, 10000):

    az = int(n * 0.08)
    bz = int(n * 0.1)

    if (az == a) and (bz == b):
        print(n)
        sys.exit()

print('-1')

Submission status: Accepted

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

def find(per, value):
    n_list = [i for i in range(1,1001)]
    return list(filter(lambda x:int(x*per) == value, n_list))

a_list = list(set(find(0.08, A)) & set(find(0.1, B)))
if a_list:
    print(min(a_list))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


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

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

    return


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

import math
ans = -1
for i in range(1, 10000):
  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())
money = 1
while money < 1010:

    if money * 8 // 100 == a and money // 10 == b:
        break
    money += 1
    if money == 1010:
        money = -1
        break
print(money)

Submission status: Accepted

Solution code:
import math

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

motoa = a/0.08

motob = b/0.1
a += 1
b += 1
xmotoa = a/0.08
xmotob = b/0.1

if motoa < motob <xmotoa:
    print(math.ceil(motob))
elif motoa < xmotob <xmotoa:
    print(math.ceil(motoa))
else:
    print('-1')

Submission status: Accepted

Solution code:
import math

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

tax1=math.ceil(max(12.5*a,10*b))
tax2=math.floor(min(12.5*(a+1),10*(b+1)))

if tax2>tax1:
    print(tax1)
else:
    print(-1)

Submission status: Accepted

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

n = int(b / 0.1)
ans = -1
while int(n * 0.1) == b:
    if int(n * 0.08) == a:
        ans = n
        break
    n += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import math

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:
from math import floor as f
A, B = map(int, input().split(" "))

for c in range(10000):
    a = f(c * 0.08)
    b = f(c * 0.1)
    if a == A and b == B:
        print(c)
        break
else:
    print("-1")

Submission status: Accepted

Solution code:
a,b=map(int,input().split());l=max(0--a*25//2,b*10);print([-1,l][l<min(-~a*25//2,-~b*10)])

Submission status: Accepted

Solution code:
a,b=map(int,input().split());l=max(0--a*25//2,b*10);print([-1,l][l<min(0-~a*25//2,-~b*10)])

Submission status: Accepted

Solution code:
a,b=map(int,input().split());l=max(-(-a*25//2),b*10);print([-1,l][l<min(-(~a*25//2),-~b*10)])