Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Find the Circle

By flash_7 · Limits 3s, 512 MB

You’ll be given two circles A and B of the same radius. You need to draw another circle C such that, C contains both circles A and B completely inside it and the radius of the circle C is minimized. To be specific, after you draw the circle C, there won’t exist any region of circle A or B which lie outside the circle C.

Input

The first line contains an integer T, the number of test cases. Each of the next T lines contains 5 integers X1, Y1, X2, Y2 and R. Here (X1, Y1) is the center of circle A, (X2, Y2) is the center of circle B and R is the radius of both A and B.

Constraints:

1 ≤ T ≤ 50
1 ≤ X1, Y1, X2, Y2, R ≤ 10000

Output

For each test cases, print three decimal numbers X3, Y3 and R3 rounded to two decimal places. Here (X3, Y3) is the center and R3 is the radius of the large circle C.

Sample

InputOutput
1
1 1 9 1 2
5.00 1.00 6.00

Explanation:

In the first sample test case, the center of the circle C is (5.00, 1.00) and the radius is 6.00.

    Discussion

    Statistics


    84% Solution Ratio

    showmic96Earliest, Jul '18

    lliimmFastest, 0.0s

    Atiya_143Lightest, 0 B

    Hafiz031Shortest, 288B

    Submit

    Login to submit

    Related Contests

    Intra NSU Programming Contest Summer 2018 Ended at 2018-07-20 07:15:00 +0000 UTC
    Replay of Intra NSU Programming Contest Summer 2018 Ended at 2018-07-27 17:00:00 +0000 UTC