OpenJudge

C17C:Skating on Weiming Lake

总时间限制:
1000ms
内存限制:
65536kB
描述

Peking University, is a major Chinese research university located in Beijing and a member of the C9 League. It is the first modern national university established in China, founded as the Imperial University of Peking in 1898 as a replacement of the ancient Taixue or Guozijian, or Imperial Academy. It also served as the highest administration for education (ministry of education) in China at the beginning of its founding. By 1920, it had become a center for progressive thought. Peking University is consistently ranked as the top higher learning institution in mainland China. In addition to academics, Peking University is especially renowned for its campus grounds, and the beauty of its traditional Chinese architecture.

Peking University has many famous attractions. Weiming Lake is one of the most beautiful spectacles which is in the north of the campus and is surrounded by walking paths and small gardens. In winter when the lake freezes, students prefer to skate on the lake with their partners than do their homework in the dormitory.

Now the manager wants to set up a skating rink on Weiming Lake. Weiming Lake is a circle with the radius R and the center (cx,cy). The skating rink is also a circle inside the lake. There are two stelae in the lake, which should be outside or on the boundary of the skating rink. The stelae are two points with coordinates (x1,y1) and (x2,y2). The manager wants to maximize the area of the skating rink. Please help him decide the radius as well as the center of the rink.

Note that your output would be accepted if and only if:

1. The relative error Δ = |(r-rs)/rs| <= 0.0001 where r is the radius in your output and rs is the radius in the standard answer;

2. Your skating rink should be inside the lake and the stelae should be outside or on the boundary of it. Absolute errors within 0.0001 are allowed.


输入
The first line contains an integer T (1 <= T <= 50), indicating the number of test cases.

For each test case:

The first line contains two integers cx and cy, indicating the coordinates of Weiming Lake;

The second line contains a single integer R (2 <= R <= 1,000,000,000), indicating the radius of the lake;

The third line contains two integers x1 and y1, indicating the coordinates of the first stele;

The fourth line contains two integers x2 and y2, indicating the coordinates of the second stele.

The absolute value of each coordinate is less than 1,000,000,000.
输出
For each test case, output two lines:

The first line contains one real number r, indicating the radius of the skating rink;

The second line contains two real numbers separated by a single space, indicating the coordinates of the center of the skating rink.
样例输入
1
0 0
5
1 1
2 3
样例输出
3.20709678
-1.26776695 -1.26776694
全局题号
15048
添加于
2017-05-21
提交次数
231
尝试人数
22
通过人数
9