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 sys
# input = sys.stdin.readline
a,b = [int(c) for c in input().split()]
maxa = (a+1) / 0.08
maxb = (b+1) / 0.1
mina = a / 0.08
minb = b / 0.1
mmax = int(min(maxa,maxb)) - 1 if int(min(maxa,maxb))==min(maxa, maxb) else int(min(maxa,maxb))
mmin = int(max(mina,minb)) if int(max(mina,minb))==max(mina,minb) else int(max(mina,minb)) + 1
if mmin>mmax:
    print("-1")
else:
    print(mmin)

Submission status: Accepted

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


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

for x in range(min_x,max_x):
    if math.floor(x*0.08) == A and math.floor(x*0.1) == B:
        print(x)
        exit(0)
print(-1)

Submission status: Accepted

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


import math

X1=math.ceil(A/0.08)
X2=math.ceil(B/0.1)

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

if X1>Y2 or X2>Y1:
    print(-1)
else:
    print(max(X1,X2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
V = 10000
for i in range(1, 10001):
    a = math.floor(i*0.08)
    b = math.floor(i*0.1)
    if a == A and b == B:
        # print(a)
        # print(b)
        if V > i:
            V = i
        else:
            continue
    else:
        continue
if V == 10000:
    print(-1)
else:
    print(V)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
a_min = math.ceil(a/0.08)
b_min = math.ceil(b/0.1)
a_able = set(i for i in range(a_min, a_min+12))
b_able = set(i for i in range(b_min, b_min+10))
if a_able&b_able:
    print(min(a_able&b_able))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A, B =map(int, input().split())
a, b = math.ceil(A/0.08), math.ceil(B/0.10)
ans = max(a,b)
print (ans if int(ans*0.08)==A and int(ans*0.10)== B else -1)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(0,1009):
    ans_a=int(i*0.08)
    ans_b=int(i*0.1)
    if A==ans_a and B==ans_b:
        ans=i
        break
    ans=-1

print(ans)

Submission status: Accepted

Solution code:
import math
a = list(map(int, input().split()))
ans = [max([a[0] / 0.08, a[1] / 0.1]),
       min([(a[0] + 1) / 0.08, (a[1] + 1) / 0.1])]
if ((a[0]) / 0.08 >= (a[1] + 1) / 0.1) or (a[1] / 0.1 >= (a[0] + 1) / 0.08):
    print(-1)
else:
    if math.ceil(ans[0]) > ans[1]:
        print(-1)
    else:
        print(math.ceil(ans[0]))

Submission status: Accepted

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

for i in range(1, 1001):
    if A==int(i*8/100) and B==int(i*10/100):
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys
import os
import math

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(1, 1010):
        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 math

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

#税率8%の消費税から元値のリストを作る
#A*12.5（切り上げ）が元値の取りうる最小値
motone_8 = math.ceil(A*12.5)
#最小値から＋12した数に0.08かけてA+1以上か
if (motone_8 + 12) * 0.08 >= A+1:
    #以上なら該当値は12個
    gaitou_8 = 12
#下回ったら該当値は13個
else:
    gaitou_8 = 13

#最小値～最小値＋該当値-1までをリストにいれる
gaitou_list_8 = list(range(motone_8,motone_8 + gaitou_8))

#税率10%の消費税から元値のリストを作る
#B*10が元値の取りうる最小値
motone_10 = B*10

#最小値～最小値＋10までをリストにいれる
gaitou_list_10 = list(range(motone_10,motone_10 + 10))


#二つのリストの共通項を見つける
kyotu_list = set(gaitou_list_8) & set(gaitou_list_10)
#print(gaitou_list_8)
#print(gaitou_list_10)
#print(kyotu_list)

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

Submission status: Accepted

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

for i in range(1010):
    if int(i *0.08) ==a and int(i*0.1)==b:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

a_ = int(a / 0.08)
if a_ * 0.08 != float(a):
  a_ += 1

b_ = int(b / 0.1)
if b_ * 0.1 != float(b):
  b_ += 1

n = max(a_, b_)
if int(n * 0.08) == a and int(n * 0.1) == b:
    print(n)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
import sys
A, B = [int(i) for i in input().split()]
for i in range(math.ceil(12.5 * A), math.ceil(12.5 * (A + 1))):
    if math.floor(i//10) == B:
        print(i)
        sys.exit()
print(-1)

Submission status: Accepted

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

for i in range(1101):
  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:
a, b = map(int, input().split())
for x in range(1001):
    if int(x * 0.08) == a and int(x * 0.10) == b:
        print(x)
        break
else:
    print(-1)

Submission status: Accepted

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

a=int(A/0.08 + 0.5)
b=int(B/0.1 + 0.5)
out =0
"print(a,b)"
if a>=b:
    if math.floor(a*0.1) != B:
        out = -1
    else:
        out = int(a)
elif a<b:
    if math.floor(b*0.08) != A:
        out = -1
    else:
        out = int(b)
print(out)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
X = int((A/0.08)+0.5)
Y = int((B/0.1)+0.5)
min = 0

if X > Y:
    if int(X*0.1) == B:
        min = X
    else :
        min = -1
elif X < Y:
    if int(Y*0.08) == A:
        min = Y
    else :
        min = -1
else :
    min = X

print(min)

Submission status: Accepted

Solution code:
A, B = (int(x) for x in input().split())
A_min = A / 0.08
A_max = (A + 1) / 0.08
B_min = int(B / 0.10)
B_max = int((B + 1) / 0.10)
ans = '-1'

for i in range(B_min, B_max):
    if i >= A_min and i < A_max:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
num_data = input().split(' ')
num = [int(num_data[i]) for i in range(2)]
data = 1
key = 0
while(1):
    if(data * 8 // 100 ==num[0] and num[1] == data // 10):
        break
    data += 1
    if(data >= 1250):
        key = 1
        break

if(key == 1):
	print(-1)
else:
  	print(data)

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.readline
a,b = [int(c) for c in input().split()]
maxa = (a+1) / 0.08
maxb = (b+1) / 0.1
mina = a / 0.08
minb = b / 0.1
mmax = int(min(maxa,maxb)) - 1 if int(min(maxa,maxb))==min(maxa, maxb) else int(min(maxa,maxb))
mmin = int(max(mina,minb)) if int(max(mina,minb))==max(mina,minb) else int(max(mina,minb)) + 1
if mmin>mmax:
    print("-1")
else:
    print(mmin)

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
big = math.floor(max(A, B) / 0.08)
sma = math.floor(min(A, B) / 0.1)
num_list = [int(i) for i in range(sma - 1, big + 2)]

for i in num_list:
    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 copy
import math
import string
import heapq
import bisect
import sys
sys.setrecursionlimit(10**7)

A,B = map(int,input().split())
flag = 0
for i in range(100000):
    if(math.floor(i*0.08) == A and math.floor(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())
Anum = int((A/0.08)+0.5)
Bnum = int((B/0.1)+0.5)
check = 0
if Anum>Bnum:
    check=int(Anum*0.1)
    if check!=B:
        print('-1')
    else:
        print(Anum)
elif Anum<Bnum:
    check=int(Bnum*0.08)
    if check!=A:
        print('-1')
    else:
        print(Bnum)
else:
    print(Anum)

Submission status: Accepted

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

b_l = list(range(int(b/0.1), int((b+0.99)//0.1+1)))
for b_ in b_l:
  s = int(b_*0.08//1)
  if s==a:
    print(str(b_))
    exit(0)
print('-1')

Submission status: Accepted

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

#int(ans*0.08) = A
#int(ans*0.10) = B

ans = 1
for b in range(10*B, 10*B+10):
    if int(b*0.08) == A:
        print(b)
        ans = 0
        break

if ans:
    print(-1)

Submission status: Accepted

Solution code:
from math import floor

def dostuff():
    a, b = (int(x) for x in input().split(' '))

    x = b * 10
    for i in range(x, x + 10):
        if floor(i * 0.08) == a:
            print(i)
            return
    print(-1)

dostuff()

Submission status: Accepted

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

price=0
for i in range(10):
  price=10*B+i
  if int(price*0.08)==A:
    print(price)
    exit()

print('-1')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
Nmax = int(100//0.08)
ans = -1
for N in range(1, Nmax + 1):
    ja = int(N * 0.08)
    jb = int(N * 0.1)
    if ja == A and jb == B:
        ans = N
        break
    else:
        pass
print(ans)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
cmin=a/0.08
cmax=(a+1)/0.08
dmin=b/0.1
dmax=(b+1)/0.1

#print(cmin,cmax)
#print(dmin,dmax)
if (cmin>=dmax or cmax<=dmin):
  print(-1)
else:
  if (cmin<dmin):
    print(math.ceil(dmin))
  elif (dmin<=cmin):
    print(math.ceil(cmin))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
A0=[100*A/8,100*(A+1)/8]
B0=[100*B/10,100*(B+1)/10]
S0=max(A0[0],B0[0])
S1=min(A0[1],B0[1])
if int(S0)>=S0 and int(S0)<S1:
    print(int(S0))
elif int(S0)+1<S1:
    print(int(S0)+1)
else:
    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:
A,B = map(int,input().split())
flag = 0
for i in range(1,1001,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:
# problem C
A,B = map(int,input().split())
ans = []

for i in range(1,1001):
    x = int(i * 0.08)
    y = int(i * 0.10)
    if x == A and y == B:
        ans.append(i)
    else:
        pass
if len(ans) == 0:
    print(-1)
else:
    print(ans[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
import math
c = math.ceil(a/0.08)
d = round(b/ (0.1))
e = math.ceil((a+1)/0.08)-1
f = round((b+1)/0.1)-1
i = c
j = -1
for i in range(c,e+1):
    if d <= i <= f:
        j = i
        break
    else:
        i = i+1
print(j)

Submission status: Accepted

Solution code:
import math

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

ans =  -1

for i in range(2000):
    if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans=-1
for i in range(1251):
  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())

import math
mina = math.ceil(a*12.5) #自身も含まれる
minb = b*10 #自身も含まれる
maxa = math.ceil((a+1)*12.5) #自身は含まれない
maxb = (b+1)*10 #自身は含まれない
minab = max([mina, minb])
maxab = min([maxa, maxb])

if minab >= maxab:
    ans = -1
else:
    ans = minab

print(ans)

Submission status: Accepted

Solution code:
import math

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

pricemax_A = math.floor((A+1)/0.08)
pricemin_A = math.ceil(A/0.08)

pricemax_B = math.floor((B+1)/0.1)
pricemin_B = math.ceil(B/0.1)

if pricemin_A >= pricemin_B and pricemin_A < pricemax_B:
    print(pricemin_A)
elif pricemin_A <= pricemin_B and pricemax_A > pricemin_B:
    print(pricemin_B)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
A,B=[int(s) for s in input().split(" ")]
list=[]
for i in range(1010):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
            list.append(i)
list.sort()

print(-1 if list==[] else list[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
flag = False
for i in range(1, 1010):
    eig = int(i * 0.08)
    ten = int(i * 0.1)
    if eig == a and ten == b:
        flag = True
        break

print(i if flag == True else '-1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

ans = 0

for i in range(1900):
    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:
def calc_range(x, rate):
    return -(-x//rate), -(-(x+1)//rate)

a,b = list(map(int, input().split()))
a_min, a_max = calc_range(a, 0.08)
b_min, b_max = calc_range(b, 0.10)
if b_max <= a_min or a_max <= b_min:
    print(-1)
elif a_min <= b_min:
    print(int(b_min))
elif b_min < a_min:
    print(int(a_min))

Submission status: Accepted

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

ans = -1
for x in range(10*b, 10*(b+1)):
    if 25/2*a <= x < 25/2*(a+1):
        ans = x
        break
print(ans)

Submission status: Accepted

Solution code:
import math
count = 0
a, b = map(int, input().split())
k = 10 * b
while 10 * b <= k < 10*b + 10:
  if math.floor(0.08 * k) == a:
    print(k)
    count += 1
    break
  else:
    k += 1

if count == 0:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /PycharmProjects/atcoder/C-TaxIncrease.py
#
A, B = map(int, input().split())
ans = -1
for i in range (1000 + 1):
    if (int(i*0.08) == A) and (int(i*0.10) == B):
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
start = 0
if a < b:
    start = math.ceil(a * 12.5)
else:
    start = math.ceil(b * 10)

flg = False
for i in range(start, 1009):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        flg = True
        print(i)
        break

if not flg:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
while ans <= 1000:
    if (int(ans*0.08) == A) and (int(ans*0.10) == B):
        print(ans)
        break
    else:
        ans += 1
else:
    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.10) == B:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

for price in range(10, 1263):
    if int(price * 0.08) == A and int(price * 0.1) == B:
        print(price)
        exit()

print(-1)

Submission status: Accepted

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

if (12.5*a)<=(10*b) and (12.5*(a+1))>(10*b):
  print(int(10*b))
elif a%2==0 and (10*b)<=(12.5*a) and (10*(b+1))>(12.5*a):
  print(int(12.5*a))
elif a%2==1 and (10*b)<=(12.5*a) and (10*(b+1))>((12.5*a)+0.5):
  print(int((12.5*a)+0.5))
else:
  print(-1)

Submission status: Accepted

Solution code:
A,B = list(map(int,input().split()))
C = []
for i in range(A*14):
  if A * 12.5 <= i < (A+1) * 12.5 and B * 10 <= i < (B+1) * 10:
    C.append(i)
if len(C) == 0:
  print('-1')
else:
  print(min(C))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
import math
a=math.ceil(A*100/8)
b=math.ceil((A+1)*100/8)
while math.floor(a*0.1)!=B and a<b:
  a+=1
if a==b:
  print(-1)
else:
  print(a)

Submission status: Accepted

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

l = a / 0.08
u = int((a+0.99) / 0.08)

if l == int(l):
    l = int(l)
else:
    l = int(l) + 1

i = l
while i <= u:
    if int(i * 0.1) == b:
        break
    else:
        i += 1
if i <= u:
    print(i)
else:
    print("-1")

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
Amin, Amax, Bmin, Bmax = A/0.08, (A+1)/0.08, B/0.1, (B+1)/0.1
min_price = int(max(Amin, Bmin))
if min_price != max(Amin, Bmin):
    min_price += 1
max_price = int(min(Amax, Bmax))
if max_price == min(Amax, Bmax):
    max_price -= 1
if min_price > max_price:
    print("-1")
else:
    print(min_price)

Submission status: Accepted

Solution code:
import math
A,B = list(map(int,input().split()))
A_ans_mini = math.ceil(A/0.08)
A_ans_max = math.floor((A+0.9999)/0.08)
B_ans_mini = math.ceil(B/0.1)
B_ans_max = math.floor((B+0.9999)/0.1)
if A_ans_max <B_ans_mini or B_ans_max < A_ans_mini:
    print("-1")
else:
    if B_ans_mini<A_ans_mini:
        ans = A_ans_mini
    else: ans = B_ans_mini
    print(int(ans))

Submission status: Accepted

Solution code:
import sys

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

print("-1")

Submission status: Accepted

Solution code:
import math
eight,ten = map(int,input().split())
dummy = 10*ten
flag = "ng"
for i in range(dummy,dummy+10):
  if math.floor(i*0.08) == eight:
    flag = "ok"
    ans = i
    break
if flag == "ok":
  print(ans)
else:
  print(-1)

Submission status: Accepted

Solution code:
import sys

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

for yen in range(0,1251):
    if (int(yen*0.08) == A and int(yen*0.1) == B):
        print(yen)
        sys.exit()

print(-1)

Submission status: Accepted

Solution code:
def main():
    a,b=map(int,input().split())
    z=b*10+9 
    y=None
    while z//10==b:
        if z*8//100==a:
            y=z
        z-=1
    if y is None:
        print(-1)
    else:
        print(y)
main()

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
Al = math.ceil(A / 0.08)
Au = int((A + 0.99) // 0.08) + 1
Bl = math.ceil(B / 0.1)
Bu = int((B + 0.9) // 0.1) + 1
Ar = [x for x in range(Al, Au)]
Br = [y for y in range(Bl, Bu)]
X = set(Ar) & set(Br)
print(-1 if list(X) == [] else min(X))

Submission status: Accepted

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

y = b*10

for i in range(10):
    if math.floor( (y + i) * 0.08 ) == a:
        print(y+i)
        sys.exit()

print(-1)

Submission status: Accepted

Solution code:
def main(a, b):
    for i in range(10000):
        if int(i * 0.08) == a and int(i * 0.1) == b:
            print(i)
            return

    print(-1)


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

    main(a, b)

Submission status: Accepted

Solution code:
from math import floor

# 入力値の取得
A, B = map(int, input().split())

# 問題の制約から、答えの候補としてあり得る範囲をチェック
# for _ in range(1010)で０〜１００９までのループが使える
for price in range(1010):
    if (floor(price * 0.08) == A) and (floor(price * 0.1) == B):
        # 条件を満たしたのでその金額を表示して終了
        # （小さい金額から順番にみていくので、最初に条件を満たしたものが、
        # 　条件を満たす金額のうちで最小の金額になる。）
        print(price)
        quit()

# 条件を満たすものが見つかっていれば、プログラムが終了するので、
# ここまで実行される時は、条件を満たす金額が存在しないということなので、
# 条件を満たす金額が存在しない時に表示すべき -1 を表示する。
# 最小行なので、quit()しなくてもプログラムが終了する
print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1, 1001):
    if i * 8 // 100 == a and i * 10 // 100 == b:
        ans = i
        break
else:
    ans = -1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Amin = A/0.08
if Amin != int(Amin):
  Amin = int(Amin)+1
else:
  Amin = int(Amin)

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

rangea = set(range(Amin,int((A+1)/0.08),1))
rangeb = set(range(Bmin,int((B+1)/0.10),1))

intersection = rangea & rangeb

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
def calc(A, B):
  Amin = A/0.08
  if (Amin - int(Amin)) != 0.:
    Amin = int(Amin)+1
  else:
    Amin = int(Amin)
  Amax = int((A+1)/0.08)
  Arange = set(range(Amin, Amax))
  Bmin = B/0.1
  if (Bmin - int(Bmin)) != 0.:
    Bmin = int(Bmin)+1
  else:
    Bmin = int(Bmin)
  Bmax = int((B+1)/0.1)
  Brange = set(range(Bmin, Bmax))
  intersection = Arange & Brange
  print(-1) if len(intersection) == 0 else print(min(intersection))
calc(A, B)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())

for i in range(10000):
    p = int(i * 0.08)
    q = int(i * 0.1)
    if p == x and q == y:
        print(i)
        break
    elif i == 9999:
        print(-1)

Submission status: Accepted

Solution code:
import math
tax_eight, tax_ten = map(int, input().split())
min_eight_price = math.ceil(tax_eight / 0.08)
max_eight_price = math.floor((tax_eight + 1) / 0.08 - 1)
min_ten_price = tax_ten / 0.1 
max_ten_price = (tax_ten + 1) / 0.1 - 1
min_price = max(min_eight_price, min_ten_price)
max_price = min(max_eight_price, max_ten_price)
if max_price < min_price:
    print(-1)
else:
    print(int(min_price))

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split(" "))
for n in range(100000):
    n += 1
    if math.floor(n*0.08) == a and math.floor(n*0.1) == b:
        print(n)
        break
    else:
        if n == 100000:
            print(-1)

Submission status: Accepted

Solution code:
from sys import exit

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

Submission status: Accepted

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

def check(n, a, b):
    if int(n*0.08) == a and int(n*0.1) == b:
        return "1"
    else:
        if int(n*0.08) > a or int(n*0.1) > b:
            return "imp"
        return "0"

x1 = int(a/0.08)
x2 = int(b/0.1)
temp = max(x1,x2)
stat = "0"
while stat != "imp":
    stat = check(temp,a,b)
    if stat == "1":
        break
    else:
        temp += 1

if stat == "imp":
    print(-1)
else:
    print(temp)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
f=0
for i in range(int(m/0.1),int(m/0.1)+10):
    if int(i*0.08)==n:
        print(i)
        f=1
        break
if not f:
    print(-1)

Submission status: Accepted

Solution code:
a = [list(map(int, s.split())) for s in open(0)] [0]
for i in range(1, 1009):
    if (i * 0.08 >= a[0]) and (i * 0.08 < a[0] + 1) and (i * 0.1 >= a[1]) and (i * 0.1 < a[1] + 1):
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

ans = -1
for i in range(1,1010):
    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(1,1010):
  if (int(i*0.08)==A)&(int(i*0.1)==B):
    print(i)
    break
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor, ceil

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

min1 = ceil(A / 0.08)
max1 = floor((A+0.999) / 0.08)
min2 = ceil(B / 0.1)
max2 = floor((B+0.999) / 0.1)

if min1 >= min2 and min1 <= max2:
    print(min1)
elif min2 >= min1 and min2 <= max1:
    print(min2)
else:
    print(-1)

Submission status: Accepted

Solution code:
A,B =map(int,input().split())
 
# 元の価格ｘ,8%  y、１０％
import math
x = math.ceil(A/0.08)
x_1 = math.ceil((A+1)/0.08 )
y = math.ceil(B/0.1)
y_1 = math.ceil( (B+1)/0.1 )

x_2 = {i for i in range(int(x),int(x_1) ) }
y_2 = {i for i in range(int(y),int(y_1) ) }
moto_nedan = x_2 & y_2
if len(moto_nedan) == 0:
    print("-1")
else:
    print(min(moto_nedan))

Submission status: Accepted

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

from math import ceil

def check(a, b, x):
    if int(x * 0.08) != a or int(x * 0.1) != b:
        return -1
    return x

def prob_c(a, b):
    yasu = ceil(a * 100 / 8)
    taka = ceil(b * 100 / 10)
    ans = int(check(a, b, max(yasu, taka)))
    print(ans)

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

Submission status: Accepted

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

tax10_list = []
list = []
count = 0

for i in range(10):
    tax10_list.append(math.floor(tax10*10+i))

for x in range(10):
    if math.floor(tax10_list[x] * 0.08) == tax8:
        print(tax10_list[x])

        break
    else:
        count += 1

if count == 10:
    print("-1")
else:
    None

Submission status: Accepted

Solution code:
def C158():
    A, B = [int(_) for _ in input().split()]
    N = 1
    while N <= 10000:
        if int(N * 8/100) == A and int(N * 10/100) == B:
            break
        N += 1
    if N <= 10000:
        print(N)
    else:
        print(-1)
        
if __name__ == "__main__":
    C158()