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())
for x in range(100000):
    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 x in range(1251):
    
    if (int(x * 0.08) == A) and (int(x * 0.1) == B):
        print(x)
        exit()

print("-1")

Submission status: Accepted

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

Xa_max = (A + 1) / 0.08
Xa_min = (A) / 0.08

Xb_max = (B + 1) / 0.1
Xb_min = (B) / 0.1

# 範囲が被らない場合
if Xa_min >= Xb_max or Xb_min >= Xa_max:
    print(-1)
    exit()

if Xa_min >= Xb_min:
    ans = math.ceil(Xa_min)
    if ans >= Xb_max:
        print(-1)
        exit()
else:
    ans = math.ceil(Xb_min)
    if ans >= Xa_max:
        print(-1)
        exit()

print(ans)

Submission status: Accepted

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

for i in range(10**4):
    if int(i*0.08) == a and int(i*0.10) == b:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
def tax(a, b):
    for i in range(1,1010):
        if int(i*0.08) == a and int(i*0.1) == b:
            print(i)
            return
    print(-1)
    return

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

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    x1 = int(B // 0.1)
    x2 = int(A // 0.07)

    for i in range(x1, x2):
        if int(i*0.08) == A and int(i*0.1) == B:
            print(i)
            return
    else:
        print(-1)
        return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

import math

# 入力
A,B = (int(x) for x in input().split())

LA = list(range(math.ceil(12.5*A),math.ceil(12.5*(A+1))))
LB = list(range(math.ceil(10*B),math.ceil(10*(B+1))))

intersect = set(LA) & set(LB)

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

Submission status: Accepted

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

x_s = int(50*(A+B)/9) 
x_e = int(50*(A+B+1)/9) 
a = -1
for x in range(x_s, x_e+1):
    if int(x*0.08) == A and int(x*0.1) == B:
        a = x
        break
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

a_low = math.ceil(a/0.08)
a_high = math.floor((a+1)/0.08)-1

b_low = math.ceil(b/0.1)
b_high = math.floor((b+1)/0.1)-1

if a_high<b_low or b_high<a_low:
  print(-1)
else:
  print(max(a_low, b_low))

Submission status: Accepted

Solution code:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  a, b = map(int, readline().split())
  a_low = ceil(a/0.08)
  a_high = ceil((a+1)/0.08)
  s1 = {i for i in range(a_low, a_high)}
  b_low = ceil(b/0.1)
  b_high = ceil((b+1)/0.1)
  s2 = {i for i in range(b_low, b_high)}
  if s1&s2:
    print(min(s1&s2))
  else:
    print(-1)
  
  
if __name__ == '__main__':
  main()

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

print(-1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
c = 0
d = 0
e = -1

for i in range(1, 1010):
    c = int(i*0.08)
    d = int(i*0.1)
    if a==c and b==d:
        e = i
        break

print(e)

Submission status: Accepted

Solution code:
import sys
import math

A, B = map(int, input().split())
C = math.ceil(A / 8 * 100)
while True:
    tax8 = C * 0.08
    if math.floor(tax8) > A:
        break
    tax10 = C * 0.1
    if math.floor(tax10) == B:
        print(C)
        sys.exit(0)
    C += 1
print(-1)

Submission status: Accepted

Solution code:
import sys

A, B = map(int, sys.stdin.readline().rstrip().split())
c = 1e-10
d = 1 - c
A_min = int(A * (100 / 8.) + d)
A_max = int((A + d) * (100 / 8.))
B_min = int(B * 10.)
B_max = int((B + d) * 10.)

if min(A_max, B_max) - max(A_min, B_min) >= 0:
    print(max(A_min, B_min))
else:
    print('-1')

Submission status: Accepted

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

#SA=(math.floor(math.floor(float(A)/0.08))*0.08,math.floor(math.ceil(float(A)/0.08))*0.08)
#SB=(math.floor(math.floor(float(B)/0.08))*0.08,math.floor(math.ceil(float(B)/0.08))*0.08)
SA=(math.floor(float(A)/0.08),math.ceil(float(A)/0.08))
SB=(math.floor(float(B)/0.08),math.ceil(float(B)/0.08))
ans=[]
for i in range(1,10003):
    SSA=math.floor(i*0.08)
    SSB = math.floor(i * 0.1)
    if SSA==A and SSB==B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
taxA = A / 8 * 100
taxB = B * 10
judge = True
litaxB = [taxB + i for i in range(10)]
if taxA - int(taxA) < 0.5:
    litaxA = [int(taxA) + j for j in range(13)]
else:
    litaxA = [int(taxA) + 1 + j for j in range(12)]
for k in litaxA:
    if k in litaxB:
        print(k)
        judge = False
        break
if judge == True:
    print(-1)

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


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

    A, B = il()
    for n in range(1010):
        if int(n*0.08) == A and int(n*0.1) == B:
            print(n)
            exit()
    else:
        print(-1)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


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

    A, B = il()
    for n in range(1100):
        if int(n*0.08) == A and int(n*0.1) == B:
            print(n)
            exit()
    else:
        print(-1)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=0
for i in range(1251):
  if x == 0 and int(i*0.08) == a and int(i*0.10) == b:
    print(i)
    x=1
  if x == 0 and i == 1250:
    print("-1")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

eight, ten = map(int, input().split())

eight_price = eight / 0.08
ten_price = ten / 0.1

if eight_price >= ten_price:
    bigger = eight_price
    if (bigger // 10) != ten:
        print("-1")
    else:
        print(math.ceil(bigger))
else:
    bigger = ten_price
    if (bigger * 8 // 100) != eight:
        print("-1")
    else:
        print(math.ceil(bigger))

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)
        quit()

print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
amin = math.ceil(a * 100 / 8)
amax = math.ceil((a+1) * 100 / 8) - 1
bmin = math.ceil(b * 100 / 10)
bmax = math.ceil((b+1) * 100 / 10) -1

if amin > bmax or bmin > amax:
    print('-1')
else:
    print(max(amin, bmin))

Submission status: Accepted

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

a0 = -(-25*a // 2)
a1 = 25*(a+1) // 2
b0 = -(-10*b // 1)
b1 = -(-10*(b+1) / 1)

if a0 <= b0 and b0 < a1:
    print(b0)
elif b0 <= a0 and a0 < b1:
    print(a0)
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from collections import Counter

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

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

x = a/0.08
x_1 = (a+1)/0.08
y = b/0.1
y_1 = (b+1)/0.1

if is_integer_num(x_1):
    x_li = set(range(math.ceil(x),int(x_1)))
else:
    x_li = set(range(math.ceil(x),math.floor(x_1)))
    
if is_integer_num(y_1):
    y_li = set(range(math.ceil(y),int(y_1)))
else:
    y_li = set(range(math.ceil(y),math.floor(y_1)))

li=x_li&y_li

if list(li) == []:
    print(-1)
else:    
    print(min(li))

Submission status: Accepted

Solution code:
def main():
    import math

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

    eight = math.ceil(A / 0.08)
    ten = math.ceil(B / 0.1)
    #print(eight, ten)
    ans = max(eight, ten)
    ans8 = math.floor(ans * 0.08)
    ans10 = math.floor(ans * 0.1)
    #print(ans8, ans10)
    if ans8 == A and ans10 == B:
        print(ans)
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
X1 = math.ceil(A / 0.08)
X1max = (A+1) / 0.08
X2 = math.ceil(B / 0.10)
X2max = (B+1) / 0.10
#print (X1,X1max,X2,X2max)

X = max(X1,X2)
if X2max <= X1 or X1max <= X2:
    print(-1)
else:
    print(X)

Submission status: Accepted

Solution code:
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
from math import floor,ceil
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]


a,b = li()
ans = float('inf')
i = b
j = a

d = defaultdict(int)
low1,high1 = a/0.08,(a + 1)/0.08
low2,high2 = b/(0.1),(b + 1)/0.1
for i in range(ceil(low1),ceil(high1),1):
    d[i] += 1

ans = -1
for i in range(ceil(low2),ceil(high2),1):
    if d[i]:
        ans = i
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

price_8=100*a/8
price_10=100*b/10

if(math.floor(price_8+12.5)>price_10 and math.floor(price_10+10)>math.ceil(price_8)):
    print(max(int(price_10), math.ceil(price_8)))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

n = 0
    
if a * 12.5 < (b+1) * 10 and b * 10 < (a+1) * 12.5:
    while n < a * 12.5 or n < b * 10:
        n += 1
    else:
        print(n)
else:
    print('-1')

Submission status: Accepted

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

price = b * 10

for i in range(10):
  if int((price + i) * 0.08) == a:
    print(price + i)
    exit()
else:
  print("-1")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B = map(int, input().split())
answerA = math.ceil(A/0.08)
answerAA = math.ceil((A+1)/0.08 -1)
answerB = math.ceil(B/0.1)
answerBB = math.ceil((B+1)/0.1 -1)
if answerA == answerAA:
    if answerA >= answerB and answerA <= answerBB:
        print(answerA)
elif answerB == answerBB:
    if answerB >= answerA and answerB <= answerAA:
        print(answerB)
else:
    if answerB > answerAA:
        print("-1")
    elif answerB == answerAA:
        print(answerAA)
    elif answerA < answerB and answerAA > answerB:
        print(answerB)
    elif answerA == answerB:
        print(answerB)
    elif answerB < answerA and answerBB >= answerA:
        print(answerA)
    elif answerBB < answerA:
        print("-1")
    else:
        print("-1")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())
for x in range(1, 1001, 1):
    if int(x * 0.08) == a and int(x * 0.1) == b:
        print(x)
        exit()
print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math
a, b = map(int, input().split())
for x in range(1, 1001, 1):
    if int(x * 0.08) == a and int(x * 0.1) == b:
        print(x)
        sys.exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

x = int(a / 0.08) #最小値を設定
y = int((b+10) / 0.1) #最大値を設定

z = 0

for i in range(x, y):
  if int(i * 0.08) == a and int(i * 0.1)  == b and i < ans:
    ans = i
    z = 1

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)


a, b = inp_list()
for n in range(1251):
    wo_tax_a = int(n * 0.08)
    wo_tax_b = int(n * 0.10)
    if wo_tax_a == a and wo_tax_b == b:
        print(n)
        exit()
print(-1)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)


a, b = inp_list()
for n in range(1251):
    wo_tax_a = int(n * 0.08)
    wo_tax_b = int(n * 0.10)
    if wo_tax_a == a and wo_tax_b == b:
        print(n)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
C=[]
for i in range(1,1010):
  if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
    C.append(i)
if len(C)==0:
  print("-1")
else:
  print(min(C))

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
Al = math.ceil(A / 0.08)
Am = math.ceil((A+1)/0.08)

Bl = int(B / 0.1)
Bm = int((B+1) / 0.1)

Ar = list(range(Al, Am))
Br = list(range(Bl, Bm))

for i in Ar:
    if i in Br:
        print(i)
        break
    else:
        continue
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

import math
for i in range(1250):
  if math.floor(i *0.08)==A and math.floor(i*0.1)==B:
    if ans>i:
      ans=i
if ans==10000:
  print(-1)
else:
  print(ans)

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
min = B * 10
max = B * 10 + 9
flag = False
for i in range(min, max + 1):
    temp = math.floor(i * 0.08)
    if (temp == A):
        flag = True
        ans = i
        break
if flag:
    print(ans)
else:
    print('-1')

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
for i in range(1001):
    if (math.floor(i*0.08)==A) & (math.floor(i*0.1)==B):
        ans = i
        break
    ans = -1

print(ans)

Submission status: Accepted

Solution code:
import math

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

for i in range(10):
    if math.floor((B*10+i)*8/100) == A:
        print(B*10+i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
min_a = a//0.08
max_a = (a+1)//0.08
min_b = b//0.1
max_b = (b+1)//0.1
a_array = set(range(int(min_a)+1, int(max_a)))
b_array = set(range(int(min_b)+1, int(max_b)))
common = a_array & b_array
print("-1" if len(common) == 0 else min(common))

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(1, 1251):
    if (math.floor(i*0.08) == a) and (math.floor(i*0.1) == b): 
        print(i)
        exit()
    else:
        ans+=1

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

Submission status: Accepted

Solution code:
import math
import sys
A,B=map(int, input().split())
Min=min(math.floor(A/0.08),math.floor(B/0.1))
Max=max(math.floor((A+1)/0.08),math.floor((B+1)/0.1))
for i in range(Min,Max):
    #print(i)
    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 = map(int, input().split())

mina = math.ceil(a * 100 / 8)
maxa = math.floor((a + 0.9) * 100 / 8)
minb = math.ceil(b * 100 / 10)
maxb = math.floor((b + 0.9) * 10)

if maxb < mina or maxa < minb:
    print(-1)
elif mina > minb:
    print(mina)
else:
    print(minb)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
a = 100000
for i in range(1,1009):
  if A == math.floor(i*0.08) and B == math.floor(i*0.1):
    a = i
    break

if a == 100000:
  print(-1)
else:
  print(a)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ans = -1
for i in range(1,100000):
    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())
for i in range(10000):
    if (i * 0.08)//1 == a and (i * 0.1)//1 == b:
        print(i)
        quit()
print(-1)

Submission status: Accepted

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

count = True
for i in range(1, 1001):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        count = False
        break
        
if count:
  print(-1)

Submission status: Accepted

Solution code:
import math
import itertools
import statistics
#import numpy as np
import collections
a, b = list(map(int, input().split()))
#print(a/0.08)
price = math.ceil(a/0.08)
if b==price*0.1//1:
    ans = int(price//1)
    print(ans)
else:
    price += 1
    while math.floor(price*0.08)==a:
        if b==price*0.1//1:
            ans = int(price//1)
            print(ans)
            exit()
        price += 1

    print("-1")


# print(a/0.08*0.1//1)
#print(b/0.1)

Submission status: Accepted

Solution code:
A,B=tuple(int(i) for i in input().split(" "))
err=lambda X:abs(int(X*0.08)-A)+abs(int(X*0.10)-B)
rg=[int(A/0.08),int(B/0.10)]
rg.sort()
rg[0]-=int(1/0.08)
rg[1]+=int(1/0.08)
solv=[X for X in range(*rg) if err(X)==0]
solv.sort()
if(len(solv)==0):
    print("-1")
else:
    print(solv[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = -1
for i in range(1, 10001):
    tax_8 = math.floor(i * 0.08)
    tax_10 = math.floor(i * 0.10)
    if tax_8 == A and tax_10 == B:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
A = a[0]
B = a[1]
c = True
for x in range(10001):
    a = x * 0.08
    b = x * 0.1
    if A == int(a) and B == int(b):
        print(x)
        c = False
        break
if c:
    print(-1)

Submission status: Accepted

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


judge = 0
for i in range(1,1001):
    if  int(i*0.08) == a and int(i*0.1) == b:
        judge = 1
        print(i)
        break

if judge == 0:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1009):
    answer_A=int(i*0.08)
    answer_B=int(i*0.1)
    if answer_A==A and answer_B==B:
        answer=i
        break
    else:
        answer=-1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, 1001):
    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


def solve(string):
    a, b = map(int, string.split())
    ans = ceil(a / 0.08)
    while ans // 10 < b:
        ans += 1
    return str(ans) if ans * 2 // 25 == a and ans // 10 == b else "-1"


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Accepted

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

Submission status: Accepted

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

e_min = a/0.08
e_max = (a+1)/0.08

t_min = int(b/0.1)
t_max = int((b+1)/0.1)

num = -1
for i in range(t_min, t_max):
  if i >= e_min and e_max > i:
    num = i
    break
    
print(num)

Submission status: Accepted

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

for i in range(1, 1011):
    if int(i*0.08)==A and int(i*0.1)==B:
        res = i
        break

print(res)

Submission status: Accepted

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

flg = False
for price in range(1,1010):
    if int(price*0.08)==A and int(price*0.1)==B:
        flg = True
        break

if flg:
    print(price)
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

flg = 0
for i in range(1,1250):
        x = math.floor(i * 0.08)
        y = math.floor(i * 0.1)
        if x == A and y == B:
                print(i)
                flg = 1
                break
if flg == 0:
        print(-1)

Submission status: Accepted

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

for i in range(1010):
  if i*8//100 == a and i*10//100== b:
    z = i
    break
print(z)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

def inpl_strl(): return list(sys.stdin.readline())

a, b = inpl()
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:
A, B = map(int, input().split())
 
N_A = A / 0.08
N_B = B / 0.1
A_list = [int(N_A + i) for i in range(20) if A <= int(N_A+i)*0.08 < A+1]
B_list = [int(N_B + i) for i in range(20) if B <= int(N_B+i)*0.1 < B+1]
 
N_min = float('inf')
for i in B_list:
    if i in set(A_list) and i < N_min:
        N_min = i
if N_min == float('inf'):
    print(-1)
else:
    print(N_min)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
# b, c =
# a = int(input())
#n = str(input())
from math import floor
A, B = [int(i) for i in input().split()]

# 判定
inc = floor(A / 0.08)
inc_max = (A + 1) / 0.08

while(1):
    if inc >= inc_max:
        print(-1)
        break
    elif floor(inc * 0.1) == B and floor(inc * 0.08) == A:
        print(inc)
        break
    else:
        inc += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
a,b=map(int,input().split())
for i in range(10*b,15*b):
  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 = map(int,input().split())
for i in range(10000):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        break
    elif i == 9999:
        print(-1)

Submission status: Accepted

Solution code:
import math

a_b = list(map(int, input().split()))

a = a_b[0]
b = a_b[1]

#aを満たす範囲
a_min = math.ceil(a / 0.08)
a_max = math.ceil((a+1) / 0.08)

#bを満たす範囲
b_min = math.ceil(b / 0.10)
b_max = math.ceil((b+1) / 0.10)

for i in range(a_min, a_max):
  if i >= b_min and i < b_max:
    print(i)
    break
  else:
    pass
  if i == a_max - 1:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
r = '-1'
for i in range(10000):
	v = i + 1
	ax = int(v * 0.08)
	if ax == a:
		bx = int(v * 0.1)
		if bx == b:
			r = v
			break
print(r)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
a,b=map(int,input().split())
i=1
while i<100000:
    if i*0.08//1==a and i*0.1//1==b:
        print(i)
        exit()
    i+=1
print(-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.1) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
def solution():
    a, b = map(int, input().split())
    for i in range(1, 10000):
        if a == int(i * 0.08) and b == int(i * 0.1):
            print(i)
            return
    print('-1')

solution()