#P14119. [SCCPC 2021] Triangle Pendant

    ID: 15887 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 显示难度NOI/NOI+/CTS 上传者: 标签>四川2021Special JudgeXCPC

[SCCPC 2021] Triangle Pendant

Problem Description

Given a point DD at height zero and a triangle ABC\triangle ABC with uniform mass, we use three ropes with length xx, yy, and zz to connect ADAD, BDBD, and CDCD 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 AA, BB, and CC.

Input Format

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

The first and only line contains six integers xx, yy, zz, aa, bb and cc (1x,y,z,a,b,c10001 \le x, y, z, a, b, c \le 1000, a+b>ca + b > c, a+c>ba + c > b, b+c>ab + c > a) indicating the length of three ropes and the length of BCBC, ACAC and ABAB.

You can assume that the solution always exists.

Output Format

For each test case output one line containing threes real numbers indicating the height of points AA, BB and CC.

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

2
1 1 1 1 1 1
2 3 3 1 1 1
-0.816496580927726 -0.816496580927726 -0.816496580927726
-2.000000000000000 -2.866025403784439 -2.866025403784439