#C254. Geometric Progression Generator
Geometric Progression Generator
Geometric Progression Generator
Given three integers representing the first term, the common ratio, and the number of terms, generate the first n terms of a geometric progression. The progression is defined by the formula: [ a_i = a \times r^{i} ] for (i = 0, 1, \dots, n-1), where (a) is the first term and (r) is the common ratio. If the number of terms is not a positive integer, output the error message: "Length must be a positive integer."
inputFormat
The input is read from standard input and consists of a single line containing three space-separated integers: the first term (a), the common ratio (r), and the number of terms (n). It is guaranteed that when valid, n is a positive integer.
outputFormat
Output the generated geometric progression as a list of space-separated integers on a single line. In case n is not a positive integer, output the error message exactly as follows: "Length must be a positive integer."## sample
2 3 5
2 6 18 54 162
</p>