"""
10 5 0 -5 0 5 10 
print the above series 
when n=10 k=5
"""

n=int(input())
k=int(input())
x=n
print(x,end=" ")
while(x>=0):
    x=x-k
    print(x,end=" ")
while(x!=n):
    x=x+k
    print(x,end=" ")
    

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: