#603. 「Nowcoder多校 2019 Day5」three points 1
「Nowcoder多校 2019 Day5」three points 1
当前没有测试数据。
题目描述
You are given five positive integers w, h, a, b, c. Please construct 3 points X, Y, Z in the 2-dimensional plane such that the distance between X and Y is a, the distance between X and Z is b, the distance between Y and Z is c. Furthermore, the x coordinates of all constructed points must be in the range [0, w], and the y coordinates of all constructed points must be in the range [0,h].
The value of the constructed coordinates X, Y, Z can be real numbers. The input guarantees that at least one solution exists.
输入格式
The first line contains an integer T indicating there are T tests. Each test consists of a single line containing five integers: w, h, a, b, c.
输出格式
For each test, output one line containing six numbers, the first two numbers are the coordinate of X, the third and fourth numbers are the coordinate of Y, the last two numbers are the coordinate of Z. If there are multiple solutions, please output any one.
All absolute error within will be ignored.
样例
样例输入 1
3
24 16 20 25 15
1 1 1 1 1
50 50 1 2 3
样例输出 1
0.000000000000 0.000000000000 12.000000000000 16.000000000000 24.000000000000 7.000000000000
0.000000000000 0.000000000000 0.500000000000 0.866025403784 1.000000000000 0.000000000000
1.000000000000 0.000000000000 0.000000000000 0.000000000000 3.000000000000 0.000000000000
样例解释 1
For the last test, the distance between (1, 0) and (0, 0) is 1, the distance between (1, 0) and (3, 0) is 2, and the distance between (0, 0) and (3, 0) is 3.