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

if a % 8 == 0:
    a_min = int(a * 12.5)
else:
    a_min = int(a * 12.5) + 1
if (a + 1) % 8 == 0:
    a_max = int((a + 1) * 12.5) - 1
else:
    a_max = int((a + 1) * 12.5)

b_min = b * 10
b_max = (b + 1) * 10 - 1

if a_max < b_min:
    print("-1")
elif a_min <= b_min:
    print(int(b_min))
elif b_max >= a_min:
    print(int(a_min))
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
import math
import fractions

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


if fractions.gcd(A, B) == 1:
    print('-1')


c = min(A, B) + 1
isFinish = True
while isFinish:
    c += 1

    if math.floor(c * 0.08) == A and math.floor(c * 0.1) == B:
        print(str(c))
        isFinish = False

Submission status: Wrong Answer

Solution code:
a,b = map(float,input().split())
a_base_min = int(a * 25 /2)
a_base_max = int((a+1)*25/2)
b_base_min = int(b *10)
b_base_max = int((b+1) *10)

if (b_base_min <= a_base_min) and (a_base_min < b_base_max):
    print(int(a_base_min))
elif (a_base_min <= b_base_min) and (b_base_min < a_base_max):
    print(int(b_base_min))
else:
    print(-1)

Submission status: Wrong Answer

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

ALimit = A + 1
BLimit = B + 1
Atmp = A / 0.08
Btmp = B / 0.1

result = 0
if Atmp > Btmp:
    tmp = Atmp
    while 'true':
        if int(tmp * 0.1) == B:
            result = tmp
            break
        elif int(tmp * 0.1) >= BLimit:
            result = -1
            break
        else:
            tmp += 1
else:
    tmp = Btmp
    while 'true':
        if int(tmp * 0.08) == A:
            result = tmp
            break
        elif int(tmp * 0.08) >= ALimit:
            result = -1
            break
        else:
            tmp += 1
print(int(result))

Submission status: Wrong Answer

Solution code:
from sys import stdin


def spam(x, AB, per):
    min_ = x
    max_ = x
    while True:
        min_ -= 1
        tmp = int(min_ * per)
        if AB != tmp:
            min_ += 1
            break
    while True:
        max_ += 1
        tmp = int(max_ * per)
        if AB != tmp:
            max_ -= 1
            break
    return min_, max_


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    x = spam(int(A / 0.08), A, 0.08)
    y = spam(int(B / 0.1), B, 0.1)
    print(x)
    print(y)
    if x[0] <= y[0] <= x[1]:
        print(y[0])
    elif y[0] <= x[0] <= y[1]:
        print(x[0])
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    A, B = MI()
    A_ = int(A/0.08)
    B_ = int(B/0.1)
    
    if A_==B_:
        print(A_)
    elif int(A_*0.1) == B:
        print(A_)
    elif int(B_*0.8) == A:
        print(B_)    
    else:
        print(-1)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

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

tmpA = int(A / 0.08)
tmpB = int(B / 0.1)

tmpA2 = math.floor(tmpA * 0.08)
tmpB2 = math.floor(tmpB * 0.1)

if tmpA2 == A and tmpB2 == B:
    tmp_max = max(tmpA, tmpB)
    tmp_min = min(tmpA, tmpB)
    ans = tmp_max
    for i in range(tmp_max, tmp_min, -1):
        tA = math.floor(tmpA * 0.08)
        tB = math.floor(tmpB * 0.1)
        if tA == tB == tmp_max:
            ans = i
        else:
            break
    print(ans)
else:
    print(-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)
if x==y:
    print(x)
else:
    if math.floor(x * 0.1)==b:
        print(x)
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
i = list(map(int,input().split()))
a = i[0]*100//8
b = i[1]*100//10
if -10 < a-b and a-b < 10:
  print(i[0]*100//8)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
a = int(A / 0.08)
b = B / 0.1

if (A / 0.08) % 10 - a > 0:
    a += 1

ans = int(max(a, b))

aa = int((A+1) / 0.08)
bb = int((B+1) / 0.1) - 1

if ((A+1) / 0.08) - aa == 0:
    aa -= 1
    
if aa < b or bb < a or ans <= 0:
    print("-1")
else:
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

a = int(A*100/8)
b = int(B*100/10)

x = int(a*0.10)
y = int(b*0.08)

if x == B and y == A:
    if a < b:
        print(a)
    else:
        print(b)
elif x == B:
    print(a)
elif y == A:
    print(b)
else:
    print(-1)

Submission status: Wrong Answer

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

a_min = a * 100 / 8
a_max = (a + 1) * 100 / 8

b_min = b * 100 / 10
b_max = (b + 1) * 100 / 10

out = max(a_min, b_min)
print(int(out) if (out < a_max) & (out < b_max) else -1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
x = int(100 * a / 8)
y = int(100 * b / 10)
ans = max(x, y)
if int(ans * 8 / 100) == a and int(ans * 10 / 100) == b:
    print(ans)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
ans=0
a1=int(A/0.08)
a2=int((A+1)/0.08)
b1=int(B/0.1)
b2=int((B+1)/0.1)
for i in range(a1,a2+1):
    if b1<=i and i<=b2:
        ans=i
        break
if ans==0:
    print(-1)
else:
    print(ans)

Submission status: Wrong Answer

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

x_b = b * 10

min_a = (25/2) * a
max_a = (25/2) * (a + 1)

min_b = 10 * b
max_b = 10 * (b + 1)

min_ = max(min_a, min_b)
max_ = min(max_a, max_b)

_min = int(min_ + 0.5)
_max = int(max_)

if _min > _max:
    print(-1)

else:
    print(_min)

Submission status: Wrong Answer

Solution code:
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]

x1 = a / 0.08
x11 = (a + 1) / 0.08
x2 = b / 0.1
x22 = (b + 1) / 0.1

result = -1
if (x1 >= x2) and (x1 < x22):
    result = x1
if (x2 >= x1) and (x2 < x11):
    if result == -1:
        result = x2
    if result != -1:
        if result > x2:
            result = x2

print(int(result))

Submission status: Wrong Answer

Solution code:
import math
import sys

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

A = math.floor(a / 0.08)
B = math.floor(b / 0.10)

if A < B:
    print('-1')
elif A == B:
    print(int(B))
else:
    for i in range(1,1251):
        if math.floor(i * 0.08) == a and math.floor(i * 0.10) == b:
            print(i)
            sys.exit()
    print('-1')

Submission status: Wrong Answer

Solution code:
import math
a = list(map(int, input().split(" ")))
min8 = math.floor(a[0]/0.08)
max8 = math.floor((a[0]+1)/0.08)
min10 = math.floor(a[1]/0.1)
max10 = math.floor((a[1]+1)/0.1)
if ((min8>max10) or (max8<min10)):
    print(-1)
else:
    print(int(max(min8,min10)))

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
tmp = range(int(y/0.1), int((y+1)/0.1))
for i in range(int(x/0.08), int((x+1)/0.08)):
    if i in tmp:
        print(i)
        break
print(-1)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
a,b= map(int, input().split())
x=max(a//0.08,b//0.1)
if (a+1)/0.08<b/0.1 or (b+1)/0.1<a/0.08:
  print(-1)
else:
  print(int(x))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if int(a/0.08) <= int((b+1)/0.1) and int(b/0.1) <= int((a+1)/0.08):
    print(max(int(a/0.08), int(b/0.1)))
else:
    print(-1)

Submission status: Wrong Answer

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

if 100*A%8 == 0:
    ans1 = int(A/0.08)
else:
    ans1 = int(A/0.08) + 1
ans2_max = int(ans1 + ans1*0.1)
ans2 = int(B/0.1)
if ans2 <= ans2_max:
    print(ans1)
else:
    print(-1)

Submission status: Wrong Answer

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

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

temp_a1 = 100 * a // 8
temp_a2 = 100 * (a + 1) // 8
temp_b1 = 100 * b // 10
temp_b2 = 100 * (b + 1) // 10

result = -1
for i in range(int(temp_a1), int(temp_a2) + 1):
    if temp_b1 <= i < temp_b2:
        result = i
        break

print(result)

Submission status: Wrong Answer

Solution code:
def main():
  a,b=map(int,input().split())
  for i in range(-int(-a/0.08),int((a+1)/0.08)):
    if int(i*0.1)==b:
      return i
  return -1
print(main())

Submission status: Wrong Answer

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

x = a / 0.08
y = x * 0.1

if int(y) == b:
    print(int(x))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil

a, b = tuple(map(int, input().split()))
min_a = a / 0.08
max_a = (a + 1) / 0.08
min_b = b / 0.1
max_b = (b + 1) / 0.1

if max_a <= min_b:
    print(-1)
else:
    print(ceil(max(min_a, min_b)))

Submission status: Wrong Answer

Solution code:
import math

A, B = [int(i) for i in input().split()]
ans = []
for i in range(10):
    for j in range(10):
        A_float = A + 0.1 * i
        B_float = B + 0.1 * j

        x_a = math.floor(A_float / 0.08)
        x_b = math.floor(B_float / 0.1)
        
        if x_a == x_b:
            ans.append(x_a)
            
if len(ans) > 0:
    print(min(ans))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
from math import floor
A, B = map(int, input().split())
tax_A = 0.08
tax_B = 0.1
i = 1
A_list = []
while(floor(i*tax_A)<=A):
    if floor(i*tax_A)==A:
        A_list.append(i)
    i += 1
i = 1
B_list = []
while(floor(i*tax_B)<=B):
    if floor(i*tax_B)==B:
        B_list.append(i)
    i += 1
if max(min(A_list), min(B_list)) in A_list and max(min(A_list), min(B_list)):
    print(max(min(A_list), min(B_list)))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
A=[]
B=[]
for i in range(9):
  A.append(a+i/10)
  B.append(b+i/10)
for i in range(len(A)):
  A[i]=A[i]/0.08
  B[i]=B[i]/0.1
ans=[]
for i in range(len(A)):
  for j in range(len(A)):
    if round(A[i],2)==round(B[j],2):
      ans.append(A[i])
      break
if ans==[]:
  print(-1)
else:
  print(int(ans[0]))

Submission status: Wrong Answer

Solution code:
import math

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

rangeA = [A / 0.08, (A + 1) / 0.08]
rangeB = [B / 0.1, (B + 1) / 0.1]

if rangeA[0] <= rangeB[0]:
  if rangeB[0] <= rangeA[1]:
    print(math.ceil(rangeB[0]))
    exit(0)
else:  # rangeA[0] > rangeB[0]
  if rangeA[0] <= rangeB[1]:
    print(math.ceil(rangeA[0]))
    exit(0)
print(-1)

Submission status: Wrong Answer

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

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

print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
p=0;q=0;x=0;f=0
p=A/0.08
q=(A+0.99)/0.08
x=p
#print(p,q,x*0.1//1)
while x<q:
  if (x*0.1)//1==B:
    print(x)
    f=1
    break
  else:
    x=x+0.01
if f==0:
  print(-1)

Submission status: Wrong Answer

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

ALimit = A + 1
BLimit = B + 1
Atmp = A / 0.08
Btmp = B / 0.1

result = 0
if Atmp > Btmp:
    tmp = Atmp
    while 'true':
        if int(tmp * 0.1) == B:
            result = tmp
            break
        elif int(tmp * 0.1) >= ALimit:
            result = -1
            break
        else:
            tmp += 1
else:
    tmp = Btmp
    while 'true':
        if int(tmp * 0.08) == A:
            result = tmp
            break
        elif int(tmp * 0.08) >= BLimit:
            result = -1
            break
        else:
            tmp += 1
print(int(result))

Submission status: Wrong Answer

Solution code:
import math

a = list(map(int, input().split()))
b = -1
for i in range(1250):
    x = math.floor(i*0.08)
    y = math.floor(i*0.1)
    if a[0] == x and a[1] == y:
        b = x
        break

print(b)

Submission status: Wrong Answer

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

X = round(A/0.08)
Y = round(B/0.1)

C = min(X,Y)

if(round(C*0.08)==A and round(C*0.1)==B):
    print(C)
else:
    print(-1)

Submission status: Wrong Answer

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

xa_max = int((a+1)/0.08)
xa_min = int(a/0.08)

xb_max = int((b+1)/0.1)
xb_min = int(b/0.1)

if xb_min < xa_max and xa_min<=xb_min:
  print(int(xb_min))
elif xb_min<=xa_min and xa_min<xb_max:
  print(int(xa_min))
else:
  print("-1")

Submission status: Wrong Answer

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

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 < SHITA_10 or UE_10 < SHITA_8:
    print(-1)
else:
    i = math.ceil(SHITA_8)
    j = math.floor(UE_8)
    for n in range(j-i+1,start=i):
        if i < UE_10 and i >= SHITA_10:
            print(i)
        i+=1

Submission status: Wrong Answer

Solution code:
isFound = False
li = list(map(int,input().split()))
min = int(li[0] / 0.08)
max = int((li[0] + 1) / 0.08) - 1
for i in range(min, max):
    if(int(i * 0.1) == li[1]):
        print(i)
        isFound = True
        break
if(not(isFound)):
    print(-1)

Submission status: Wrong Answer

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

a_min=math.ceil(a/(0.08))
a_max=(a+1)/(0.08)
b_min=math.ceil(b/(0.1))
b_max=(b+1)/(0.1)
if a_min>=a_max:
    print(-1)
elif b_min>=b_max:
    print(-1)
else:
    if a_min<b_min:
        if b_min<=a_max:
            print(b_min)
        else:
            print(-1)
    if b_min<a_min:
        if a_min<=b_max:
            print(a_min)
        else:
            print(-1)  
    if a_min==b_min:
        print(a_min)

Submission status: Wrong Answer

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

result_a = int(a / 0.08)
result_b = int(b / 0.1)

if result_a > result_b:
  c = int(result_a * 0.1)
  if b == c:
    print(result_a)
  else:
    print(-1)
else:
  c = int(result_b * 0.08)
  if a == c:
    print(result_b)
  else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math

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

# 消費税が8%のときA円になる税抜き価格xの範囲
per8_set = set(range(math.floor(A / 0.08), math.floor(A / 0.08)+13))
per10_set = set(range(math.floor(B / 0.1), math.floor(B / 0.1)+10))

x = per8_set & per10_set

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
a, b = map(float, input().split())
i = math.floor(a/0.08)
while i*0.08 < a+1:
    #print(i)
    if math.floor(i*0.1) == b:
        print(i)
        break
    else:
        i += 1
else:
    print('-1')

Submission status: Wrong Answer

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

A_down = (25 * A ) //2
A_up = (25 * (A + 1 )) //2

if (A_down * 8 )//100 != A:
    A_down += 1

if (A_up * 8 )//100 != A:
    A_up -= 1


B_down = 10 * B
B_up = 10 * (B + 1) - 1 

if A_up < B_down or B_up < A_down:
    print(-1)
else:
    if  A_down <= B_up:
        print(A_down)
    elif B_down <= A_up:
        print(B_down)
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    a,b = map(int, input().split())
    
    def check(k):
        if floor(k*0.08) == a and floor(k*0.1) == b:
            return True
        else:
            return False
    # [k*0.08] = A
    # [k*0.1] = B
    # B <= k*0.1 <= B+1
    # A <= k*0.08 <= A+1

    m,n = a / 0.08, b/0.1
    
    for i in range(floor(n)-3, ceil(m)+1):
        if check(i):
            print(i)
            return
    print('-1')
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=0
a1=int(a/0.08)
b1=(b*10)//1
for i in range(0,10):
    for j in range(i,13):
        a2=a1+i
        b2=b1+j
        d=a2-b2
        if d==0:
            c=a2
            break
    if c>0:
        break
if c==0:
    print("-1")
else:
    print(c)

Submission status: Wrong Answer

Solution code:
import math

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

eight=math.floor(a*12.5)
ten=math.floor(b*10)

ans=0

if eight<=ten:
    ans=ten
    
    if math.floor(ans*0.08)!=a or math.floor(ans*0.1)!=b:
        ans=-1
    
elif ten<eight:
    ans=eight
    
    if math.floor(ans*0.08)!=a or math.floor(ans*0.1)!=b:
        ans=-1

print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
x=int(max(12.5*a,10*b))
if int(x*0.08)==a and b==int(x*0.1):
    print(x)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    A, B = MI()
    A_ = int(A/0.08)
    B_ = int(B/0.1)
    
    if A_==B_:
        print(A)
    elif int(A_*0.1) == B:
        print(A_)
    elif int(B_*0.8) == A:
        print(B_)    
    else:
        print(-1)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
A, B = map(float, input().split())
Ap = math.floor(A / 0.08)
Bp = math.floor(B / 0.1)

if Ap == Bp:
    print(Ap)
else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(25, 100000000, 25):
  if int(i * 0.08) == a and int(i * 0.10) == b:
    print(i)
    sys.exit(0)
print(-1)

Submission status: Wrong Answer

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

minA = A / 0.08
maxA = (A+1) / 0.08
minB = B / 0.1
maxB = (B+1) / 0.1

if minB <= minA and minA < maxB: print(int(minA))
elif minA <= minB and minB < maxA: print(int(minB))
else: print("-1")

Submission status: Wrong Answer

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


answer = a * 12.5

while int(answer*0.1) != b:
    answer=answer+1
    if answer > 10020:
        answer = -1
        break;

print(int(answer))

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
nazos=10*B
if math.floor(nazos*0.08)==A:
  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:
a, b = map(int, input().split())
c1 = a / 0.08
c2 = b / 0.1
kouho = []
for i in range(10):
    int(c2 + i * 0.08) == a
    print(c2 + i)
    break
print(-1)

Submission status: Wrong Answer

Solution code:
from math import ceil as c
a,b=map(int,input().split())
amin=c(a/0.08)
amax=c((a+1)/0.08)-1
bmin=b*10
if amax<bmin:
    print(-1)
elif bmin<amin:
    print(amin)
else:
    print(bmin)

Submission status: Wrong Answer

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

x_min = A * 12.5
#print(x_min)
if x_min.is_integer:
  x_min = int(x_min)
else:
  x_min = int(x_min) + 1

x_max = (A + 1 - 1e-6) * 12.5
#print(x_max)
x_max = int(x_max)

ans = -1
for n in range(x_min, x_max + 1):
  if int(n * 0.1) == B:
    ans = n
    break

print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
a = int(A // 0.08)
ans_lst = []
for i in range(20):
    print(a, int(a * 0.08) == A)
    if int(a * 0.08) == A:
        ans_lst.append(a)
    a += 1
for i in ans_lst:
    if int(i * 0.1) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
ans = []
for i in range(10):
    a = int((A+i*0.1)/0.08)
    for j in range(10):
        b = int((B+j*0.1)/0.1)
        if a == b and a != 0:
            ans.append(a)
if len(ans) == 0:
    print(-1)
else:
    print(min(ans))

Submission status: Wrong Answer

Solution code:
import math

a,b = map(lambda x: int(x), input().split())


hati_s = a/0.08
hati_l = (a+1)/0.08

ten_s = b/0.1
ten_l = (b+1)/0.1

#print(hati_s,hati_l,ten_s,ten_l)


def intersec(a_min,a_max,b_min,b_max):
    if a_min < b_min:
        if a_max < b_min:
            return [0,0]
        else:
            if a_max < b_max:
                return [b_min,b_max]
            else:
                return [b_min,a_max]
    else:
        if b_max < a_min:
            return [0,0]
        else:
            if b_max < a_max:
                return [a_min,a_max]
            else:
                return [a_min,a_max]


def min_int(pair):
    if pair == [0,0]:
        return -1
    else:
        return math.ceil(pair[0])



print(min_int(intersec(hati_s,hati_l,ten_s,ten_l)))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
if a * 100 % 8 == 0:
    low = max(a * 100 // 8, b * 10)
else:
    low = max(a * 100 // 8 + 1, b * 10)
high = min(100 * (a + 1) // 8, 10 * (b+1))

if low <= high:
    print(low)
else:
    print(-1)

Submission status: Wrong Answer

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

an = [math.floor(a*(100/8)) , math.ceil((a+1)*(100/8))-1]
bn = [math.floor(b*(100/10)) , math.ceil((b+1)*(100/10))-1]
    
ax = []
bx = []
    
for i in range(an[0],an[1]+1):
    ax.append(i)
    
for i in range(bn[0],bn[1]+1):
    bx.append(i)
    
for i in range(len(ax)):
    for j in range(len(bx)):
        if ax[i] == bx[j]:
            ans = min(ans,ax[i])
    
if ans != inf:
    print(ans)
else:
    print("-1")

Submission status: Wrong Answer

Solution code:
import math

A, B = list(map(int, input().strip().split()))
ans = -1
for i in range(1, 101):
  if(math.floor(i * 0.08) == A and math.floor(i * 0.1) == B):
    ans = i
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
c = 0
for i in range(2000):
    c += 1
    if c == 1000:
        print(-1)
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        break

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 = a / a_rate
ar = (a+1) / a_rate
bl = b / b_rate
br = (b+1) / b_rate

ans = 0
if bl <= al and al < br:
    ans = int(al)
elif bl <= ar and ar < br:
    ans = int(bl)
elif al <= bl and br <= ar:
    ans = int(bl)
else:
    ans = -1
print(ans)

Submission status: Wrong Answer

Solution code:

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

a = int(A/0.08)
b = int(B/0.1)
aa=[a]
bb=[b]
au=a+1
ap=a-1
bu=b+1
bs=b-1
f1=True
f2=True
f3=True
f4=True
while f1==True or f2==True:
    if int(au*8/100) == A:
        aa.append(au)
        au += 1
    else:
        f1=False

    if int(ap*8/100) == A:
        aa.append(ap)
        ap -=1
    else:
        f2=False

while f3==True or f4==True:
    if int(bu*10/100) == A:
        bb.append(bu)
        bu += 1
    else:
        f3=False

    if int(bs*8/100) == A:
        bb.append(bs)
        bs -=1
    else:
        f4=False
cc=[]
for i in aa:
    for j in bb:
        if i==j:
            cc.append(j)
if len(cc)==0:
    print(-1)
else:
    print(min(cc))

Submission status: Wrong Answer

Solution code:
s = list(map(int, input().split()))
n = s[0]
a = s[1]
flag = 0
if n/0.08 > a/0.1:
    ans = int(a/0.1)
    while ans <= n/0.08:
        if int(ans*0.08) == n and int(ans*0.1)==a:
            flag = 1
            break
        ans += 1
else:
    ans = int(n/0.08)
    while ans <= a/0.1:
        if int(ans*0.1) == a and int(ans*0.08)==n:
            flag = 1
            break
        ans += 1
if flag == 1:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

A = int((a + 1) / 0.08)
a = int(a / 0.08)

B = int((b + 1) / 0.1)

if A >= b:
    if a > b:
        print(a)
    else:
        print(b)
else:
    print("-1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

tax008 = [int(a / 0.08), int((a + 1) / 0.08)]
tax010 = [int(b / 0.1), int((b + 1) / 0.1)]
min_value = max(tax008[0], tax010[0])
max_value = min(tax008[1], tax010[1])
if min_value >= max_value:
    print(-1)
else:
    print(min_value)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
c1 = int(B/0.1)
if int(c1*0.08) == A:
    print(c1)
else:
    print("-1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans_min = min(a*100//8,b*100//10)
ans_max = max(a*100//8,b*100//10)

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

print(-1)

Submission status: Wrong Answer

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

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

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

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

print(ans)

Submission status: Wrong Answer

Solution code:

import glob


# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\158\\C'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        q = [int(i) for i in self.input_data().split()]

        A = q[0]
        B = q[1]

        no_tax_A = int(A / 0.08) # + 0 - 12
        no_tax_B = int(B / 0.1)  # + 0 - 9

        if int(no_tax_A) * 0.08 != A:
            no_tax_A += 1

        if no_tax_A == no_tax_B:
            result = no_tax_A
        elif no_tax_A > no_tax_B:
            if no_tax_A - no_tax_B <= 9:
                result = no_tax_A
            else:
                result = -1
        else:
            result = -1

        print(str(result))

solver = Solver(REL_PATH)
solver.exec_resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

# 消費税が8%のときA円になる税抜き価格xの範囲
per8_set = set(range(math.floor(A / 0.08), math.floor(A / 0.08)+13))
per10_set = set(range(math.floor(B / 0.1), math.floor(B / 0.1)+10))

print(per8_set)
print(per10_set)

x = per8_set & per10_set
print(x)

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

Submission status: Wrong Answer

Solution code:
def calc_list(X, z):

  root = X * (100 / z)
  origin = root
  l = [root]
  while True:
    if int((root + 1) * (z / 100)) == X:
      l.append(root + 1)
      root += 1
    else: break
  
  root = origin

  while True:
    if int((root - 1) * (z / 100)) == X:
      l.append(root - 1)
      root -= 1
    else: break

  return set(l)

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

# 8%でA円になる金額を求める
a = calc_list(A, 8)

# 10%でB円になる金額を求める
b = calc_list(B, 10)

# 一致しているものがあればその金額、なければ-1を出力する
c = a & b
if len(c) > 0:
  c = list(c)
  list(c).sort()
  print(int(c[0]))
else:
  print(-1)

Submission status: Wrong Answer

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

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

temp_a1 = 100 * a // 8
temp_a2 = math.ceil(100 * (a + 1) / 8)
temp_b1 = 100 * b // 10
temp_b2 = math.ceil(100 * (b + 1) / 10)

result = -1
for i in range(int(temp_a1), int(temp_a2) + 1):
    if temp_b1 <= i < temp_b2:
        result = i
        break

print(result)