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=(int(x) for x in input().split())
a_1=int(a*12.5+0.999999)
a_2=int((a+1)*12.5)
list_a = []
for i in range(a_1,a_2):
	list_a.append(i)

b_1=int(b*10+0.999999)
b_2=int((b+1)*10)
list_b = []
for i in range(b_1,b_2):
	list_b.append(i)
li_a_b = set(list_a) & set(list_b)
if len(li_a_b) ==0:
	print(-1)
else:
	print(min(li_a_b))

Submission status: Accepted

Solution code:
import math

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

la = A/0.08
ra = (A+1)/0.08
lb = B/0.1
rb = (B+1)/0.1

ans = math.ceil(max(la, lb))
if ra <= lb or rb <= la:
  print(-1)
else:
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
import math

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
#x * 0.08 = a
#x * 0.1 = b

xa = int(a/0.08)
xb = int(b/0.1)

ans = -1
x = min(xa, xb)
for i in range(-20, 30):
  x_tmp = x + i
  #print(x_tmp, int(x_tmp*0.08), int(x_tmp*0.1))
  if int(x_tmp*0.08)==a and int(x_tmp*0.1)==b:
    ans = x_tmp
    break

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

Submission status: Accepted

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

print("-1")

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a,b = m()

aaa = -(-a * 100 // 8)

aa = (a+1) * 100 // 8

bbb = -(-b * 100 // 10)

bb = (b+1) * 100 // 10


p = set(range(aaa,aa))
pp = set(range(bbb,bb))

ppp = p & pp

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

Submission status: Accepted

Solution code:
import math
# print(math.ceil(float_var)) 切り上げ
# print(math.floor(float_var)) 切り捨て
a,b = map(int,input().split())
a_st = math.ceil(a /0.08) 
a_ed = math.ceil((a+1) /0.08) #含まない
b_st = 10*b
b_ed = 10*(b+1) #含まない
a_lis = list(range(a_st,a_ed))
b_lis = list(range(b_st,b_ed))
aandb = list(set(a_lis) & set(b_lis))
if len(aandb) == 0:
    print('-1')
else:
    print(min(aandb))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(A: int, B: int):
    
    from math import floor, ceil
    ans = []
    for i in range(1, 20000):
        if floor(i*0.08) == A and floor(i*0.1) == B:
            ans.append(i)

    ans.sort()
    # print(ans)
    if len(ans) != 0:
        print(ans[0])
    else:
        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:
import sys
input = sys.stdin.readline


def main():
    a, b = map(int, input().split())
    for i in range(1250+1):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)
        if a == a_ and b == b_:
            print(i)
            return
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print("-1")

Submission status: Accepted

Solution code:
import math
import sys 
a, b = map(int,input().split())
# ans1 = math.ceil(a/0.08)
# ans2 = math.ceil(b/0.1)
# if ans1 == ans2:
#     print(ans1)
# elif ans1 > ans2:

for i in range(1001):
    ans1 = math.floor(i*0.08)
    ans2 = math.floor(i*0.1)
    if (ans1 == a) & (ans2 == b):
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
#print((A + 1) / 0.08)
ans = -1
for i in range(int(B / 0.1), int((A + 1) / 0.08)):
  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 x in range(max(int(12.5 * A), int(10 * B)), min(int(12.5 * A + 12.5), int(10 * B + 10)) + 1):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        break
else: print(-1)

Submission status: Accepted

Solution code:
info = [int(i) for i in input().split()]
_min = max(int(info[0]*12.5), int(info[1]*10))
_max = min(int((info[0]+1)*12.5), int((info[1]+1)*10))
for i in range(_min, _max):
    if int(0.1*i)==info[1] and info[0]== int(0.08*i):
        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 ans>0:
        break
    x=i*0.08
    x=int(x)
    if x==A:
        y=i*0.1
        y=int(y)
        if y==B:
            ans=i


if ans<0:
    print("-1")
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

flag = 0

for i in range(10**4+1):
    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=map(int,input().split())
def z(n):
    d=0
    while n>=1:
        d+=1
        n-=1
    return d

def x(n):
    d=0
    while n>1:
        d+=1
        n-=1
    return d+1

an=[]
a1=a*12.5
a2=(a+0.99999999999)*12.5
b1=b*10
b2=(b+0.99999999999)*10
for i in range(x(a1),z(a2)+1):
    an.append(i)



ans=-1
for i in range(x(b1),z(b2)+1):
    if i in an:
        ans=i
        break
print(ans)

Submission status: Accepted

Solution code:
# Problem C - Tax Increase

import math

# input process
A, B = map(int, input().split())
ans_list = []

for i in range(1, 1500):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        ans_list.append(i)

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

Submission status: Accepted

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

mi = max(amin, bmin)
ma = min(amax, bmax)

if mi > ma:
  print(-1)
else:
  print(int(mi))

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
start=0
end=1000000
ans=1000000
while start<=end:
    mid=(start+end)//2
    aa=math.floor(mid*0.08)
    bb=math.floor(mid*0.1)
    if aa==a and bb==b:
        ans=min(ans,mid)
        # exit()
        end=mid-1
    elif aa>a or bb>b:
        end=mid-1
    else:
        start=mid+1 
if ans==1000000:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
N = 10000

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

set_a = set()
set_b = set()

for x in range(N):
  if int(x * 0.08) == A:
    set_a.add(x)
  if int(x * 0.1) == B:
    set_b.add(x)
    
print(min(set_a & set_b)) if set_a & set_b else print(-1)

Submission status: Accepted

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

a_min=math.ceil(A/0.08)
b_min=math.ceil(B/0.1)
a_list=[]
b_list=[]

for i in range(a_min,a_min+12):
  a_list.append(i)
for j in range(b_min,b_min+10):
  b_list.append(j)
  
ans=-1
for item in a_list:
  if item in b_list:
    ans=item
    break
  
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
 
def check(X):
  global A
  global B
  return (int)(X*0.08) == A and (int)(X*0.1) == B
 
for x in range(1, max(A, B)*20):
  if check(x):
    print(x)
    exit(0)
 
print(-1)

Submission status: Accepted

Solution code:
def main(a,b):
    a1 = a / 0.08
    a2 = (a+1) / 0.08
    b1 = b / 0.1
    b2 = (b+1) / 0.1
    x = max(a1,b1)
    y = min(a2,b2)
    if (y <= x):
        return -1
    else:
        if(x//1 == x):
            return x
        elif(y > (x//1)+1):
            return x+1
    return -1


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

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

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

def calc_price(mina,maxa,minb,maxb):
    if mina >= maxb or minb >= maxa:
        return -1
    else:
        price = max(mina, minb)
        return math.ceil(price)

print(calc_price(mina,maxa,minb,maxb))

Submission status: Accepted

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

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

Submission status: Accepted

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

minans = int(a / 0.08)

if minans > int(b / 0.1):
    minans = int(b / 0.1)

for i in range(minans, 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())
answer=-1
for i in range(10):
    if (b*10+i)*0.08>=a and (b*10+i)*0.08<a+1:
        answer=b*10+i
        break
print(answer)

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.10 // 1 == B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

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

x1=-(-a//0.08)
x2=-(-(a+1)//0.08)-1
y1=-(-b//0.10)
y2=-(-(b+1)//0.10)-1

if x1<=y1 and y1<=x2:
    print(int(y1))

elif y1<=x1 and x1<=y2:
    print(int(x1))


else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = float('inf')
for i in range(1400):
    # print(int(i*0.08), int(i*0.1))
    if a == int(i*0.08) and b == int(i*0.1):
        ans = i
        break

if ans == float('inf'):
    print(-1)
else:
    print(ans)

Submission status: Accepted

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

flag = False
for i in range(1251):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        flag = True
        break
if flag == False:
    print(-1)

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
answer=-1
for price in range(1,1251):
    if price*8//100==a and price*10//100==b:
        answer=price
        break
print(answer)

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
a1 = round(a/0.08)
b1 = round(b/0.1)
c = min(a1,b1)
while True:
	if math.floor(c*0.08) == a and math.floor(c*0.1) == b:
		print(c)
		break
	elif math.floor(c*0.08) > a and math.floor(c*0.1) > b:
		print(-1)
		break
	else:
		c+=1

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
bt = b * 10
ans = -1
for i in range(10):
    ad = int((bt+(9-i))*0.08)
    if ad == a:
        ans = bt+(9-i)

print(ans)

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
flag = False
for i in range(1,10001):
    ans1 = math.floor(i*0.08)
    ans2 = math.floor(i*0.1)
    if ans1==a and ans2==b:
        ans = i
        flag = True
        break
if flag == True:
    print(ans)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
K = [i for i in range(10, 1251)]
ans = -1
for k in K:
    if math.floor(k*0.08) == a and math.floor(k*0.1) == b:
        ans = k
        break
print(ans)

Submission status: Accepted

Solution code:
#At coder 2020/3/8 C
import math

I = list(map(int, input().split())) 
A=I[0]
B=I[1]

a1=A/0.08
b1=B/0.1

a2=(A+1)/0.08
b2=(B+1)/0.1

af=math.ceil(a1)
ac=math.ceil(a2)
bf=math.ceil(b1)
bc=math.ceil(b2)

if ac<=bf or bc<=af:
    ans=-1
else:
    ans=max(af,bf)
#print(af,ac,bf,bc)
print(ans)

Submission status: Accepted

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

#8% -> A円, 10% -> B円 の追加


n_max_fromA = 100*(A+1) // 8
n_min_fromA = 100*A // 8

n_max_fromB = 100*(B+1) // 10
n_min_fromB = 100*B // 10

ans_min = max(n_min_fromA, n_min_fromB)
ans_max = min(n_max_fromA, n_max_fromB)

ans_tmp = ans_min
ans = -1
while ans_tmp <= ans_max:
    tax_8 = int(ans_tmp*0.08)
    tax_10 = int(ans_tmp*0.1)

    if tax_8 == A and tax_10 == B:
        ans = ans_tmp
        break

    ans_tmp += 1

print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


tax_8, tax_10 = map(int, input().split())

min_8 = math.ceil(tax_8 * 100 / 8)
limit_8 = math.ceil((tax_8 + 1) * 100 / 8)

min_10 = tax_10 * 100 // 10
limit_10 = (tax_10 + 1) * 100 // 10

target = max(min_8, min_10)

if target < limit_8 and target < limit_10:
    print(target)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
lista = []
listb = []
pa1 = math.ceil(a * 12.5)
pa2 = math.ceil((a+1) * 12.5)
pb1 = int(b * 10)
pb2 = int((b+1) * 10)
for i in range(pa1, pa2) :
    lista.append(i)
for j in range(pb1, pb2) :
    listb.append(j)
aandb = set(lista)&set(listb)
if len(aandb) == 0 :
    print("-1")
else :
    print(min(aandb))

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline

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

    if a % 2 == 0:
        lis_a = [i for i in range(int(12.5 * a), int(12.5 * a)+13)]
    else:
        lis_a = [i for i in range(int(12.5 * a + 1), int(12.5 * a + 12.5))]
    lis_b = [i for i in range(int(10 * b),int(10*b)+10)]
    a_new = set(lis_a)
    b_new = set(lis_b)
    c = list(a_new & b_new)
    if len(c) > 0:
        print(min(c))
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def aaaa(h):
    if h == int(h):
        return int(h)
    else:
        return int(h) + 1

a, b = map(int, input().split())
s = [a / 0.08, (a + 1) / 0.08]
r = [b / 0.1, (b + 1) / 0.1]

for i in range(aaaa(s[0]), aaaa(s[1])):
    for j in range(aaaa(r[0]), aaaa(r[1])):
        if i == j:
            print(i)
            exit()

print(-1)

Submission status: Accepted

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

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

xa = math.ceil(a / 0.08)
xb = math.ceil(b / 0.10)
if xa >= xb:
    xmin = xa
else:
    xmin = xb

ya = math.ceil((a + 1) / 0.08)
yb = math.ceil((b + 1) / 0.10)
if ya <= yb:
    xmax = ya
else:
    xmax = yb

if xmax <= xmin:
    print(-1)
else:
    print(xmin)


# a <= x * 0.08 < a + 1
# b <= x * 0.10 < b + 1

# a / 0.08 <= x < (a + 1) / 0.08
# b / 0.10 <= x < (b + 1) / 0.10

Submission status: Accepted

Solution code:
A,B=list(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:
import sys


def input():
    return sys.stdin.readline()[:-1]


def main():
    A, B = map(int, input().split())
    if A > B:
        print(-1)
        exit()
    for n in range(int(A / 0.08)-10, 10 * B + 10):
        if int(n * 0.08) == A and int(n * 0.1) == B:
            print(n)
            exit()
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main():
    A,B=map(int, input().split())
    X=[]
    for i in range(1,1001):
        if math.floor(i * 0.08) == A:
            X.append(i)
    for x in X:
        if math.floor(x * 0.10) == B:
            print(x)
            return
    print(-1)
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

doTest=0

def yn(n):
    if n==1:
        print("Yes")
    else:
        print("No")
    return

def resolve():
    readline=sys.stdin.readline

    a,b=list(map(int, readline().strip().split()))

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

    return

if doTest==0:
    resolve()
    sys.exit()

Submission status: Accepted

Solution code:
from math import floor
def main():
    a, b = map(int, input().split())
    r = -1
    for i in range(b * 10, (b + 1) * 10 + 1):
        if floor(i * 0.08) == a and floor(i * 0.1) == b:
            r = i
            break


    print(r)
main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans_A_kouho = []
A_kouho_start = int(A / 0.08)

i = A_kouho_start
while int(i * 0.08) <= A:
  if int(i * 0.08) == A:
    ans_A_kouho.append(i)
  i += 1

#print(ans_A_kouho)
ans = -1
for ans_kouho in ans_A_kouho:
  if int(ans_kouho * 0.1) == B:
    ans = ans_kouho
    break

print(ans)

Submission status: Accepted

Solution code:
import math


def main():
    a, b = map(int, input().split(" "))
    # eight = a // 0.08
    # ten = b // 0.1
    # print("%d %d" % (eight, ten))
    # if eight == ten:
    #     print("%d" % eight)
    # else:
    #     print("-1")
    for i in range(1, 1001):
        eight = math.floor(i * 0.08)
        ten = math.floor(i * 0.1)
        if eight == a and ten == b:
            print(i)
            return
    print("-1")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#ABC158 C - Tax Increase

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

a = B * 10
b = (B+1) * 10

flag = False
for i in range(a,b):
    if((int)(i*0.08) == A):
        flag = True
        print(i)
        break

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

Submission status: Accepted

Solution code:

#####

import numpy as np
from numpy import newaxis, float32, float64, int32, int64, int16, int8, uint8, uint32, complex64, complex128

#####

def getIntList(inp):
	return [int(_) for _ in inp]


from sys import stdin
import sys

def getInputs():
	inputs=[]
	for line in stdin:
		line=line.split()
		inputs.append(line)
	return inputs


def main(inputs):
	a8,b10=getIntList(inputs[0])
	
	min8=int(np.ceil(a8/0.08))
	max8=int(a8/0.08+12)
	min10=b10*10
	max10=b10*10+9
	
	for i8 in range(min8, max8+1):
		if i8>=min10 and i8<=max10:
			print(i8)
			sys.exit(0)
	print(-1)

if __name__=="__main__":
	inputs=getInputs()
# 	inputs=simInputs()
	main(inputs)

Submission status: Accepted

Solution code:
import math

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

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

if flag:
    print("-1")

Submission status: Accepted

Solution code:
import math
A, B = [int(s) for s in input().split()]
max_price = 100000
found = False
for i in range(max_price):
  ii = i+1
  priceA = math.floor(ii*0.08)
  priceB = math.floor(ii*0.1)
  if priceA == A and priceB == B:
    print(ii)
    found = True
    break
if found == False:
  print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for i in range(10**6):
    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 = 1
a = 0
b = 0
while b <= 100:
    a = int(n * 0.08)
    b = int(n * 0.10)
    if a == A and b == B:
        print(n)
        break
    n += 1
else:
    print(-1)

Submission status: Accepted

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

ans = 10**9
for i in range(1, 1101):
    if (i*8)//100 == a and (i*10)//100 == b:
        ans = min(ans, i)
if ans == 10**9:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
from math import floor
a, b = map(int, input().split())
x1 = a/0.08
x2 = b/0.1
max_ = max(int(x1), int(x2)) + 100
min_ = min(int(x1), int(x2)) - 100

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

for i in range(B*10, B*10+10):
  if int(i*0.08) == A:
    print(i)
    break
else:
  print('-1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

for i in range(1, 10 ** 6):
    if int(i * 0.08) == a and int(i * 0.10) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

a = set(range(int(A / 0.08), int((A + 1) / 0.08)))
b = set(range(int(B / 0.1), int((B + 1) / 0.1)))
if abs(A / 0.08 - int(A / 0.08)):
    a.remove(int(A / 0.08))
print(min(a & b)) if a & b else print(-1)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())		# 5 7 2

ans=-1

for i in range(1,1001):
	a = int(i * 0.08)
	if A!=a: continue
	
	b = int(i * 0.1)
	if B!=b: continue
	
	ans=i
	break

print(ans)

Submission status: Accepted

Solution code:
import math

i = list(map(int, input().split()))
A = i[0]
B = i[1]

A_min = math.ceil(float(A)/0.08)
A_max = math.floor(float(A+1)/0.08)

A_list = [i for i in range(A_min, A_max)]

B_min = math.ceil(float(B)/0.10)
B_max = math.floor(float(B+1)/0.10)

B_list = [i for i in range(B_min, B_max)]

A_set = set(A_list)
B_set = set(B_list)
matched_list = sorted(list(A_set & B_set))

if matched_list != []:
    print(matched_list[0])
else:
    print(-1)

Submission status: Accepted

Solution code:
from sys import stdin
a,b = [int(x) for x in stdin.readline().rstrip().split()]
x = a * 25 // 2
if a % 2 == 1:
    x += 1
y = b * 10
ant = 0
while int(x * 0.08) == a:
    if int(x * 0.1) == b:
        ant = 1
        print(x)
        break
    x += 1
if ant == 0:
    print(-1)

Submission status: Accepted

Solution code:
import math
A,B= map(int, input().split())
for i in range(1,100*1000):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        exit()
    else:
        pass

print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
#import numpy as np
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
A, B = map(int, input().split())

i = 1
while math.floor(i*0.08) <= A and math.floor(i*0.1) <= B :
  if math.floor(i*0.08) == A and math.floor(i*0.1) == B :
    print (i)
    exit()
  i += 1
print (-1)

Submission status: Accepted

Solution code:
from sys import exit
A, B = map(int,input().split())
for i in range(20000):
  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())
bl=int(b/0.1)
bh=int((b+1)/0.1)

ans=-1
for x in range(bl,bh)[::-1]:
  y=x*0.08
  if a<=y and y<a+1:
    ans=x

print(ans)

Submission status: Accepted

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

for i in range (1,1001):
    a1 = math.floor(i*0.08)
    b1 = math.floor(i*0.1)
    if a1 == a and b1 == b:
        print(i)
        flag += 1
        break

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

Submission status: Accepted

Solution code:
import sys
a, b = map(int, input().split())
resa_min = int(-(-a//0.08))
resa_max = int(-((-a-1)//0.08))
resb_min = int(-(-b//0.1))
resb_max = int(-((-b-1)//0.1))
al = range(resa_min, resa_max)
bl = range(resb_min, resb_max)
for i in al:
    for j in bl:
        if i == j:
            print(i)
            sys.exit()
print(-1)

Submission status: Accepted

Solution code:
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

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

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

print(-1)

Submission status: Accepted

Solution code:
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    a,b = map(int, input().split())
    x1 = ceil(a*12.5)
    x2 = ceil((a+1)*12.5) - 1
    y1 = b*10
    y2 = (b+1)*10 - 1
    if x2<y1 or y2<x1:
        print(-1)
    elif x1>=y1:
        print(x1)
    else:
        print(y1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(-1)

Submission status: Accepted

Solution code:
import math

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

c = b*10
i = 0
flag = False
while i<10:
    if math.floor(0.08*c)==a:
        ans = c
        flag = True
        break
    c += 1
    i += 1

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

Submission status: Accepted

Solution code:
def resolve():
    a, b = map(int, input().split())
    j=-1
    for i in range(1263):
        c = i*0.08//1
        d = i*0.1//1
        if c==a and d==b:
            j=i
            break
    print(j)
resolve()

Submission status: Accepted

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