P23650 [AtCoder] Reflection of Light
提高-
题目描述

Problem Description

In a 2-dimensional plane, there is a circular room centered at the origin $(0, 0)$ with a radius of 1. Inside this room, a circular pillar is erected centered at the point $(X, Y)$ with a radius of $R$.

DISCO-kun has placed a light source at a point $(S_X, S_Y)$ inside the room but outside the pillar. From this point, light travels in a straight line in all directions. The light is absorbed without reflection when it hits the outer wall of the room or the pillar.

He wonders what proportion of the outer wall of the room can be illuminated using a certain number of mirrors. For each $t = 0, 1, 2, ..., K$, answer the following question:

  • Using mirrors, the direction of the light can be freely changed up to $t$ times. Determine the proportion of the outer wall of the room that can be illuminated. (That is, find the length $l$ of the portion of the outer wall that can be illuminated and then compute $l / 2\pi$.)

Input Format

The input is given from the standard input in the following format:

$X$ $Y$ $R$ $S_X$ $S_Y$ $K$

Output Format

Output $K + 1$ lines. On the $i$-th line ($1 \leq i \leq K + 1$), output the answer to the question for $t = i - 1$. For all questions, the answer is considered correct if the absolute error from the judge's output is within $10^{-4}$.

Sample Input and Output

Sample Input #1

0.0 0.0 0.6
0.0 0.7
2

Sample Output #1

0.467404563822388
1
1

Sample Input #2

0.3 0.3 0.4
0.9 0.0
1

Sample Output #2

0.623158068351223
1

Sample Input #3

0.00 0.00 0.90
0.65 0.65
3

Sample Output #3

0.208804270061789
0.495936856319201
0.783069442576613
1

Sample Input #4

-0.2018 -0.1190 0.6858
-0.5000 -0.7777
3

Sample Output #4

0.266193331431572
0.767297626518897
1
1

Notes/Hints

Constraints

  • $ |X|, |Y|, |S_X|, |S_Y| < 1 $
  • $0.01 \leq R < 1$
  • $1 \leq K \leq 10$
  • The pillar is inside the room, and the distance from the pillar to the outer wall of the room is at least $0.05$.
  • The light source is inside the room, and the distance from the light source to the outer wall of the room is at least $0.01$.
  • The light source is outside the pillar, and the distance from the light source to the pillar is at least $0.01$.
  • The values of $X, Y, R, S_X, S_Y$ are given up to 7 decimal places.
  • $K$ is an integer.

Sample Explanation 1

When $t = 0$, the range of the outer wall of the room that can be illuminated is the arc length between the points $(0.99476..., 0.10222...)$ and $(-0.99476..., 0.10222...)$ with a length of $2.93678...$. The proportion of the total circumference is $2.93678... / 2\pi = 0.46740...$. When $t = 1$, by appropriately changing the direction of the light, all points that could not be reached when $t = 0$ can now be illuminated.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
0.0 0.0 0.6 0.0 0.7 2
样例输出
0.467404563822388 1 1