#P3483. A Very Simple Problem

    ID: 2367 远端评测题 2000ms 32MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>2010 ACM-ICPC Multi-University Training Contest(5)——Host by BJTU

A Very Simple Problem

Problem 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.

100 1 10000 3 4 1000 -1 -1 -1
5050 444