Under construction

Still being built. Things may change

Heart Rate

Time limit2sMemory limit512 MB

Summary
Given a beat count b over p seconds, find the lower and upper bounds on the constant-interval heart rate that could produce it, plus the estimate 60b/p.
Level

Medium4 of 10

Topics
Math, Implementation, Binary search, Brute force
Solved
No attempts yet

Problem

A common way to check your own heart rate is to put your index and middle finger on your neck next to the windpipe, count the beats you feel over 15 seconds, and multiply that count by four. The beats per minute (BPM) you get this way is only an estimate. In general, if you count bb beats in pp seconds, the BPM is 60b/p60b/p.

In this problem the heart always beats at a constant interval. If tt is the time in seconds between one beat and the next, the Actual Beats Per Minute (ABPM) is defined as 60/t60/t.

A measurement takes a window of exactly pp seconds and counts the beats that fall inside it. Even when the count is bb, more than one value of tt produces that count, so the ABPM is not determined. The ABPM values consistent with counting bb beats in pp seconds form an interval.

Input

The first line contains the number of test cases NN (1≤N≤10001 \le N \le 1000).

Each of the next NN lines describes one test case. A line contains the counted number of beats bb (2≤b≤10002 \le b \le 1000) and the measuring time pp (0<p<10000 < p < 1000), separated by a space. The value pp is a real number written with 4 digits after the decimal point.

Output

For each test case, print on a single line the lower endpoint of the interval of possible ABPM values, the calculated BPM 60b/p60b/p, and the upper endpoint of that interval, separated by single spaces.

Print all three values rounded to 4 digits after the decimal point, padded with zeros so that exactly 4 digits follow the decimal point.

Examples3

  1. Example 1

    Input
    2
    6 5.0000
    2 3.1222
    
    Expected output
    60.0000 72.0000 84.0000
    19.2172 38.4344 57.6517
    
  2. Example 2

    Input
    3
    2 1.0000
    2 2.0000
    2 0.5000
    
    Expected output
    60.0000 120.0000 180.0000
    30.0000 60.0000 90.0000
    120.0000 240.0000 360.0000
    
  3. Example 3

    Input
    1
    7 4.5000
    
    Expected output
    80.0000 93.3333 106.6667