408769: GYM103306 D Dislike the Raisins

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Dislike the Raisinstime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

There is a brand new cereal that Jaime really enjoys, but, as every good thing, this cereal has an issue, it is mixed with the only ingredient Jaime dislikes: raisins. A few days ago Jaime tried to remove all the raisins from a box of cereal and he found it was practically impossible to him. Jaime will eat the box of cereal using a spoon that can handle up to $$$S$$$ units of cereal, he eats the box of cereal always filling the spoon until no more cereal is left in the box, in case the box is not empty and he can not fill the spoon, he will put in the spoon all the cereal left in the box. Jaime considers his spoon of cereal is an outstanding spoon if it does not contain raisins.

Jaime just noticed that the box contains information about the amount of cereal $$$C$$$ and the amount of raisins $$$R$$$ that are inside of the box, knowing this information, Jaime wants to find, if he was lucky enough, what is the maximum number of outstanding spoons he could have while eating the box? Similarly, it he was that unlucky, what is the minimum number of outstanding spoons he could have?

Input

The first line of input contains a single integer $$$T$$$ ($$$1 \leq T \leq 1000$$$), the number of test cases in the input. Each of the next $$$T$$$ lines contains three integer numbers separated by a space, $$$C$$$, $$$R$$$, and $$$S$$$, ($$$0 \leq C, R \leq 10^9$$$, $$$1 \leq S \leq 10^9$$$), representing, respectively, the amount of cereal, and raisins in the box, and the units the spoon can hold. You can assume the size of a cereal and a raisin is the same, so any of them takes just one unit of the spoon.

Output

For each test case in the input output a line containing two integer numbers separated by a space, the maximum and minimum number of outstanding spoons Jaime can take from the box.

ExampleInput
3
20 10 5
20 11 5
6 2 3
Output
4 0
4 0
2 1

加入题单

算法标签: