ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

Ural Regional School Programming Contest 2012

About     Problems     Submit solution     Judge status     Standings
Contest is over

I. Another Ecology Problem

Time limit: 1.0 second
Memory limit: 64 MB
The world is in danger! People really worry about climate change. Two largest research centres — Warmtown's and Freezetown's, have been doing active researches in this field for many years. In Warmtown's centre scientists believe that the global warming is threateing the Earth. In Freezetown's center they believe that another Ice Age is expected on our planet.
Such researches require enormous amounts of money, that is why Freezetown's and Warmtown's centres always apply for state grants. There is n billions zollars in the State budget, the size of the requested grant varies from 1 to k billions. The Government realizes significance of the problem and fully pays all requested grants. If one of the research centres will get two grants in a row, the other will find it unfair and will give up researches. But then it can be a big danger for Earth. So, it is possible to apply for grants one by one only. If there is no money in the budget then applications are not accepted any more. If there is not enough money in the budget to pay currently requested grant then the Minister of Education and Science resigns in disgrace but first he gives all his m billions fortune to the centre which applied for that grant (money from budget is not taken in this case) and then grants are not given any more.
Warmtown's and Freezetown's centres are swore enemies that is why each center is trying to get more money and to minimize the total amount of grants of the contender. The director of Warmtown's centre applied for grant first. How much money will Warmtown's and Freezetown's centres get till payment stops? The budget is not used for paying other purposes in this period of time.

Input

The only line contains integers n, m and k (0 ≤ n ≤ 10 000; 0 ≤ m ≤ 1000; 1 ≤ k ≤ 100).

Output

Output total amounts of money that Warmtown's and Freezetown's centres got from Ministry respectively.

Sample

inputoutput
12 30 10
31 10
Problem Author: folklore, prepared by Maria Zyryanova
Problem Source: Ural Regional School Programming Contest 2012
To submit the solution for this problem go to the Problem set: 1928. Another Ecology Problem