No.948 Bomb vs Dush
Problem Statement
We play a game in which jupiro, who "has bombs", tries to catch sarashin, who "runs fast".
Initially, at time $t=0$, sarashin is at coordinates $(0,0)$ on the $xy$-plane, and jupiro is at coordinates $(a(t),b(t))$.
Here, $a(t),b(t)$ are functions of time $t$, and they always satisfy the following condition.
$(a(t)-R\cos{t})^2+(b(t)-R\sin{t})^2 \le r^2 \ (0 < r < R \le 100)$
sarashin's goal is to reach the safe zone, the point at coordinates $(100^{100^{100}},100^{100^{100}})$, which jupiro can never reach.
At the current time $t$, sarashin cannot enter any region where jupiro may have been at some past time $s\ (0 \le s \le t)$, because a bomb may have been planted there.
sarashin must move to the safe zone while avoiding the regions where jupiro has been.
Since sarashin runs very fast, he can move on the $xy$-plane at a speed of $100^{100^{100}}$.
In this game, if sarashin stays at the initial position $(0,0)$ without moving at all, it can be proved that there exists a $t'$ such that he can reach the safe zone point during times $t\ (0 \le t < t')$,
but can no longer reach the safe zone point at times $t\ (t' \le t)$.
Find this boundary time $t'$. Also, find the area of the region where jupiro may have been between time $t=0$ and $t=t'$.
In this problem, sarashin and jupiro are regarded as points with no size.
Input
$r$ $R$
$0 < r < r + 0.01 < R \le 100$
Input values are given with at most 7 digits after the decimal point.
Time $t$ is $t=0$ in the initial state and advances only in the positive direction.
Output
On the first line, output the boundary time $t'$.
On the second line, output the area of the region where jupiro may have been between time $t=0$ and $t=t'$.
Your answer is considered correct if the absolute or relative error from the judge's output is at most $10^{-5}$.
Print a newline at the end.
Sample
Sample 1
Input
0.5 1
Output
5.2359877560 6.0213859194
Sample 2
Input
0.98 1
Output
3.5422623382 9.9600197675
Sample 3
Input
0.001 2.5
Output
6.2823853072 0.0314150681
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
37zigen