Олимпиадный тренинг

Задача 38378. Chunga-Changa


Our happiness is constant — Chew coconuts, eat bananas, Chew coconuts, eat bananas, Chunga-changa!
m/f «Katerok»
After the discovery of the island "Chunga-Changa" civilization gradually began to make its way there and even a market economy began to develop. There is also a new currency — chizhik. Now, in order to happily chew coconuts, you must first buy them under a palm tree.

Sasha and Masha passed by a palm tree, under which coconuts are sold at the price of z chizhiks apiece. Sasha has x siskins, and Masha has y. Each of the girls is going to buy the maximum number of coconuts she has enough money to buy. While discussing their plans to buy coconuts, the girls noticed that if one of them gave a certain number of siskins to another, then the total number of coconuts they would buy could increase (or decrease) because of this. Coconuts are not sold in parts, that is, each of the girls can only buy a non-negative integer number of coconuts. Chizhiks also cannot be divided into parts, that is, one of the girls can only send a non-negative integer number of chizhiks to the other.

For example, suppose that Sasha had 5 chizhiks, Masha 4, and one coconut costs 3 siskins. Then, if the girls do not exchange siskins, they will buy 1+1=2 coconuts. If Masha gives Sasha one chizhik, then Sasha will have 6 of them, and Masha will have 3, and the girls will buy 2+1=3 coconuts.

Life on the island is no longer so easy and simple, so Sasha and Masha want to distribute the money so that in total they can buy as many coconuts as possible. At the same time, no one likes to lend chizhiks, so among all the ways that lead to the maximum number of purchased coconuts, find the one that minimizes the number of chizhiks transferred between Sasha and Masha (no matter in which direction).

Input
The first line contains three integers x, y and z (0 ≤ x, y ≤ 1018 , 1 ≤ z ≤ 1018) — the number of chizhiks Sasha has, the number of chizhiks Masha has and the price of one coconut.

Imprint
Print two integers — the maximum total number of coconuts that can be bought, and the minimum number of siskins that one of the girls will have to share for this.
Note
The first example is analyzed in the problem statement. In the second example, it is optimal not to exchange siskins, in this case 3+4=7 coconuts will be bought.
Examples
# Input Output
1 5 4 3 3 1
2 6 8 2 7 0