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: Runtime Error

Solution code:
import math
import sys
a,b=map(int,input().spliit())
a2=math.ceil(a/0.08)
a3=math.floor((a+1)/0.08)
if a2>a3:
    print("-1")
    sys.exit()
b2=math.ceil(b/0.1)
b3=math.floor((b+1)/0.1)
if b2>b3:
    print("-1")
    sys.exit()
if b2<a2:
    if a2<(b+1)/0.1:
        print(a2)
    else:
        print("-1")
if a2<b2:
    if b2<(a+1)/0.08:
        print(b2)
    else:
        print("-1")
if a2==b2:
    print(a2)

Submission status: Runtime Error

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: Runtime Error

Solution code:
import math

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

ans = []
for i in range(10000):
    a_shouhizei = math.floor(i * 8/100)
    b_shouhizei = math.floor(i * 10/100)
    if a_shouhizei == a and b_shouhizei == b:
        ans.append(i)
print(min(ans))

Submission status: Runtime Error

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

price_list_A = []
price_list_B = []

for i in range(1, 100):
    price_list_A.append(int(i / 0.08))
    price_list_B.append(int(i / 0.10))

flag = 1
for i in range(1, 100):
    if (price_list_A[i] <= i and i <= price_list_B[i+1]):
        print(i)
        flag = 0
        break
    else:

if flag == 1:
    print(-1)

Submission status: Runtime Error

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

S = input().strip()
Q = int(input())

reverse = False

before = ""
after = ""

for _ in range(Q):
    s = input().strip()
    if s[0] == "1":
        reverse = not reverse
    else:
        _, f, c = s.split()
        if f == "1":
            if reverse:
                after = after + c
            else:
                before = c + before
        else:
            if reverse:
                before = c + before
            else:
                after = after + c

if reverse:
    print(after[::-1] + S[::-1] + before[::-1])
else:
    print(before + S + after)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
a,b=map(int,input().split())
for i in range(1,1100):#max_a=1
    if int(i*0.08)==a and int(i*0.1)==b:
        ans=i
        bresak
    if i==1099:
        ans=-1

print(ans)

Submission status: Runtime Error

Solution code:
a,b= map(int, input().split())
aa = a + 0.9
bb = b + 0.9

if int(bb/0.1) > 1000:
bb = 1000

aaa = set(range(int(a/0.08),int(aa/0.08)))
bbb = set(range(int(b/0.1), int(bb/0.1)))

x = list(aaa.intersection(bbb))

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

Submission status: Runtime Error

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

price_list_A = []
price_list_B = []

for i in range(1, 100):
    price_list_A.append(int(i / 0.08))
    price_list_B.append(int(i / 0.10))

print(price_list_A[1])

flag = 1
for i in range(1, 100):
    if (price_list_A[i] <= i <= price_list_B[i+1]):
        print(i)
        flag = 0
        break
    else:

if flag == 1:
    print(-1)

Submission status: Runtime Error

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

price_list_A = []
price_list_B = []

for i in range(1, 100):
    price_list_A.append(int(i / 0.08))
    price_list_B.append(int(i / 0.10))

print(price_list_A[1])

flag = 1
for i in range(1, 100):
    if (price_list_A[i] <= i <= price_list_B[i+1]):
        print(i)
        break
    else:

if flag == 1:
    print(-1)

Submission status: Runtime Error

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

P = A / 0.08
PX = (A+1) / 0.08

PP = B / 0.1
PPX = (B+1) /0.1 

if PP <= P and P < PPX: round(print(P))
elif P <= PP and PP < PX: round(print(PP))
elif 
else:print(-1)

Submission status: Runtime Error

Solution code:
aa, bb = map(int,input().split())
a = aa / 0.08
b = bb / 0.1
c = []
if (a-int(a))<0.5:
    for i in range(12):
        if (b-int(b))<0.1:
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
        else:
            for j in range(10):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
else:
    for i in range(13):
       if (b-int(b))<0.1:
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
        else:
            for j in range(10):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                pass
            for j in range(9):
                if int(a)+i == int(b)+j:
                    c.append(int(a)+i)
                else:
                    pass
if c==[]:
    print(-1)
elif (int(a)+i)<=0:
    print(-1)
else:
    print(*c[:1])

Submission status: Runtime Error

Solution code:
#文字列
s=list(input())
n=int(input())
for i in range(n):
    li = input().split()
    if(li[0]=="1"):
        s.reverse()
    else:
        if(li[1]=="1"):
            s.insert(0, li[2])
        else:
            s.append(li[2])

print("".join(s))

Submission status: Runtime Error

Solution code:
import math

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

x = math.ceil(A/0.08) 
y = math.ceil(B/0.1)

if(math.floor(x*0.1)!=B):
  print("-1")

else:
  while(y<=x):
    if(math.floor(y*0.1)=B & math.floor(y*0.08)=A):
      if(y<r):
        r=y
    y+=1

  print(r)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a < 1 or b < 1:
    print(-1)
else:
    amin = a*100//8 + ((a*100)%8 and 1)
    amax = (a+1)*100//8 + (max((a+1)*100)%8, 1) or 1)
    bmin = b*100//10 + ((b*100)%10 and 1)
    bmax = (b+1)*100//10 + (max(((b+1)*100)%10, 1) or 1)
    A = set(range(amin, amax))
    B = set(range(bmin, bmax))
    if (A & B):
        print(min(A&B))
    else:
        print(-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

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

x = math.ceil(A/0.08) 
y = math.ceil(B/0.1)

if(math.floor(x*0.1)!=B):
  print("-1")

else:
  while(y<=x):
    if(math.floor(y*0.1)==B & math.floor(y*0.08)=A):
      if(y<r):
        r=y
    y+=1

  print(r)

Submission status: Runtime Error

Solution code:

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

#res*0.08=a
#res=a/0.08

mina = float(a)/0.08 
maxa = float(a+1)/0.08
# mina <= resa < maxa 

minb = float(b)/0.1
maxb = float(b+1)/0.1
#minb <= resb < maxb

resa=[]
resa.append (int(mina))
resa.append (int(maxa))
print (resa)

resb=[]
resb.append (int(minb))
resb.append (int(maxb))
print(resb)

if resa & resb != 0:
    print(min((resa)&(resb))

else:
    print(-1)

Submission status: Runtime Error

Solution code:

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

#res*0.08=a
#res=a/0.08

mina = float(a)/0.08 
maxa = float(a+1)/0.08
# mina <= resa < maxa 

minb = float(b)/0.1
maxb = float(b+1)/0.1
#minb <= resb < maxb

resa=[]
resa.append (int(mina))
resa.append (int(maxa))
print (resa)

resb=[]
resb.append (int(minb))
resb.append (int(maxb))
print(resb)

if resa & resb != 0:
    print(min((resa)&(resb))

else:print(-1)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
x = A/0.08
y = B/0.1
if x == y:
    print(round(x))
else:
    print(-1)

Submission status: Runtime Error

Solution code:
import math
import bisect
import numpy as np

x_minA = math.ceil(100 / 8 * A)
x_minB =  10 * B
x_maxA = math.floor(100 / 8 * (A+1))
x_maxB = 10 * (B+1)
if x_minA > x_maxB or x_minB > x_maxA:
  print(-1)
else:x_min = max(x_minA, x_minB)
  x_max = min(x_maxA, x_maxB)
  tansaku = np.array(range(max(x_minA, x_minB), min(x_maxA, x_maxB)+1))
  insert_index_a = bisect.bisect_left(tansaku*8/100-A,1)
  insert_index_b = bisect.bisect_left(tansaku/10-B,1)
  print(int(tansaku[min(insert_index_a, insert_index_b)]))

Submission status: Runtime Error

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

a = input1[0]
b = input1[1]

a1 = math.ceil(a / 0.08)
a2 = math.ceil((a+1) / 0.08)
b1 = math.ceil(b / 0.1)
b2 = math.ceil((b+1) / 0.1)
# alist = list(range(a1, a2))
# blist = list(range(b1, b2))

# print(alist)
# print(blist)
for i in range(a1, a2):
    for j in range(b1, b2):
        if i == j:
            print(i)
            # print(i * 0.08)
            # print(i * 0.1)
            exit(1)
print("-1")

Submission status: Runtime Error

Solution code:
import math

A = int(input())
B = int(input())
x = A/0.08
y = B/0.1
if x == y:
    print(math.floor(x))
else:
    print(-1)

Submission status: Runtime Error

Solution code:
x = list(map(int,input().split(" ")))
a = x[0]
b = x[1]
import math

xa = math.floor( a / 0.08 )
xb = math.floor( b / 0.1 )
xa_1 = math.floor( (a+1) / 0.08 )
xb_1 = math.floor( (b+1) / 0.1 )

a_list = []
b_list = []

for i in range(xa,xa_1):
    a_list.append(i)
for i in range(xb,xb_1):
    b_list.append(i)

a_b_and = set(a_list) & set(b_list)
a_b_list = list(a_b_and)

if a_b_list[0] == 0:
    print(-1)

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

Submission status: Runtime Error

Solution code:
import math

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

x = math.ceil(A/0.08)
y = math.floor(B/0.1)

if(math.floor(x*0.1)!=B):
  print("-1")

else:
  while(y<=x):
    if(math.floor(y*0.1)==math.floor(y*0.08)):
      if(y<r):
        r=y
    y+=1

  print(r)

Submission status: Runtime Error

Solution code:
x = list(map(int,input().split(" ")))
a = x[0]
b = x[1]
import math

xa = math.floor( a / 0.08 )
xb = math.floor( b / 0.1 )
xa_1 = math.floor( (a+1) / 0.08 )
xb_1 = math.floor( (b+1) / 0.1 )

a_list = []
b_list = []

for i in range(xa,xa_1):
    a_list.append(i)
for i in range(xb,xb_1):
    b_list.append(i)

a_b_and = set(a_list) & set(b_list)
a_b_list = list(a_b_and)

if a_b_list[0] == 0:
    print(-1)
elif len(a_b_list) >= 1:
    print(a_b_list[0])
else:
    print(-1)

Submission status: Runtime Error

Solution code:
def main():
    s = input()
    q = int(input())

    for _ in range(q):
        tmp = input()
        if len(tmp) == 1:
            s = s[::-1]
        else:
            if tmp[2] == '1':
                s = tmp[4] + s
            else:
                s = s + tmp[4]
    print(s)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

Submission status: Runtime Error

Solution code:
N,A,B = input().split()
N = int(N)
A = int(A)
B = int(B)
C = A + B

if N / C < int(N / C):
    T = int(N / C) - 1
else:
    T = int(N / C)

if T == 0:
    T = 1

if N - T * C > 0:
    if A >= N - T * C:
        count = T * A + (N - T * C)
        print(count)
    else:
        count = T * A + A
        print(count)
else:
    count = T * A
    print(count)

Submission status: Runtime Error

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

x_a = np.arange(math.ceil(12.5 * A), math.ceil(12.5 * (A + 1)))
x_b = np.arange(10 * B, 10 * (B + 1))

a_set = set(x_a)
b_set = set(x_b)
#aとbに共通するものを抽出
c_set = a_set & b_set
c = list(c_set)
x = min(c)
print(x)

if not c:
    print("-1")

else:
    continue

Submission status: Runtime Error

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

x_a = np.arange(math.ceil(12.5 * A), math.ceil(12.5 * (A + 1)))
x_b = np.arange(10 * B, 10 * (B + 1))

a_set = set(x_a)
b_set = set(x_b)
c_set = a_set & b_set
c = list(c_set)
x = min(c)
print(x)

if not c:
    print("-1")

Submission status: Runtime Error

Solution code:
#output <= 1000

nums = [int(e) for e in input().split()]
flag = 0
for i in range(1,1001):
  if ((((i * 8) // 100) == nums[0]) & (((i * 10) // 100) == nums[1])):
    flag = 1
    print(i)
    break

if flag = 0:
    print(-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

AA = A*100//8
AF = (A+1)*100//8 + 1 if (A+1)*100%8!=0 else (A+1)*100//8
BB = B*10
AAA = [i for i in range(AA,AF]
BBB = [i for i in range(BB,(B+1)*10)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list and (12<min(AB_list)<=1000) else -1
print(ans)

Submission status: Runtime Error

Solution code:
AA=int(input())
BB=int(input())
AA_o = AA/0.08
BB_o = BB/0.1
AAA = AA+1
BBB = BB+1
AAA_o = AAA/0.08
BBB_o = BBB/0.1

if AA_o > int(AA_o):
    AA_o = int(AA_o)+1
else:
    AA_o = int(AA_o)

if AAA_o > int(AAA_o):
    AAA_o = int(AAA_o)+1
else:
    AAA_o = int(AAA_o)
    
if BB_o > int(BB_o):
    BB_o = int(BB_o)+1
else:
    BB_o = int(BB_o)

if BBB_o > int(BBB_o):
    BBB_o = int(BBB_o)+1
else:
    BBB_o = int(BBB_o)
    
if BB_o > AAA_o:
    print(-1)
else:
    print(max(AA_o,BB_o))

Submission status: Runtime Error

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

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

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

print(min_ans)

Submission status: Runtime Error

Solution code:
import math

list_8 = []
list_10 = []

for i in range(101):
  list_8.append( math.ceil((i+1) * 12.5) )
  list_10.append( (i+1) * 10 )
  
A, B = map(int, input().split())

A_ = list_8[A]
if B < 100:
  
B_ = list_10[B]
B = list_10[B-1]

if A_ < B or B_ < A:
  print(-1)
elif B <= A_:
  print(B)
else:
  print(A)

Submission status: Runtime Error

Solution code:
import sys
import math

read = ys.std.readline
S = read()

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

for i in range(1000+1):
    if A == math.ceil(i * 0.08):
        if B == math.ceil(i * 0.1):
            print(i)
            return
print(-1)

Submission status: Runtime Error

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

before_A = A/0.08
before_B = B/0.1

if A > B:
    print(-1)
    break
else:
    if before_A <= before_B:
        ans = before_B
        if int(before_B * 0.08) == A:
            print(int(ans))
        else:
            print(-1)
    else:
        ans = before_A
        if int(before_A * 0.1) == B:
            print(int(ans))
        else:
            print(-1)

Submission status: Runtime Error

Solution code:
def main():
    a, b = map(int, input().split())
    x = 13
    while x <= int(a/0.08):
        x+=1
        if int(x*0.08) == a:
            if int(x*0.1) == b:
                return x
    return -1



if __name__ == "__main__":
    print(main()

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if int(a/(0.08)) == int(b/(0.1)):
    cost = int(a/(0.08))
else:
    inter = abs(int(a/(0.08)) - int(b/(0.1)))
    mn = min(int(a/(0.08)) , int(b/(0.1)))
             
    for i in range(inter*2):
        if int(cost*(0.08))==a:
            if int(cost*(0.1))==b:
                break
        mn += 1
        if i ==inter*2-1:
            cost = -1
print(cost)

Submission status: Runtime Error

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

if a%2==0:
  lower1=int(a*100/8)
  upper1=(a+1)*100/8
  upper1=max(lower,int(upper1)-1)  
else:
  lower1=a*(100/8)
  upper1=int((a+1)*100/8)
  if (upper1)-int(lower1)<=1:
    print(-1)
    sys.exit()
  else:
    lower1=int(lower1)+1
    if lower1==upper1:
      print(-1)
      sys.exit()
    else:
      pass
  
lower2=(b)*10
upper2=(b+1)*10

lower=max(lower1,lower2)
upper=min(upper1,upper2)
if upper-lower<0:
  print(-1)
else:
  print(lower)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
ans=0
flag=False
for i in range(b*10,(b+1)*10+1):
    x=i*8
    if 100*(a+1>x>=100*a:
        flag=True
        ans=i
        break
print(ans if flag else -1)

Submission status: Runtime Error

Solution code:
import math

list_8 = []
list_10 = []

for i in range(100):
  list_8.append( math.floor((i+1) * 12.5) )
  list_10.append( (i+1) * 10 )
  
A, B = map(int, input().split())

A_ = list_8[A]
A = list_8[A-1]

B_ = list_10[B]
B = list_10[B-1]

if A_ < B or B_ < A:
  print(-1)
elif B <= A_:
  print(B)
else:
  print(A)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if int(a/(0.08)) == int(b/(0.1)):
    cost = int(a/(0.08))
else:
    inter = abs(int(a/(0.08)) - int(b/(0.1)))
    mn = min(int(a/(0.08)) , int(b/(0.1)))
             
    for i in range(inter*2):
        if int(cost*(0.08))==a:
            if int(cost*(0.1))==b:
                break
        mn += 1
        if i ==inter:
            cost = -1
print(cost)

Submission status: Runtime Error

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

a = input1[0]
b = input1[1]

a1 = math.ceil(a / 0.08)
a2 = math.ceil((a+1) / 0.08)
b1 = math.ceil(b / 0.1)
b2 = math.ceil((b+1) / 0.1)
# alist = list(range(a1, a2))
# blist = list(range(b1, b2))

# print(alist)
# print(blist)
for i in range(a1, a2):
    for j in range(b1, b2):
        if i == j:
            print(i)
            # print(i * 0.08)
            # print(i * 0.1)
            exit(1)
print(-1)

Submission status: Runtime Error

Solution code:
import math

list_8 = []
list_10 = []

for i in range(100):
  list_8.append( math.floor((i+1) * 12.5) )
  list_10.append( (i+1) * 10 )
  
A, B = map(int, input().split())

A_ = list_8[A]
A = list_8[A-1]

B_ = list_10[B]
B = list_10[B-1]

print(A, A_, B, B_)

if A_ < B or B_ < A:
  print(-1)
elif B <= A_:
  print(B)
else:
  print(A)

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
price_A = (A * 100) // 8
price_B = B * 10
ans1 = -1
ans2 = -1

if price_A // 10 == B:
    ans1 = price_A
if (price_B*8) // 100 == A:
    ans2 = price_B
    
if ans1 != -1 and ans2 != -1:
    ans = min(ans1, ans2)

print(ans)

Submission status: Runtime Error

Solution code:
import math
a, b = (int(i) for i in input().split())
x = math.ceil(a / 0.08)
flag = False
if (math.floor(x * 0.1) == b):
    flag = True
else:
    while math.floor(x * 0.08) == a:
        x = x + i
        if (math.floor(x * 0.1) == b):
            flag = True
            break
if flag:
    print(int(x))
else:
    print(-1)

Submission status: Runtime Error

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

eightper = 0.08
tenper = 0.1
ans = -1
for i in range(1,100*(1+tenper)+1):
    if int(i*eightper)==a:
        if int(i*tenper)==b:
            ans=i
            break
print(ans)

Submission status: Runtime Error

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

a = input1[0]
b = input1[1]

a1 = math.ceil(a / 0.08)
a2 = math.ceil((a+1) / 0.08)
b1 = math.ceil(b / 0.1)
b2 = math.ceil((b+1) / 0.1)
alist = list(range(a1, a2))
blist = list(range(b1, b2))

# print(alist)
# print(blist)
for i in alist:
    for j in blist:
        if i == j:
            print(i)
            # print(i * 0.08)
            # print(i * 0.1)
            exit(1)
print(-1)

Submission status: Runtime Error

Solution code:
# 制約が小さいので全探索
def main():
  a, b = int(input().split())
  for i in range(1100):
    if int(i * 0.08) == a and int(i * 0.1) == b:
      print(i)
      return
  print(-1)

main()

Submission status: Runtime Error

Solution code:
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
a = list(map(int, input().split(" ")))
min8 = a[0]/0.08
max8 = (a[0]+1)/0.08
min10 = a[1]/0.1
max10 =(a[1]+1)/0.1
a = max(min8, min10)
if ((min8>=max10) or (max8<=min10)):
    print(-1)
else:
    print(Decimal(b).quantize(Decimal('0'), rounding = ROUND_HALF_UP))

Submission status: Runtime Error

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

tax8 = math.floor(a/0.08)
tax8p = math.floor((a + 1)/0.08)
tax10 = math.floor(b/0.1)
tax10p = math.floor((b + 1)/0.1)

if math.floor(tax8 * 0.08) != a or math.floor(tax10 * 0.1) != b:
    print(-1)
    exit(0)

tax8s = set(range(tax8, tax8p))
tax10s = set(range(tax10, tax10p))
print(list(tax8s & tax10s)[0])

Submission status: Runtime Error

Solution code:
import math
a,b=map(int,input().split())
A=math.ceil((a+1)/0.08)-1
B=math.ceil((b+1)/0.1)-1
A_=math.ceil(a/0.08)
B_=math.ceil(b/0.1)
C=math.floor(B*0.1)-mah.floor(B*0.08)
if b>80 or A<B_ or b-a>C:
    print(-1)
else:
    print(A_)

Submission status: Runtime Error

Solution code:
s = input()
n = int(input())

t = 0
for i in range(n):
  a = input().split()
  if int(a[0]) == 1:
    t += 1
    #s = s[::-1]
  else:
    if t % 2 == 1:
      s = s[::-1]
    t = 0
    if int(a[1]) == 1:
      s = a[2] + s
    if int(a[1]) == 2:
      s = s + a[2]
    
print(s)

Submission status: Runtime Error

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

a = input1[0]
b = input1[1]

a1 = math.ceil(a / 0.08)
a2 = math.ceil((a+1) / 0.08)
b1 = math.ceil(b / 0.1)
b2 = math.ceil((b+1) / 0.1)
alist = list(range(a1, a2))
blist = list(range(b1, b2))

# print(alist)
# print(blist)
for i in alist:
    for j in blist:
        if i == j:
            print(i)
            exit(1)
print(-1)

Submission status: Runtime Error

Solution code:
cmin = lambda a,b : a if a<b else b
cmax = lambda a,b : a if a>b else b
iin = lambda : int(input())
lin = lambda : list(map(int,input().split()))
rin = lambda n : [int(input()) for _ in range(n)]

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

ia = a//(0.08)
la = int(ia*0.08)
while la==a:
    ia += 1
    la = int(ia*0.08)
ia -= 1
lla =int(ia)

ia = a//0.08)
la = int(ia*0.08)
while la==a:
    ia -= 1
    la = int(ia*0.08)
ia = int(ia)+1

ib = b//(0.1)
lb = int(ib*0.1)
while lb==b:
    ib += 1
    lb = int(ib*0.1)
ib -= 1
llb = int(ib)

ib = b//(0.1)
lb = int(ib*0.1)
while lb==b:
    ib -= 1
    lb = int(ib*0.1)
ib = int(ib)+1

sa = set(range(ia,lla+1))
sb = set(range(ib,llb+1))
ans = sa & sb
print(min(ans) if ans else -1)

Submission status: Runtime Error

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

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

if ans1 = ans2:
    print(ans1)

elif 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)
elif ans1 < ans2:
    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: Runtime Error

Solution code:
A,B = map(int,input().split())
mina= 100
minb=100
a = set()
b = set()
C = A/0.08
D= B/0.08
E = (A+1)/0.08
F= (B+1)/0.08
if C.is_integer() ==False:
  C= C//0.08 +1

if D.is_integer() ==False:
  D= D//0.08

if E.is_integer() ==False:
  E= E//0.08 +1

if F.is_integer() ==False:
  F= F//0.08

for i in range(C,D):
  a.add(i)

for i in range(E,F):
  b.add(i)
c = a&b
d = list(c)
d.sort()
if d[0] == True:
  print(d[0])
else:
  print(-1)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math

if __name__ == "__main__":
    N, A, B = map(int, input().split())
    S = "b" * A + "r" * B
    S = S * math.ceil(1000000000000000000 / len(S))
    ret = S[:N].count("b")
    print(ret)import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    par = A / B
    if par < 0.8:
        print("-1")
        exit(0)
    else:
        a = math.ceil(A / 0.08)
        b = math.ceil(B / 0.1)
        # print(a , b)
        ret = a
        print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
if (A/0.08)%1==0.0:
    a1=int(A/0.08)
else:
    a1=int(A/0.08)+1
if (A/0.08)%1!=0.0:
    a2=int((A+1)/0.08)
else:
    a2=int((A+1)/0.08)-1

if (B/0.1)%1==0.0:
    b1=int(B/0.1)
else:
    b1=int(B/0.08)+1
if (B/0.1)%1!=0.0:
    b2=int((B+1)/0.1)
else:
    b2=int((B+1)/0.1)-1

#a=[]
#b=[]
for i in range(a1,a2+1):
    s=i
    a.append(s)
for i in range(b1,b2+1):
    t=i
    b.append(t)
print(a)
print(b)
if max(a)<min(b):
    print(-1)
elif max(b)<min(a):
    print(-1)
elif min(a)>=min(b):
    print(min(a))
else:
    print(min(b))

Submission status: Runtime Error

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

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

if ans1 = ans2:
    print(ans1)

elif 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)
elif: ans1 < ans2:
    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: Runtime Error

Solution code:
A,B=map(int,input().split())
import math
a=[]
for i in range(13,1010):
    if math.floor(i*0.08)==A and math.floor(i*0.10)==B:
        a.append(i)
print(a[0])

Submission status: Runtime Error

Solution code:

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

if a%2==0:
  lower1=int(a*100/8)
else:
  lower1=a*(100/8)
  upper1=int((a+1)*100/8)
  if (upper1)-int(lower1)<1:
    print(-1)
    sys.exit()
  else:
    lower1=int(lower1)+1
    if lower1=upper1:
      print(-1)
      sys.exit()
    else:
      pass
  
lower2=(b)*10
upper2=(b+1)*10

lower=max(lower1,lower2)
if lower=uppwer1:
  print(-1)
else:
  print(lower)

Submission status: Runtime Error

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)
    if int(x[0] * 0.08) != A:
        a
    if int(x[1] * 0.08) != A:
        a
    if int(y[0] * 0.1) != B:
        a
    if int(y[1] * 0.1) != B:
        a

    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: Runtime Error

Solution code:
#C
import sys

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,i*0.08,i*0.1)
        break
    if i==999:
        print(-1)
        sys.exit()

print(ans)

Submission status: Runtime Error

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 math.ceil(rangeB[0]) < rangeA[1]:
    print(math.ceil(rangeB[0]))
    exit(0)
elif rangeA[0] > rangeB[0]:
  if math.ceil(rangeA[0]) < rangeB[1]:
    print(math.ceil(rangeA[0]))
    exit(0)
else:  # rangeA[0] == rangeB[0]
  if math.ceil(rangeA[0]) < rangeB[1] and math.ceil(rangeA[0]) < rangeA[1]: 
    print(math.ceil(rangeA[0]))
  	exit(0)
print(-1)

Submission status: Runtime Error

Solution code:
import numpy as np
import math
s = input().split()
A = int(s[0])
B = int(s[1])

x_A_list = range(int(100/8*A),int(100/8*A+100/8)+1)
x_B_list = range(int(10*B),int(10*B+10)+1)
xAxB_and = set(x_A_list)&set(x_B_list)
l = list(xAxB_and)
x = min(l)
print(x)

Submission status: Runtime Error

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

for x in range(0,101):
  calc_a = int(x*0.08)
  calc_b = int(x*0.10)
  if calc_a == a and calc_b == b:
    ans = x
    print(ans)
    break
if ans == -1:
  print(ans)

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split())
x = a / 0.08
y = b / 0.1
if x == not y:
  print(-1)
if x == y:
  print(x)

Submission status: Runtime Error

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

ans = []

true_A_max = A + 0.999
true_B_max = B + 0.999

X_A = math.floor(A / 0.08)
X_max_A = math.ceil(true_A_max /0.08)
X_B = math.floor(B / 0.1)
X_max_B = math.ceil(true_B_max /0.08)

if X_max_A - X_A >= X_max_B - X_B:
    X_min = X_B
    X_max = X_max_B

else:
    X_min = X_A
    X_max = X_max_A

for X in range(X_min, X_max):
    cal_A = math.floor(X * 0.08)
    cal_B = math.floor(X * 0.1)
    
    if cal_A == A and cal_B == B:
        ans.append(X)
            
if len(ans) > 0:
    print(min(ans))
else:
    print(-1)

Submission status: Runtime Error

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

a = input1[0]
b = input1[1]

a1 = math.ceil(a / 0.08)
a2 = math.ceil((a+1) / 0.08)
b1 = math.ceil(b / 0.1)
b2 = math.ceil((b+1) / 0.1)
alist = range(a1, a2)
blist = range(b1, b2)

for i in alist:
    for j in blist:
        if i == j:
            print(i)
            exit(1)
print(-1)