Problem:


Score : 200 points

Problem Statement

There are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \ldots, 999999, 1000000.

Among them, some K consecutive stones are painted black, and the others are painted white.

Additionally, we know that the stone at coordinate X is painted black.

Print all coordinates that potentially contain a stone painted black, in ascending order.

Constraints

1 \leq K \leq 100

0 \leq X \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

K X

Output

Print all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.

Sample Input 1

3 7

Sample Output 1

5 6 7 8 9

We know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:

The three stones painted black are placed at coordinates 5, 6, and 7.

The three stones painted black are placed at coordinates 6, 7, and 8.

The three stones painted black are placed at coordinates 7, 8, and 9.

Thus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.

Sample Input 2

4 0

Sample Output 2

-3 -2 -1 0 1 2 3

Negative coordinates can also contain a stone painted black.

Sample Input 3

1 100

Sample Output 3

100



Sample input:
3 7


Sample output:
5 6 7 8 9

Submission status: Runtime Error

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

k, x = [int(i) for i in input().split()]
minimum = 1_000_000 - k + 1 if x + k - 1 > 1_000_000 else max(x - k + 1, -1_000_000)
maximum = -1_000_000 + k - 1 if x - k - 1 < -1_000_000 else min(x + k - 1, 1_000_000)
print(*range(minimum, maximum + 1))

Submission status: Runtime Error

Solution code:
import numpy as np
k,x = map(int,input().split())

result = np.linspace(x-k+1,x+k-1,k*2-1,dtype = 'int')

for i in range(k*2-1):
    print(result[i],end = " ")

Submission status: Runtime Error

Solution code:
import numpy as np
K, X = map(int, input().split())

if min(-1000000, X-(K-1)) != X-(K-1) and max(1000000, X+(K-1)) != X+(K-1):
    left = X-(K-1)
    right = X+(K-1)
elif min(-1000000, X-(K-1)) == X-(K-1):
    left = -1000000
    right = X+(K-1)
elif max(1000000, X+(K-1)) == X+(K-1):
    left = X-(K-1)
    right = 1000000
else:
    left = -1000000
    right = 1000000

ans = list(map(str,range(left,right+1)))
print(' '.join(ans))

Submission status: Runtime Error

Solution code:
k,x=map(int,input().split())
a=x-k+1
b=x+k-1
a=min(a,-1000000)
b=max(b,1000000)
c=range(a,b+1)
c=' '.join(c)
print(c)

Submission status: Runtime Error

Solution code:
k, x = map(int,input().spit())

L = []

for i in range(k*2-1):
    print(x-k+1+i,end=' ')

Submission status: Runtime Error

Solution code:
k,x = map(int,input().solit())
result = []
for i in range(x-k+1, x+k-1):
  result.append(i)
for s in result:
  print(s, end =" ")

Submission status: Runtime Error

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

li = [i for i in range(x-k+1,x+k)]

print(' '.join(li))

Submission status: Runtime Error

Solution code:
k = int(input())
x = int(input())
result = []
for i in range(x-k+1, x+k-1):
  result.append(i)
for s in result:
  print(u, end =" ")

Submission status: Runtime Error

Solution code:
k, x = map(int, input().split())
l =  [x-n for n in range(1,k)] + [x+n for n in range(k)]
l = [x for x in l if x <= 1000000]
l = [x for x in l if x >= 1000000 * -1]
l = sorted(l)
print(" ".join(map(str, s_l)))

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
ans = ""
kaisu = a[0] * 2 +1
for i in kaisu:
    b = a[1] - a[0] + 1 + i
    ans = ans + str(b) + " "
print(ans[:-1])

Submission status: Runtime Error

Solution code:
k, x = input().split(' ')
k, x = int(k), int(x)   
arr = []
     
for i in range(k): 
 arr.append(x-i)
 arr.append(x+i)
arr = list(set(arr))
arr.sort()
text = ""
for i in range(len(arr) - 1):
  text += arr[i] + " "
print(text + arr[len(arr) - 1])

Submission status: Runtime Error

Solution code:
K,X = map(int,input().split())
A = []
for i in range(-K+1,K):
    A.append(int(X+i))
print(*A)
K,X = map(int,input().split())
A = []
for i in range(-K+1,K):
    A.append(int(X+i))
print(*A)

Submission status: Runtime Error

Solution code:
min_b = max(-1000000, x - (k - 1) )
max_b = min(1000000, x + (k - 1) )
ans = []
for i in range(min_b, max_b + 1):
  ans.append(str(i))
print(" ".join(ans))

Submission status: Runtime Error

Solution code:
import numpy as np
k,x = map(int,input().split())

result = np.linspace(x-k+1,x+k-1,k*2-1,dtype = 'int')
print(result)

Submission status: Runtime Error

Solution code:
K, X = map(int, input().split())
print(' '.join([i for i in range(X-K+1, X+K)]))

Submission status: Runtime Error

Solution code:
K, X = map(int, input().split())

l = K // 2
lower = X - l
upper = X + l
ans = [i for i in range(lower, upper+1)]
ans_str = " ".join(ans)
print(ans_str)

Submission status: Runtime Error

Solution code:
k, x = map(int, input().split())
i = max(−1000000, x - k + 1)
while i <= min(1000000, x + k - 1):
  print(i, end=" ")
  i += 1