#P6039. 「ACOI2020」音速
「ACOI2020」音速
Description
Now the students are ambushing in the back mountain. They are very familiar with the terrain, and the back mountain is wide enough to be regarded as an infinite 2D Cartesian coordinate plane. The students are at . At this moment, Koro-sensei is at , seriously reading a “little yellow book” left by Taiga Okajima. The students can draw a circle centered at themselves with radius , then throw the teleporter so that it lands at a point on the circle. At the landing point, the teleporter can create a line tangent to that circle. Now this line is the teleporter.
The teleporter works as follows: it teleports the students to the point symmetric to where they stand with respect to . Also, they must move after teleporting to reach Koro-sensei’s position to attack him. After seeing their plan, Karasuma was very impressed, but he has two questions for the students:
-
After using the teleporter, what is the minimum distance they need to move?
-
Under the plan that guarantees the minimum movement distance, what is the value of of the angle between and the -axis? We consider the angle to be in .
Input Format
The first line contains two real numbers , indicating the positions of Koro-sensei and the little yellow book, with meaningless trailing automatically removed.
The second line contains one real number , with the meaning described above.
Output Format
On the first line, output the minimum distance they need to move after using the teleporter, rounded to 6 decimal places.
On the second line, under the plan that guarantees the minimum movement distance, output the value of of the angle between and the -axis, rounded to 2 decimal places.
In particular, when the value is undefined, output Error. Otherwise, if multiple angles can satisfy the condition, output the smallest value. You may treat Error as .
Note: when is negative, treat this value as . The angle refers to the acute angle.
11 0
5
1.000000
Error
6 8
4
2.000000
0.75
Hint
Constraints
This problem uses bundled testdata.
- Subtask 1 (10 points): satisfy .
- Subtask 2 (20 points): at least one of is .
- Subtask 3 (70 points): no special constraints on the data.
For of the data, .
Hint
- This problem includes an SPJ. If the absolute difference between the answer to the first question and the standard answer is at most , you can get of the score for that test point. When the answer to the first question is correct:
- If the answer to the second question is not
Error, you can get full score for that test point when the absolute difference between your output and the standard answer is at most . - If the answer to the second question is
Error, only outputtingErrorcan get full score for that test point.
Because the SPJ is sensitive, if you can only answer the first question, please output any value on the second line, and do not outputError.
-
The value means: in a right triangle, the ratio of the length of the leg opposite an angle to the length of the leg adjacent to it. For example, . In particular, at is undefined.
-
A line that has exactly one common intersection point with a circle is called a tangent line of the circle. The radius connecting the tangency point and the circle center is perpendicular to the tangent line.
Translated by ChatGPT 5
京公网安备 11011102002149号