Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-arifmetik-progressiya

Terms of an arithmetic progression

Easy 1000 ms 128 MB 25%
Share

A positive integer $n$ ($n \ge 2$), the first term $A$ and the common difference $D$ are given. Build and print the array of the first $n$ terms of the arithmetic progression:

$$A, \quad A + D, \quad A + 2 * D, \quad \dots$$

An array of the terms of an arithmetic progression

Input

One line with three integers: $n$, $A$ and $D$.

Output

One line with $n$ integers separated by spaces.

Note

$2 \le n \le 1000$
$-1000 \le A, D \le 1000$

Examples

Input #1
5 3 4
Output #1
3 7 11 15 19
Input #2
4 10 -2
Output #2
10 8 6 4

Sign in to submit a solution

Signing up is free and takes a minute.