408420: GYM103117 C Triangle Pendant

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

Description

C. Triangle Pendanttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Given a point $$$D$$$ at height zero and a triangle $$$\triangle ABC$$$ with uniform mass, we use three ropes with length $$$x$$$, $$$y$$$, and $$$z$$$ to connect $$$AD$$$, $$$BD$$$, and $$$CD$$$ respectively. The mass of the ropes can be ignored. Let the triangle fall naturally and stabilize at the lowest position of the center of gravity. Find the final heights of points $$$A$$$, $$$B$$$, and $$$C$$$.

Input

There are multiple test cases. The first line of the input contains an integer $$$T$$$ (about $$$10^4$$$) indicating the number of test cases. For each test case:

The first and only line contains six integers $$$x$$$, $$$y$$$, $$$z$$$, $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le x, y, z, a, b, c \le 1000$$$, $$$a + b > c$$$, $$$a + c > b$$$, $$$b + c > a$$$) indicating the length of three ropes and the length of $$$BC$$$, $$$AC$$$ and $$$AB$$$.

You can assume that the solution always exists.

Output

For each test case output one line containing threes real numbers indicating the height of points $$$A$$$, $$$B$$$ and $$$C$$$.

Your answer will be considered correct if and only if the absolute or relative error does not exceed $$$10^{-4}$$$.

ExampleInput
2
1 1 1 1 1 1
2 3 3 1 1 1
Output
-0.816496580927726 -0.816496580927726 -0.816496580927726
-2.000000000000000 -2.866025403784439 -2.866025403784439

加入题单

上一题 下一题 算法标签: