Geometric progression
Geometric progression is defined as a sequence of , where each next element is obtained by multiplying the previous one with a number q.
For example 100, 200, 400, 800, 1600, ... is a geometric progression, where b1 = 100 and q = 2.
So, to obtain the n-th number in the sequence when having the first element and the number q, one can use the formula:
Given the first number in the sequence , the number q, and the number n, print the n-th element of the sequence .
Input | Output |
|---|---|
95 | 285 |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB