P30053 [洛谷] 「ACOI2020」Speed of Sound
普及
题目描述

Background

T1

Teacher Tadaomi Karasuma from the Defense Ministry has arrived at Kunugigaoka Middle School to assign a significant task to the students of Class 3-E: to assassinate a super-biological entity (nicknamed "Koro-sensei" by Kaede Kayano) within a year. The students begin their rigorous training. However, Koro-sensei quickly demonstrates its ability to fly at an ultra-high speed of 20 Mach, making it impossible for the students to touch it. Therefore, they plan to purchase a teleportation device from Karasuma.

Problem Description

The students are now lying in ambush in the back mountain. They are familiar with the back mountain, which is spacious enough to be considered an infinite plane in a Cartesian coordinate system, with the students positioned at the origin \((0,0)\). Koro-sensei is currently at the position \((x,y)\), engrossed in reading a risqué book placed by Daigaku Okajima. The students can draw a circle with radius \(r\) centered at their position and throw the teleportation device to a point \(S\) on the circle. The device will then create a tangent line \(PQ\) to the circle at the point of landing.

The function of the teleportation device is to transport the students to the point symmetric to their current position with respect to the line \(PQ\). They must then move to Koro-sensei's position to attack it. After reviewing their plan, Karasuma has two questions for the students:

  • What is the minimum distance they need to move after using the teleportation device?
  • Under the condition that the movement distance is minimized, what is the tangent value of the angle between \(PQ\) and the x-axis? We consider the angle to be within \([0, 180]\) degrees.

Input Format

The first line contains two real numbers \(x, y\), representing the position of Koro-sensei and the risqué book, with insignificant zeros automatically removed.
The second line contains a real number \(r\), as described in the problem statement.

Output Format

The first line should output the minimum distance they need to move after using the teleportation device, rounded to six decimal places.
The second line should output the tangent value of the angle between \(PQ\) and the x-axis under the condition of minimizing the movement distance, rounded to two decimal places.

Specifically, if the tangent value is undefined, output Error; otherwise, if multiple angles satisfy the condition, output the smallest tangent value, treating Error as infinity.

Note that if the tangent value is negative, treat it as infinity. The angle refers to the acute angle.

Sample Input and Output

Sample Input #1

11 0
5

Sample Output #1

1.000000
Error

Sample Input #2

6 8
4

Sample Output #2

2.000000
0.75

Notes

Data Range

This problem uses batched testing.

  • Subtask 1 (10 points): \(x, y, r\) satisfy \(x^2 + y^2 = r^2\).
  • Subtask 2 (20 points): At least one of \(x, y\) is zero.
  • Subtask 3 (70 points): No special restrictions on the data.

For 100% of the data, \(0 \leq |x|, |y|, r \leq 10^{10}\).

Hints

  1. This problem includes a Special Judge (SPJ). If the answer to the first question is within an absolute difference of \(10^{-6}\) from the standard answer, you will receive 50% of the points for that test case. When the answer to the first question is correct:
    - If the answer to the second question is not Error, you will receive all the points for that test case if the output is within an absolute difference of \(10^{-2}\) from the standard answer.
    - If the answer to the second question is Error, you will only receive all the points for that test case if you output Error.
    Due to SPJ sensitivity, if you can only answer the first question, please also output some value on the second line, not Error.

  2. The tangent value represents the ratio of the opposite side to the adjacent side in a right triangle, such as \(\tan 45^\circ = 1\). Specifically, the tangent value for \(90^\circ\) is undefined.

  3. A line that intersects a circle at only one point is called a tangent to the circle, and the radius connecting the point of tangency to the center is perpendicular to the tangent line.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
11 0 5
样例输出
1.000000 Error