A Very Simple Problem

Time Limit: 2000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 3483
64-bit integer IO format: %I64d      Java class name: Main

Description

This is a very simple problem. Given three integers N, x, and M, your task is to calculate out the following value:


Input

There are several test cases. For each case, there is a line with three integers N, x, and M, where 1 ≤ N, M ≤ 2*109, and 1 ≤ x ≤ 50.
The input ends up with three negative numbers, which should not be processed as a case.

Output

For each test case, print a line with an integer indicating the result.

Sample Input

100 1 10000
3 4 1000
-1 -1 -1

Sample Output

5050
444

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .