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: Accepted

Solution code:
def main(sample_file = ''):

    """ convenient functions
    # for i, a in enumerate(iterable)
    # q, mod = divmod(a, b)
    # divmod(x, y) returns the tuple (x//y, x%y)
    # Higher-order function: reduce(operator.mul, xyz_count, 1)
    # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f
    """

    """convenient decorator
    # @functools.lru_cache():
    # to facilitate use of recursive function
        # ex:
        # from functools import lru_cache
        # import sys
        # sys.setrecursionlimit(10**9)
        # @lru_cache(maxsize=None)
        # def fib(n):
        #     if n < 2:
        #         return n
        #     return fib(n-1) + fib(n-2)
        # print(fib(1000))
    """
    
    # import numpy as np
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html
    # accumulate() returns iterator! to get list: list(accumulate())
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  # prime factor
        b, e = 2, 0  # base, exponent
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        # TODO: How should I do when n - r is negative?
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html
    from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html
    import operator
    from operator import itemgetter #sort 
    # ex1: List.sort(key=itemgetter(1))
    # ex2: sorted(tuples, key=itemgetter(1,2))
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)
    def make_divisors(n, reversed=False):
        """create list of divisors
        
        Args:
            number (int): number from which list of divisors is created
            reversed (bool, optional): ascending order if False. Defaults to False.
        
        Returns:
            list: list of divisors
        """
        divisors = set()
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.add(i)
                divisors.add(n//i)
        return sorted(list(divisors),reverse=reversed)
    
    # first create factorial_list
    # fac_list = mod_factorial_list(n)
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!
    def modinv(a, p = MOD):
        # evaluate reciprocal using Fermat's little theorem:
        # a**(p-1) is identical to 1 (mod p) when a and p is coprime
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        # fac_list = modfactorial_list(100)
        # print(modcomb(100, 5, modfactorial_list(100)))
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    class UnionFindTree:
        """union find tree class
        TODO: fix this description...
        how to use (example):
        >>  uf = UnionFindTree(N) 
        >>  if uf.find_root(a) == uf.find_root(b):
        >>      do something
        >>  else:
        >>      do something
        >>      uf.unite(a, b)
        """
        def __init__(self, N):
            self.root = [-1] * (N+1)
            self.rank   = [0]  * (N+1)
            self.connected_num = [1] * (N+1)
    
        def find_root(self,x):
            root = self.root
            while root[x] != -1:
                x = root[x]
            return x
    
        def unite(self,x,y):
            root = self.root
            rank = self.rank
            connected_num = self.connected_num
            find_root = self.find_root
    
            rx = find_root(x)
            ry = find_root(y)
            if rx != ry:
                if rank[rx] < rank[ry]:
                    root[rx] = ry
                    rx,ry = ry,rx
                else:
                    if rank[rx] == rank[ry]:
                        rank[rx] += 1
                    root[ry] = rx       
                connected_num[rx] += connected_num[ry]

    """ initialize variables and set inputs
    # initialize variables
        # to initialize list, use [0] * n
        # to initialize two dimentional array, use [[0] * N for _ in range(N)]
    # set inputs
        # put inputs between specific values (almost as quickly)
        # ex) S = [-INF] + [int(r()) for _ in range(A)] + [INF]
        # open(0).read() is sometimes useful:
        # ex) n, m, *x = map(int, open(0).read().split())
        #     min(x[::2]) - max(x[1::2])
        # ex2) *x, = map(int, open(0).read().split())
        #     don't forget to add comma after *x if only one variable is used
    # preprocessing
        # transpose = [x for x in zip(*data)]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
        # flat = [flatten for inner in data for flatten in inner]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]
    # calculate and output
        # output pattern
        # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6
    """

    # functions used
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    # single int: int(r())
    # single string: r()
    # single float: float(r())
    # line int: R()
    # line string: r().split()
    # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]
    # lines int: [R() for _ in range(n)]
    """

    # for test
    if sample_file:
        sys.stdin = open(sample_file)
        
    # ----------------------------------
    # main

    K, X = R()
    mink = X - (K-1)
    maxk = X + (K-1)
    mink = max(mink, -1000000)
    maxk = min(maxk, 1000000)
    print(*[i for i in range(mink, maxk+1)])
    
    # to finish code, use return instead of exit()
    # end of main
    # ----------------------------------

    """memo: how to use defaultdict of list
    # initialize
    Dic = defaultdict(list)
    # append / extend
    Dic[x].append(y)
    # three methods for loop: keys(), values(), items()
    for k, v in Dic.items():
    """
    
    """memo: how to solve binary problems
    # to make binary digits text
    >>> a = 5
    >>> bin_str_a = format(a, '#06b')
    >>> print(bin_str_a)
    0b0101 # first 2 strings (='0b') indicates it is binary
    """
    
    """memo: how to solve the problem
    creating simple test/answer
    greed
    simple dp
    graph
    """

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(' '.join(ans))

Submission status: Accepted

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

left = max([-1000000,(x - (k-1))])
right = min([1000000,(x + (k-1))])


for i in range(left,right+1):
    print(i, end = " ")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
k,x = map(int, input().split())


for i in range(x-k+1,x+k):
    if i >= -1000000 and i <= 1000000:
        print(i,end=" ")

print("")

Submission status: Accepted

Solution code:
k, x = list(map(int, input().split(' ')))
x -= k-1
a = []
for i in range(2*k-1):
    a.append(x)
    x += 1
print(' '.join(list(map(str, a))))

Submission status: Accepted

Solution code:
K,X=map(int, input().split())
for i in range(X-K+1,X+K):
  print(i,end=" ")

Submission status: Accepted

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

min_x = X - (K - 1)
if min_x < -1000000:
    min_x = -1000000


max_x = X + (K - 1)

if max_x > 1000000:
    max_x = 1000000

ans = ""
for i in range(min_x, max_x + 1):
    ans += str(i) + " "

print(ans[:-1])

Submission status: Accepted

Solution code:
k, x = map(int, input().split())
ans = [str(i+x-(k-1)) for i in list(range(2*k-1))]
print(' '.join(ans))

Submission status: Accepted

Solution code:
def calc(K, X):
    return ' '.join([str(x) for x in range(X - K + 1, X + K)])


(K, X) = tuple([int(s) for s in input().split(' ')])
print(calc(K, X))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

K, X = map(int, input().strip().split(' '))
for i in range(- K + 1, K):
    print(X + i)

Submission status: Accepted

Solution code:
def solve():
    k, x = list(map(int, input().split()))
    ans = []
    for i in range(x - k + 1, x + k):
        ans.append(i)
    return " ".join([str(i) for i in ans])


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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
listn = [i for i in range(b-a+1,b+a)]
print(*listn)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

k, x = input().split()
k = int(k)
x = int(x)

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

Submission status: Accepted

Solution code:
k, x, = map(int, input().split())
l = max(-1000000, x - k + 1)
r = min(1000000, x + k - 1)
ans = list(range(l, r + 1))
print(*ans)

Submission status: Accepted

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

a = [i for i in range(x-k+1, x+k)]
ans = ' '.join(list(map(str, a)))
print(ans)

Submission status: Accepted

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

sita = x - k
ue = x + k
ans = ''

if sita == ue:
    print(sita)
else:
    for i in range(sita+1,ue):
        ans += str(i) + ' '
    print(ans)

Submission status: Accepted

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

print(*[i for i in range(X - K + 1, X + K)])

Submission status: Accepted

Solution code:
k, x = [int(i) for i in input().split()]
print(" ".join([str(i) for i in range(max(-1000000, x - k + 1), min(1000001, x + k))]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k,x=list(map(int,input().split()))
start=max(-1*10**6,x-(k-1))
end=min(10**6,x+(k-1))
for i in range(start,end+1):
	print(i,end=" ")
print()

Submission status: Accepted

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

_max = 1000000
_min = -1000000


ans_l = []

for i in range(K-1, 0, -1):
    if X-i <= _max and X-i >= _min:
        ans_l.append(X-i)


for i in range(K):
    if X+i <= _max and X+i >= _min:
        ans_l.append(X+i)

print(*ans_l)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

def main(): 
    K, X = LI()
    start = X-K+1
    end = X+K-1
    li = [str(x) for x in list(range(start, end+1)) if -1000000 <= x <= 1000000]
    print(' '.join(li))

main()

Submission status: Accepted

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

m,M = -1000000,1000000
if X - (K - 1) > m: m = X - (K - 1)
if X + (K - 1) < M: M = X + (K - 1)

ans = [i for i in range(m,M+1)]
print(' '.join(map(str,ans)))

Submission status: Accepted

Solution code:
K, X = map(int, input().split())
ans = [i for i in range(X-K+1, X+K) if (i>-1000000 and i<1000000)]
print(*ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(K: int, X: int):
    A = []
    for i in range(2*K-1):
        A.append(str(X-K+i+1))
    print(' '.join(A))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(K, X)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(*range(x - (k - 1), x + (k - 1) + 1))

Submission status: Accepted

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

ans = []
sta = X-(K-1)
end = X+(K-1)

for i in range(sta,end+1):
  ans.append(i)
  
print(*ans)

Submission status: Accepted

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

ans = []
for i in range(x-k+1, x+k):
    ans.append(str(i))

print(" ".join(ans))

Submission status: Accepted

Solution code:
[k,x] = [int(i) for i in input().split()]
ls =[]
if x - k + 1 < -100000:
    for i in range(-100000,x+k):
        ls.append(i)
elif x + k - 1 > 100000:
    for i in range(x - k + 1, 100001):
        ls.append(i)
else:
    for i in range(x - k + 1,x + k):
        ls.append(i)
ans = ""
for i in range(len(ls)):
    ans += str(ls[i]) + " "
print(ans[:-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K,X = map(int,input().split())
R = 1000000 - X
L = X + 1000000
if R <= K:
    for i in range(X-K+1,1000001):
        print(i,end = " ")
elif L <= K:
    for i in range(-1000000,X+K):
        print(i,end = " ")
else:
    for i in range(X-K+1,X+K):
        print(i,end = " ")

Submission status: Accepted

Solution code:

import sys

def main():
    K,X = [int(i) for i in sys.stdin.readline().strip().split()]
    MIN = -1000000
    MAX = 1000000
    start = max(X - (K -1), MIN)
    end = min(MAX, X + (K - 1))
    print(" ".join([str(i) for i in range(start, end+1)]))
        


def solve():
    pass


if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = []

#x - (k - 1) -> x + (k - 1)
for i in range(x - (k - 1), x + (k - 1) + 1):
    ans.append(i)

#print(ans)
print(' '.join([str(i) for i in ans]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K, X = map(int, input().split())
A = [i for i in range(X-K+1, X+K)]
ans =[]
for a in A:
  if a<-1000000 or 1000000<a:
    continue
  ans += [str(a)]
print(' '.join(ans))

Submission status: Accepted

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

print(' '.join(map(str, range(x-(k-1),x+k))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
k, x = map(int, input().split())
s = max(-1000000, x - k + 1)
e = min(1000000, x + k)
print(" ".join([str(i) for i in range(s, e)]))

Submission status: Accepted

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

num = k - 1
ans = []
for i in range(x-num, x+num+1):
    ans.append(i)

print(' '.join(map(str, ans)))

Submission status: Accepted

Solution code:
k,x= map(int,input().split())
res = x -k + 1
for i in range(2*k-1):
    print(res,end ='')
    if i!=2*k-1:
        print(' ',end='')
    res +=1
print()

Submission status: Accepted

Solution code:
k,x = [int(x) for x in input().split()]
for i in range(x-k+1,x+k):
	print(i,end=' ')

Submission status: Accepted

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

Submission status: Accepted

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


min_x = max(X-K+1,-1000000)

max_x = min(X+K-1, 1000000)

text = ""
for i in range(min_x,max_x+1):
    text += "{} ".format(i)

print(text[:-1])

Submission status: Accepted

Solution code:
k, x = map(int, input().split())
ans = []
for i in range(x-k+1, x+k):
    ans.append(i)
print(' '.join(map(str, ans)))

Submission status: Accepted

Solution code:

k,x = map(int,input().split())
#s = [1 if i=='R' else 0 for i in S]



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





print(' '.join(str(x) for x in ans))

Submission status: Accepted

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

    for i in range(X - K + 1, X + K):
        print(i,end=' ')
  
main()

Submission status: Accepted

Solution code:
# coding: utf-8
k,x = map(int, input().split())
MIN = max(x-k+1, -1000000)
MAX = min(1000000, k+x-1)

ans = [x for x in range(MIN,MAX+1)]

print(*ans)

Submission status: Accepted

Solution code:
import math 
K, X = map(int, input().split())
for i in range(-1000000, 1000000):
    if i in range(X - K + 1, X + K):
        print(i)

Submission status: Accepted

Solution code:
k,x = map(int, input().split())
ans = [i for i in range(x-(k-1), x+k)]

print(*ans)

Submission status: Accepted

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

minb = X - K + 1
maxb = X + K - 1

for i in range(minb, maxb + 1):
	print(i, end="")
	print(" ", end="")
print("\n")

Submission status: Accepted

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

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

print(' '.join(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k, x = map(int, input().split())
for i in range(x - (k - 1), x + k):
    if - 1000000 <= i and i <= 1000000:
        print(i, end=" ")

Submission status: Accepted

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

for i in range(X - K + 1, X + K):
    print(i, end=' ')

print()

Submission status: Accepted

Solution code:
k,x=map(int,input().split())
for i in range(k-1):
  print(x-k+1+i)
print(x)
for i in range(k-1):
  print(x+i+1)

Submission status: Accepted

Solution code:
words = lambda t : list(map(t, input().split()))
k,x = words(int)

ans = []
for i in range(max(-2000000, x-k+1), min(2000001, x+k)):
    ans.append(str(i))

print(" ".join(ans))

Submission status: Accepted

Solution code:
k, x = list(map(int, input().split()))
print(*list(range(x-(k-1), x+k)))

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    K, X = map(int, input().split())
    ans = []
    start = X - K + 1
    end = X + K
    for i in range(start, end):
        ans.append(i)

    return ' '.join(map(str, ans))


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

Submission status: Accepted

Solution code:
k, x = map(int, input().split())
ans = ""
for i in range(x-k+1, x+k):
  ans += str(i)+" "
print(ans[:-1])

Submission status: Accepted

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

Submission status: Accepted

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

min_num = x - k + 1
max_num = x + k
array = []

for i in range(min_num, max_num):
    array.append(i)

print(*array, sep=' ')

Submission status: Accepted

Solution code:
k,x=map(int,input().split())
for i in range(x-k+1,x+k):
  print(i,end="")
  if i!=x+k-1:
    print(" ",end="")
print()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K,X = list(map(lambda x: int(x),input().split()))
l = max(-10**6,X-K+1)
r = min(10**6,X+K-1)
lst = [str(i) for i in range(l,r+1)]
print(" ".join(lst))

Submission status: Accepted

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

ans = []
for i in range(1,k*2):
    ans.append(x-k+i)

print(' '.join(map(str,ans)))

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

K, X = MAP()

ans = []
for i in range(X-K+1, X+K):
    ans.append(i)
print(*ans)

Submission status: Accepted

Solution code:
k, x = map(int, input().split())
for i in range(x-k+1,x+k):
    print(i)

Submission status: Accepted

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

for i in range(X-K+1, X+K-1):
	print(i, end=' ')
print(X+K-1)

Submission status: Accepted

Solution code:

K,X = map(int,input().split())

start = max(-10**6,X-K+1)
end = min(10**6,X+K-1)
ans = [i for i in range(start,end+1)]
print(' '.join(map(str,ans)))

Submission status: Accepted

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

p = X - K + 1
q = X + K - 1

for i in range(p, q+1):
    print(i, end=" ")

Submission status: Accepted

Solution code:
def int_multiple():
    return  [int(c) for c in input().split()]

def int_single():
    return int(input())

def str_multiple():
    return [c for c in input().split()]

def str_single():
    return input()

# start

k, x = int_multiple()

s = ""

for i in range(x-(k-1), x+k):
    s += str(i) + " "

print(s[:-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K,X = (int(i) for i in input().split())

for i in range(X-K+1,X+K):
    print(i,end = " ")

Submission status: Accepted

Solution code:
k, x = map(int, input().split())
l = max(-1000000, x - k + 1)
r = min(1000000, x + k - 1)
for i in range(l, r + 1):
  print(i)

Submission status: Accepted

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

ans = []
for i in range(x-k+1, x+k):
  ans.append(str(i))
print(" ".join(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

x_min = max(X - K + 1, -1000000)
x_max = min(X + K - 1, 100000)

L = map(str, list(range(x_min, x_max + 1)))
print(' '.join(L))

Submission status: Accepted

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

for i in range(-k+1,k,1):
    if i != k-1:
        print(x+i,end=' ')
    else:
        print(x+i)

Submission status: Accepted

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

K, X = [int(item) for item in input().split()]
out = [str(item) for item in list(
    range(max(X - K + 1, -1000000), min(X + K - 1, 1000000) + 1))]
print(" ".join(out))

Submission status: Accepted

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

print(" ".join([str(_) for _ in range(max(-1000000,x-k+1),min(1000001,x+k))]))

Submission status: Accepted

Solution code:
K,X=map(int,input().split())
saidai=min(1000000,X+K-1)
sais=max(-1*1000000,X-K+1)
kouho=range(sais,saidai+1)
for i in kouho:
  print(i)

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    k, x = map(int, input().split())

    left = max(-1000000, x - (k-1))
    right = min(1000000, x + (k-1))

    ans = [i for i in range(left, right+1)]

    print(*ans)

Submission status: Accepted

Solution code:
K,X= list(map(int, input().split()))
a=list(range(X-K+1,X+K))
for i in a:
    print(i,end=" ")

Submission status: Accepted

Solution code:
k, x = map(int,input().split())
l = []
for i in range(2*k-1):
    l.append(x-k+i+1)
print(' '.join(map(str, l)))

Submission status: Accepted

Solution code:
k,x=map(int,input().split())
if x-k<-1000000:
	a=-1000000
else:
	a=x-k+1
if x+k>1000000:
	b=1000000
else:
	b=x+k-1
aa=[]
for i in range(a,b+1):
	aa.append(i)
print(*aa)

Submission status: Accepted

Solution code:
k,x = map(int,input().split())
print(' '.join(list(map(str,list(range(x-k+1,x+k))))))

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  K, X = readInts()
  left = X - K + 1
  right = X + K - 1
  ans = " ".join([str(x) for x in range(left, right + 1)])
  print(ans)

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

k, x = map(int, input().split())

print(*range(x - k + 1, x + k), sep=" ")