The Skatepark's New Ramps

No attempts yetTime limit1sMemory limit128 MB

Problem

The local skating park has received funding from the city to make the park fun for skaters of every level. The committee wants to spend the entire budget on a series of ramps that together look a bit like a mountain range.

They have already decided how many ramps to build, and for each ramp they have agreed on a range of allowed heights. What they cannot agree on is exactly how tall each ramp should be. They cannot afford to build every ramp at its maximum height, but they insist on spending all of the budget. The remaining argument is about the ramps' heights: some members want the ramps to be as similar as possible for a smooth, consistent ride, while others want them to differ as much as possible for a more varied set of challenges.

To help them, you decide to show both extremes: the configuration in which the difference between the tallest and the shortest ramp is as small as possible, and the one in which that difference is as large as possible. To start the discussion you will report the minimum and the maximum possible difference between the tallest and the shortest ramp. The park has plenty of space, so you do not need to worry about where the ramps are placed. Every ramp has the same slope: a ramp of height $h$ has length $4h$ (measured flat, not along the slope).

Input

The first line contains an integer $n$, the number of test cases.

For each test case:

  • A line with an integer $r$ ($2 \le r \le 10000$), the number of ramps the park will build.
  • A line with an integer $m$ ($0 \le m \le 200000000$), the number of cubic meters of concrete the park can afford.
  • $r$ lines, each with two numbers $l$ and $t$ ($0.00 \le l \le t \le 100.00$) separated by a single space: the minimum and maximum allowed height (in meters) of that ramp.

Every ramp is made entirely of concrete and shaped as a prism $1$ meter wide whose base is an isosceles triangle (a triangle with two equal sides). A configuration that stays within the given height ranges and uses all of the concrete is guaranteed to exist.

Output

For each test case, print one line with two numbers separated by a single space: the minimum possible difference and the maximum possible difference between the tallest and the shortest ramp, each rounded to two decimals.

Hint