#CCBCHBA0000004. Đếm lùi theo bước (Countdown by Step)
Đếm lùi theo bước (Countdown by Step)
Countdown by Step
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given nonnegative n and positive step k, print n,n-k,n-2k,... while each printed term is nonnegative. The initial term n is always printed.
Input
Two integers n k.
Output
One line of numbers separated by single spaces.
Subtasks
- Subtask 1 (20%): , .
- Subtask 2 (30%): , .
- Subtask 3 (50%): , .
Examples
Example 1
Input
7 3
Output
7 4 1
Explanation
The next term after 1 is -2, so it is not printed.
Example 2
Input
0 4
Output
0
Explanation
The initial zero is printed exactly once.