F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

A Very Simple Problem

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1403    Accepted Submission(s): 692


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.
 

Sample Input
100 1 10000 3 4 1000 -1 -1 -1
 

Sample Output
5050 444
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 10:40:54, Gzip enabled