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: Wrong Answer

Solution code:
import sys
import math

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

for i in range(1, 101):
    eat_in = math.floor((i * 0.08)*100) // 100
    eat_out = math.floor((i * 0.1)*100) // 100
    if eat_in == a and eat_out == b:
        print(i)
        sys.exit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
for i in range(1, 101):
    if a == math.floor(i * 0.08):
        for j in range(1, 101):
            if b == math.floor(j * 0.1):
                if i == j:
                    break
        else:
            continue
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

n = int((a/0.08)//1)
ans = -1

for i in range(n,n+10**4):
  if int((i*0.08)//1) == a and int((i*0.1)//1) == b:
    ans = i
    break
  elif int((i*0.08)//1) != a:
    break
  else:
    continue

print(ans)

Submission status: Wrong Answer

Solution code:
from math import floor

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

x1b = round(100 * A / 8)
x2b = round(10 * B)

x1t = floor(100 * (A + 1) / 8 - 0.0001)
x2t = floor(10 * (B + 1) - 0.0001)

if (x2b <= x1t and x1b <= x2t) or (x1b <= x2t and x2b <= x1t):
    print(max(x1b, x2b))
else:
    print('-1')

Submission status: Wrong Answer

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

result_a0 = A / 0.08
result_a1 = (A+1) / 0.08
result_b0 = B / 0.1
result_b1 = (B+1) / 0.1

# print(f"result_a0:{result_a0} result_a1:{result_a1} result_b0:{result_b0} result_b1:{result_b1}")
# print(f"int: result_a:{int(result_a0)} result_a1:{int(result_a1)} result_b:{int(result_b0)} result_b1:{int(result_b1)}")

### a と b がかぶっていない、または a と b のかぶっている間に整数が存在しないというパターンをフォローしたい
if result_a1 < result_b0 or (int(result_a0 - result_b0) < 1 and int(result_a0) != int(result_b0)): 
    print("-1")
else:
    print(int(max(result_a0, result_b0)))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
ta = a / 0.08
tb = b / 0.10
if (int(ta * 0.1) == b):
  print(round(ta))
elif (int(tb * 0.08) == a):
  print(round(tb))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:

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

aa = A / 0.08
bb = B / 0.1


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

Submission status: Wrong Answer

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

x = int(a/0.08)
y = floor(x*0.1)
print(x)
print(y)
if y == b:
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from sys import stdin

def main():

    input = stdin.readline

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

X = a*100/8

Y = b*10

def aaa(n):
	temp = n
	temp = temp//1
	if n != temp:
		return False
	else:
		return True
#print(X,Y)
ok = []
if aaa(X) and X>0:
	if aaa(Y) and Y>0:
		ok.append(Y)
		ok.append(X)
if ok:
	print(int( max(ok)))
else:
	print("-1")

Submission status: Wrong Answer

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

minx = max(10*B, math.floor(12.5*A))
if minx*0.08 >= A+1:
    print(-1)
else:
    print(minx)

Submission status: Wrong Answer

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

for x in range(1,101):
    if int(x*0.08)==A and int(x*0.1)==B:
        print(x)
        exit()
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def get_max_min(n, p):
    return [int(p*n), int(p*(n+1))]
  
data = input()
A, B = [int(i) for i in data.split()]

a_data = get_max_min(A, 1/0.08)
b_data = get_max_min(B, 10)

result = -1

# if (a_data[1] < b_data[0]) or (b_data[1] < a_data[0]):
#     result = -1
if a_data[0] <= b_data[0] <= a_data[1]:
    result = b_data[0]
elif b_data[0] <= a_data[0] <= b_data[1]:
    result = a_data[0]
else:
    result = -1
    
print(result)

Submission status: Wrong Answer

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

a = (A/8)*100
b = B*10
if a * 0.1 == B:
    print(int(a))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
line = input()
a, b = line.split(" ")
a = int(a)
b = int(b)
flag = 0

num_a = int(a / 0.08)

if int(num_a * 0.1) == b:
    print(num_a)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int, input().split())
x = math.ceil(a/0.08)
y = math.ceil(b/0.10)
c = 10**18
if x == y:
    print(x)
    exit()
if math.floor(x*0.1) == a:
    c = min(c,x)
if math.floor(y*0.08) == b:
    c = min(c,y)
print(-1 if c == 10**18 else c)

Submission status: Wrong Answer

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

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

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


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

Submission status: Wrong Answer

Solution code:
import math

inp = input().split(" ")
A, B = int(inp[0]), int(inp[1])

# print(int(A * 1/0.08))

possible = int(A * 1/0.08) // 10
# print(possible)

answer = []
for i in range(possible * 10, possible * 10 + 10):
  tax_a = int(i * 0.08)
  tax_b = int(i * 0.1)
  # print(tax_a, tax_b)
  if tax_a == A and tax_b == B:
    answer.append(i)

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

Submission status: Wrong Answer

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

UE_8 = (A+1)/0.08
SHITA_8 = A/0.08
UE_10 = (B+1)/0.10
SHITA_10 = B/0.10

if UE_8 < math.ceil(SHITA_10) or UE_10 < math.ceil(SHITA_8):
    print(-1)
else:
    i = math.ceil(SHITA_8)
    j = math.floor(UE_8)
    for n in range(int(i),int(j+1),1):
        if i < UE_10 and i >= SHITA_10:
            print(i)
            break
        i+=1

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

a, b = input_nums()

a_rate = 0.08
b_rate = 0.1

al = int(a / a_rate)
ar = int((a+1) / a_rate)
bl = int(b / b_rate)
br = int((b+1) / b_rate)

ans = 0
if bl <= al and al < br:
    ans = al
elif bl <= ar and ar < br:
    ans = bl
elif al <= bl and br <= ar:
    ans = bl
else:
    ans = -1

if not ans == -1 and int(ans*0.08) < a:
    ans += 1
    if int(ans*0.1) > b:
        ans = -1
print(ans)

Submission status: Wrong Answer

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

while PA <= 1000:
    if PA*0.08 >= A:
        break
    else:
        PA += 1

if B+1 > PA*0.1 >= B:
    print(PA)

else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import floor
a, b = map(int, input().split())
for i in range(1, 100 + 1):
    if floor(i * 0.08) == a and floor(i * 0.10) == b:
        print(i)
        quit()
print(-1)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
nazos=10*B
if math.floor(nazos*0.08)==A and 10<=nazos<=1009:
  print(nazos)
else:
  while True:
    nazos+=1
    if math.floor(nazos*0.08)==A:
      print(nazos)
      break
    if nazos>1009:
      print(-1)
      break

Submission status: Wrong Answer

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

ans8=int(A*12.5)
ans10=int(B*10)
#print(ans8)
#print(ans10)
a=max(ans8,ans10)
b=min(ans8,ans10)
for i in range(b,a+1):
    ans88=int(i*0.08)
    ans1010=int(i*0.1)
    #print(i)
    #print(ans88)
    #print(ans1010)
    #print("\n")
    if(ans88==A and ans1010==B):
        print(i)
        exit()

print("-1")

Submission status: Wrong Answer

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

aa = A / 0.08
bb = B / 0.1


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

Submission status: Wrong Answer

Solution code:
import math
a=input().split()
A,B=int(a[0]),int(a[1])
p=math.floor(A/0.08)
p1=math.floor(B/0.10)
if(p==p1):
  while True:
    l=p-1
    if(l*0.08!=A or l*0.1!=B):
      break
    p=l
    
  print(p)
else:
  print(-1)

Submission status: Wrong Answer

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

x_a = 12.5 * A
x_b = 10 * B

integer_xa = int(x_a / 10)
integer_xb = int(x_b / 10)

if integer_xa == integer_xb:
    print(max(x_a, x_b))

else:
    print("-1")

Submission status: Wrong Answer

Solution code:
import math

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

emin=math.ceil(a/0.08)
emax=math.ceil((a+1)/0.08)
tmin=math.ceil(b/0.1)
tmax=math.ceil((b+1)/0.1)

if tmin<=emin<=tmax:
    print(emin)
else:
    print(-1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

a_plus = a+1
b_plus = b+1

price_a = int(a*(100/8))
price_aplus = int(a_plus*(100/8))
price_b = int(b*(100/10))
price_bplus = int(b_plus*(100/10))

#配列作成
al = list(range(price_a, price_aplus+1))
bl = list(range(price_b, price_bplus))
print(al)
print(bl)

ans = list(set(al) & set(bl))

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
x_a = a/0.08
x_b = b/0.1
if int(x_a * 0.08) == a and int(x_a * 0.1) == b:
    print(int(x_a))
elif int(x_b * 0.08) == a and int(x_b * 0.1) == b:
    print(int(x_b))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
def conv(a):
    for i in range(len(a)):
        a[i] = int(a[i])
    return a
def main(a,b):
    p_min = math.ceil((12.5)*a)
    q_min = math.ceil(10*b)
    p_maxi = math.ceil((12.5)*(a+1))-1
    q_maxi = q_min = math.ceil(10*(b+1))-1
    if p_min > q_maxi or q_min > p_maxi:
        return -1
    else:
        if p_min > q_min:
            return p_min+1
        else:
            return q_min+1
a,b = conv(input().split())
print(main(a-1,b-1))

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
x = (math.floor(a/0.08))
y = (math.floor(b/0.1))
min = -1
for i in range(x,0,-1) :
    check1 = math.floor(i*0.08)
    check2 = math.floor(i*0.1)
    # print(check1,check2)
    if (check1 == a and check2 == b) :
        min = i
    else :
        break
if min != -1 :
    print(min)
else :
    print(-1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math
input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a,b = inn()
p8 = math.floor((a*1250)/100)
p10 = math.floor((b*1000)/100)
p8_ = math.floor(((a+1)*1250)/100)
p10_ = math.floor(((b+1)*1000)/100)
if p8==p10:
    print(p8)
elif p8 < p10_ and p10 < p8:
    print(max(p8,p10))
elif p10 < p8_ and p8 < p10:
    print(max(p8,p10))
else:
    print(-1)

Submission status: Wrong Answer

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

ans1 = int(A *100// 8) 
ans2 = int(B *100 // 10)

if ans1 >= ans2:
    ans2_2 = int((B+1) *100 // 10)
    list = [int(ans2)]

    for i in range(ans2+1,ans2_2):
        list.append(int(i)) 
    
    if int(ans1) in list:
        print(ans1)
    else:
        print(-1)
else:
    ans1_2 = int((A+1) *100 // 8)
    list = [int(ans1)]

    for i in range(ans1+1,ans1_2):
        list.append(int(i)) 
    
    if int(ans2) in list:
        print(ans2)
    else:
        print(-1)

Submission status: Wrong Answer

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

A_min = math.ceil(A * 25 / 2)
A_max = math.floor((A + 1) * 25 / 2)
B_min = math.ceil(B * 100 / 10)
B_max = math.floor((B + 1) * 100 / 10)
# print(B_min, B_max)
A_list = list(range(A_min, A_max + 1))
B_list = list(range(B_min, B_max + 1))

min_ans = -1
for num in A_list:
    if num in B_list:
        min_ans = num
        break
    else:
        continue

print(min_ans)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<int(10*b):
  print(-1)
if int(25*(a+1)/2)==int(10*b):
  if a%2==0:
    print(-1)
  else:
    print(int(25*a/2))
if int(10*(b+1))<=int(25*a/2):
  print(-1)
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
max_a=a+0.99999999999999999999999999999
min_a=a
max_b=b+0.99999999999999999999999999999
min_b=b
max_an=max_a*100/8
min_an=min_a*100/8
max_bn=max_b*100/10
min_bn=min_b*100/10
if max_an<min_bn or max_bn<min_an:
    print(-1)
elif min_an<=min_bn:
    if min_b*100//10==max_a*100//8:
        print(-1)
    else:
        print(min_b*100//10)
else :
    if max_b*100//10==min_a*100//8:
        print(-1)
    else:
        print(min_a*100//8)

Submission status: Wrong Answer

Solution code:
num = {}

num = input().split()

# print(num)

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

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

# print(kensyo1, kensyo2)

if kensyo1:
  print(int(int(num[0]) / 0.08))
elif kensyo2:
  print(int(int(num[1]) / 0.1))
else:
  print(-1)

Submission status: Wrong Answer

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

a = math.ceil(A / 0.08)
aPlus1 = math.floor((A + 1) / 0.08)
b = math.ceil(B / 0.1)
bPlus1 = math.floor((B + 1) / 0.1)

if aPlus1 < b or a > bPlus1:
    print('-1')
    sys.exit()
print(max(a, b))

Submission status: Wrong Answer

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

X = a*100/8

Y = b*10

def aaa(n):
	temp = n
	temp = temp//1
	if n != temp:
		return False
	else:
		return True
#print(X,Y)
ok = []
if aaa(X) and X>0:
	if aaa(Y) and Y>0:
		ok.append(Y)
		ok.append(X)
if ok:
	print(max(ok))
else:
	print("-1")

Submission status: Wrong Answer

Solution code:
"""
C - Tax Increase
"""
A, B = map(int, input().split(' '))

asil1_1 = (100*(A))/8
asil1_2 = (100*(A+1))/8
asil2_1 = 10*(B)
asil2_2 = 10*(B+1)

sonuc_1 = max(asil1_1, asil2_1)
sonuc_2 = min(asil2_2, asil1_2)
if sonuc_1>sonuc_2:
    print(-1)
else:
    print(int(sonuc_1))

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int, input().split())
a=A/0.08
b=B/0.1
if a>=b:
  if B==math.floor(0.1*a):
    print(round(a))
  else:
    print(-1)
else:
  if A==math.floor(0.08*b):
    print(round(b))
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
tmpa = math.floor(A / 0.08)
tmpb = math.floor(B / 0.1)
alst = []
blst = []

indexa = 0
while True:
    tmp = math.floor((tmpa + indexa) * 0.08)
    if tmp == A:
        alst.append(tmpa + indexa)
        indexa += 1
    elif tmp > A:
        break
    else:
        indexa += 1

indexb = 1
while True:
    tmp = math.floor((tmpb + indexb) * 0.1)
    if tmp == B:
        blst.append(tmpb + indexb)
        indexb += 1
    elif tmp > B:
        break
    else:
        indexb += 1
ans = -1
alst.sort()
blst.sort()
for i in alst:
    if blst.count(i) >= 1:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
a = list(map(int,input().split()))
b = a[0]/0.08
c = (a[0]+1)/0.08
d = a[1]/0.1
e = (a[1]+1)/0.1
f=20000
if b<d:
    min=b
else :
    min =d
g=int(np.ceil(min))
for i in range(g,10000):
    if i>=b and i<=c:
        if i>=d and i<=e:
            f = i
            break
if f==20000:
    print(-1)
else:
    print(f)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a1 = set([int((a + i/1000) * 12.5) for i in range(1000)])
b1 = set([int((b + i/1000) * 10) for i in range(1000)])
res = a1 & b1
if res:
    print(min(res))
else:
    print(-1)

Submission status: Wrong Answer

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

while PA <= 1000:
    if int(PA*0.08)>=A:
        break
    else:
        PA += 1

if B+1 > PA*0.1 >= B:
    print(PA)

else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
mod = (a*100) % 8
eightpermin = a * 100 // 8

if mod != 0:
    eightpermin += 1

tenpermax = b * 10 - 1

if eightpermin >= tenpermax:
    print(eightpermin)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
from math import floor, ceil

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


A, B = map(int, input().split())
"""
let1 = ceil(A*12.5)
ov1 = floor((A+1)*100/8)
let2 = B*10
ov2 = (B+1)*10
select1 = set([i for i in range(let1 , ov1+1)])
select2 = set([i for i in range(let2 , ov2)])
print(select1, select2)
sel = select1 & select2
if sel == set():
	print(-1)
else:
	print(min(sel))
"""
A_ = []
B_ = []
for i in range(1, 1001):
	if floor(i*0.08) == A:
		A_.append(i)

	if floor(i*0.1) == B:
		B_.append(i)

A_ = set(A_)
B_ = set(B_)
sel = A_ & B_
print(A_, B_)
if sel == set():
	print(-1)
else:
	print(min(sel))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
if A%0.08 == 0:
    a_min = int(A/0.08)
else:
    a_min = int(A//0.08) + 1
a_max = (A+1)//0.08

result = -1
for i in range(int(a_min), int(a_max)+1):
    if (round(i*0.1) == B)*(round(i*0.08) == A):
        result = i
        break
print(result)

Submission status: Wrong Answer

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

Amin = A / 0.08
Amax = (A + 1) / 0.08

Bmin = B / 0.10
Bmax = (B + 1) / 0.10

Aset = set(list(range(round(Amin), round(Amax))))
Bset = set(list(range(round(Bmin), round(Bmax))))

result_set = Aset & Bset

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

Submission status: Wrong Answer

Solution code:
A, B = [int(y) for y in input().split(' ')]
priceA_min = int((A/8) * 100)
if int(((A+1)/8) * 100) == ((A+1)/8) * 100:
  priceA_max = int(((A+1)/8) * 100) - 1
else:
  priceA_max = int(((A+1)/8) * 100)
found = False
for x in range(priceA_min,priceA_max+1,1):
  if int(x*0.1) == B:
    print(x)
    found = True
    break
if not found:
  print(-1)

Submission status: Wrong Answer

Solution code:
import sys
import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
a,b= map(int,input().split())
ju=ans=0
li=[]
li1=[]

i=0
for i in range(101):
  if a==math.floor(i*0.08):
    li.append(i)
  if b==math.floor(i*0.1):
    li1.append(i)

li.sort()
li1.sort()
if len(li1)>0:
  ans=min(li1)
if len(li)>0:
  ju=min(li)
for i in range(len(li1)):
  if ju==li1[i]:
    print(ju)
    sys.exit()
for i in range(len(li)):
  if ans==li[i]:
    print(ans)
    sys.exit()
print('-1')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math
input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a,b = inn()
p8 = math.floor((a*1250)/100)
p10 = math.floor((b*1000)/100)
p8_ = math.floor(((a+1)*1250)/100)
p10_ = math.floor(((b+1)*1000)/100)
if p8==p10:
    print(p8)
elif p8 < p10_ and p10 < p8:
    print(max(p8,p10))
elif p10_ < p8_ and p8 < p10:
    print(max(p8,p10))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# @Time    : 2020/3/1 19:59
# @Author  : DIRICHLET
# @File    : main.py
a=[]
def myin(fun=int):
    global a
    a=list(map(fun,input().split()))
#myin(int)
a,b=map(int,input().split())
oner=(a+1)/0.08
if a%2==0:
    oner=round((a+1)/2*25)+1
    onel=a//2*25
else:
    oner=(a+1)/2*25
    onel=round(a/2*25)+1
#*25/2
twol=b*10
twor=b*10+10
l=[[onel,oner],[twol,twor]]
if l[0][0]>l[1][0]:
    l = [[twol, twor],[onel, oner], ]

if l[1][0]<l[0][1]:
    print(l[1][0])
else:
    print(-1)

#print(a)
#[25,37.5) [20,30)
#[19-20) [99-100) 99.5-18.5=81/0.02=4050
#(231.35,243.75] (985,995]
#

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
x_1 = math.floor(a / 0.08)

max_count = 1
while True:
    zeikomi = math.floor((x_1 + max_count) * 0.08)
    if zeikomi != a:
        break
    max_count += 1

for i in range(max_count):
    value = x_1 + i
    if math.floor(value * 0.1) == b:
        print(value)
        exit()
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math

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

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

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

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

print("-1")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
a,b=map(int, input().split())

x = math.floor(a/0.08)
#1の位が1-9
y = math.floor(b/0.1)
if (x + 1) * 0.08 == a:
    xx = x + 2
else:
    xx = x + 1

for i in range(y,y+10):
    for j in range(x, xx):
        if i == j:
            print(i)
            sys.exit(0)
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
ta = a / 0.08
if (int(ta * 0.1) == b):
  print(round(ta))
else:
  print(-1)

Submission status: Wrong Answer

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

X = a*100/8

Y = b*10

def aaa(n):
	temp = n
	temp = temp//1
	if n != temp:
		return False
	else:
		return True
print(X,Y)
ok = []
if aaa(X) and X>0:
	if aaa(Y) and Y>0:
		ok.append(Y)
		ok.append(X)
if ok:
	print(max(ok))
else:
	print("-1")

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
 
count = 0
for i in range(1,101):
  if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
    print(i)
    exit()
  else:
    count += 1
if count > 99:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

p_a = math.floor(A / 0.08)
p_b = math.floor(B / 0.1)
flag = 0
b = math.floor(p_a * 0.1)
a = math.floor(p_b * 0.08)

if b == B:
  ans = p_a
  flag = 1
if a == A:
  if flag == 0:
    ans = p_b
  else:
    if p_a > p_b:
      ans = p_b
if b != B and a != A:
  ans = -1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    ans = []
    for i in range(1, 101):
        tax8 = math.floor(i * 0.08)
        if tax8 == a:
          for j in range(1, 101):
              tax10 = math.floor(j * 0.10)
              if tax10 == b and i == j:
                  ans.append(i)

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

a,b = map(str, input().split())
for i in range(1,101):
  if str(i*0.08)[0] == a and str(i*0.1)[0] == b:
    print(i)
    quit()

print(-1)

Submission status: Wrong Answer

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

if A / 8 * 100 == B * 10: print(B * 10)
else:
  a = []
  b = []
  for i in range(10):
    a.append(math.floor((A +(i * 0.1)) /8 * 100))
    b.append(math.floor((B + (i * 0.1)) /10 * 100))
  ans = list(set(a) & set(b))
  print(ans[0] if len(ans) > 0 else -1)

Submission status: Wrong Answer

Solution code:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
a, b = (int(i) for i in input().split())

p = []
answer=-1
for i in range(1,101):
    if int(i*0.08) == a:
        p.append(i)

for i in p:
    if int(i*0.1) == b:
        answer = i
        break

#print(answer)
print("-1")

Submission status: Wrong Answer

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

    resultA = A / 0.08
    resultB = B / 0.1

    #print(resultA)
    #print(resultB)
    answer = -1

    if(round(resultA * 0.08) == A and round(resultA * 0.1) == B):
        answer = resultA
    if(round(resultB * 0.08 == A and round(resultB * 0.1) == B)):
        answer = resultB

    print(int(answer))

    #print(int(answer))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
nazos=10*B
if math.floor(nazos*0.08)==A and 10<=nazos<=1000:
  print(nazos)
else:
  while True:
    nazos+=1
    if math.floor(nazos*0.08)==A:
      print(nazos)
      break
    if nazos>1000:
      print(-1)
      break

Submission status: Wrong Answer

Solution code:
num = {}

num = input().split()

print(num)

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

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

print(kensyo1, kensyo2)

if kensyo1:
  print(int(int(num[0]) / 0.08))
elif kensyo2:
  print(int(int(num[1]) / 0.1))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import math
 
A, B = map(int, input().split())
min_ans = -(-A // 0.08)
 
kouho = [min_ans]
to_continue = True
while to_continue:
    min_ans += 1
    if math.floor(min_ans * 0.08) == A:
        kouho.append(min_ans)
    else:
        break
        
print_flag = False
for i in kouho:
    if math.floor(i * 0.1) == B:
        print_flag = True
        print(i)
        break
    
if print_flag == False:
    print('No')

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
min_8=int(A*(100/8))
max_8=int((A+1)*(100/8))
min_10=int(B*10)
max_10=int((B+1)*10)
if max_8 < min_10:
    print("-1")
elif min_8 > max_10:
    print("-1")
elif max_8 >= min_10:
    if min_8 < min_10:
        print(min_10)
    elif min_8 >= min_10:
        print(min_8)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
x=math.floor(A/0.08)
y=math.floor(B/0.1)
eight=[x]
ten=[y]
while math.floor(x*0.08)==A:
    x+=1
    eight.append(x)
while math.floor(y*0.1)==B:
    y+=1
    ten.append(y)
eight_set=set(eight)
ten_set=set(ten)
ans_set=eight_set&ten_set
ans=list(ans_set)
if len(ans)>0:
    print(min(ans))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
# 税がかかる金額A,B
A, B = map(int, input().split())

# 税抜きの候補
a_min_price = A*100//8
a_over_price = (A+1)*100//8
b_min_price = B*100//10
b_over_price = (B+1)*100//10

# 除外する組み合わせ
# 片方の最大値が最小値を超える
if((a_over_price < b_min_price) or (b_over_price < a_min_price)):
    print(-1)
else:
    if(a_min_price < b_min_price):
        print(b_min_price)
    else:
        print(a_min_price)

Submission status: Wrong Answer

Solution code:
import math;
a,b = map(int,input().split())
ans = a*25//2
if math.floor(ans//10) != b:
  ans = -1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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

a_btm = ceil(a*100/8)
a_top = (a+1)*100//8

b_btm = ceil(b*100/10)
b_top = (b+1)*100//10

ans = -1
for aa in range(a_btm,a_top+1):
    for bb in range(b_btm,b_top+1):
        if aa == bb:
            ans = aa
            break
    break

print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil
A, B = map(int, input().split(' '))
x0 = ceil(A / 0.08)
x1 = ceil((A+1) / 0.08)
y0 = ceil(B / 0.1)
y1 = ceil((B+1) / 0.1)
if x1 < y0 or y1 < x0:
  print(-1)
else:
  print(min(max(x0, y0), min(x1, y1)))

Submission status: Wrong Answer

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

    resultA = A * 8 / 100
    resultB = B * 1 / 100

    #print(resultA)
    #print(resultB)
    answer = -1

    if(round(resultA * 0.08) == A and round(resultA * 0.1) == B):
        answer = resultA
    if(round(resultB * 0.08 == A and round(resultB * 0.1) == B)):
        answer = resultB

    print(int(answer))

    #print(int(answer))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

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

#x=A/0.08
#y=B/0.10

ans=1251
#max_y=( int(y) + 10 )%100
for i in range(1,1251):
  v_08 = math.floor(i * 0.08)
  v_10 = math.floor(i * 0.1)
  
  if v_08==A and v_10==B:
    ans=min(ans,i)

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

grid = []
#for i in range(1):
array = list(map(int,input().strip().split()))
#    grid.append(array)
#print(array)
a = array[0]
b = array[1]

min8 = a/0.08
max8 = (a+1)/0.08
min10 = b/0.1
max10 = (b+1)/0.1

def lists(a,b):
    if a%1==0:
        a2 = a
    else:
        a2 = int(a)+1
    if b%1==0:
        b2 = b
    else:
        b2 = int(b)
    return np.arange(a2,b2+1)

list8 = lists(min8,max8)
list10 = lists(min10,max10)
#print(list8,list10)
hosii = list(set(list8)&set(list10))
if len(hosii)>0:
    print(int(np.min(hosii)))
else:
    print(-1)