DMOPC '14 Contest 3 P1 - Not Enough Users!

View as PDF

Submit solution

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

Problem type

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.


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


Sample Output


Explanation for Sample Output

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


  • -17
    Xennpai  commented on Nov. 6, 2015, 5:28 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.