Problem A
Half a Cookie

You and your sister have to share a large, circular cookie. The cookie is quite stale, so you must break it by striking it with a hammer. When struck at point $p$, the cookie will break along the shortest chord containing $p$. You follow the usual strategy of one person breaking the cookie into two parts and the other person choosing which part to take. Thus, after the cookie is broken, you want to know which part is larger.


Input consists of up to $200$ test cases, one per line. Each test case is given as three real numbers $r$ $x$ $y$, where each value is in the range $[0,20]$ with at most $8$ digits past the decimal point. All units are given in centimeters. The $r$ value gives the radius of an origin-centered cookie. The $x$ and $y$ values give the coordinates where the cookie is struck. No strike will be within $0.001$ cm of the edge of the cookie. Input ends at end of file.


For each test case, print a line giving the area of the resulting two cookie pieces, larger piece first. Answers should be correct to within $0.001$ square centimeters. If the hammer misses the cookie entirely, simply print out the word “miss”.

Sample Input 1 Sample Output 1
10.0 5.0 0
5.5 5.0 5.0
8.0 3.0 4.5
252.740780 61.418485
179.924668 21.137262

Please log in to submit a solution to this problem

Log in