#CCBCHBA0000003. Dãy cách đều bước k (Arithmetic Progression)
Dãy cách đều bước k (Arithmetic Progression)
Arithmetic Progression
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given initial value a, common difference d, and count n, print exactly n values of the progression. The difference may be negative or zero. For n=0 print a blank line.
Input
Three integers a d n.
Output
Exactly n integers separated by single spaces on one line.
Subtasks
- Subtask 1 (20%): , .
- Subtask 2 (30%): , .
- Subtask 3 (50%): , .
Examples
Example 1
Input
2 3 4
Output
2 5 8 11
Explanation
For indices 0 to 3, a+t*d is 2,5,8,11.
Example 2
Input
3 -2 3
Output
3 1 -1
Explanation
A negative difference makes the three-element progression decrease.