DMOPC '14 Contest 3 P1 - Not Enough Users!

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Amagi Brilliant Contests runs a business making and hosting contests on its online platform for competitive programmers who want to run their own contests.

Recently, ABC has been in a slump. There are simply not enough active users on the site each day. The management has decided to run more contests to attract more users.

On day 0, there are N users. Each day starting from day 1, ABC will host a new contest and the number of users ABC will have will be K times that of the previous day (the contests are really high quality because the problem writers are brilliant).

You are the head of public relations in Amagi Brilliant Contests, and so you have been tasked with determining the number of users ABC will have on day D.

Constraints

1 \le N, K, D \le 8

Input Specification

The first line of input will have N. The second line of input will have K. The third line of input will have D.

Output Specification

The first and only line of output should contain the number of users ABC will have on day D.

Sample Input

1
3
2

Sample Output

9

Explanation for Sample Input

On day 0, ABC has 1 user. On day 1, ABC has 3 users. On day 2, ABC has 9 users.


Comments


  • -1
    reda2002  commented on Dec. 24, 2017, 9:42 a.m.

    the last case pllz


  • -3
    Xennpai  commented on Nov. 6, 2015, 12:28 p.m.

    god bless these anime references