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

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

Terms of a geometric progression

Easy 1000 ms 128 MB 26%
Share

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

$$A, \quad A * R, \quad A * R^{2}, \quad \dots$$

An array of the terms of a geometric progression

Input

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

Output

One line with $n$ integers separated by spaces.

Note

$2 \le n \le 20$
$1 \le A \le 20$
$2 \le R \le 5$

Examples

Input #1
4 3 2
Output #1
3 6 12 24
Input #2
3 5 3
Output #2
5 15 45

Sign in to submit a solution

Signing up is free and takes a minute.