Problem H. A Very Simple Problem

时间限制 2000 ms   内存限制 32 MB

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


 

输入数据

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

输出数据

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

样例输入

复制
100 1 10000
3 4 1000
-1 -1 -1

样例输出

复制
5050
444

提交

请先 登录

© 2025 FAQs Contact About