QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 256 MB Total points: 100

#6763. 三角形吊坠

Statistics

给定一个高度为零的点 $D$ 和一个质量均匀的三角形 $\triangle ABC$,我们使用三根长度分别为 $x, y, z$ 的绳子分别连接 $AD, BD$ 和 $CD$。绳子的质量可以忽略不计。让三角形自然下落并稳定在重心最低的位置。求点 $A, B$ 和 $C$ 的最终高度。

输入格式

输入包含多组测试数据。第一行包含一个整数 $T$(约 $10^4$),表示测试数据的组数。对于每组测试数据:

第一行包含六个整数 $x, y, z, a, b$ 和 $c$($1 \le x, y, z, a, b, c \le 1000, a + b > c, a + c > b, b + c > a$),分别表示三根绳子的长度以及 $BC, AC$ 和 $AB$ 的边长。

你可以假设解总是存在的。

输出格式

对于每组测试数据,输出一行,包含三个实数,分别表示点 $A, B$ 和 $C$ 的高度。

如果你的答案的绝对误差或相对误差不超过 $10^{-4}$,则被视为正确。

样例

输入格式 1

2
1 1 1 1 1 1
2 3 3 1 1 1

输出格式 1

-0.816496580927726 -0.816496580927726 -0.816496580927726
-2.000000000000000 -2.866025403784439 -2.866025403784439

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.