Problem B
Estimating the Area of a Circle
One way to estimate the area of a circle is to draw a square that just encompasses the circle and mark points randomly (with uniform probability) with a marker. Then, when you get tired of marking points, count up the number of points that you marked that landed in the circle and divide it by the total number of points that you marked. That gives you an idea of how large the circle is relative to the square. Your job is to judge how accurate this is for given circles and experiment outcomes.
![\includegraphics[width=0.30\textwidth ]{circle}](/problems/estimatingtheareaofacircle/file/statement/en/img-0001.png)
Input
Input contains up to
Output
For each test case, print a line containing two numbers: the
true area of the circle and the estimate according to the
experiment. Both numbers may have a relative error of at most
Sample Input 1 | Sample Output 1 |
---|---|
1.0 100 75 10.0 5000 4023 3.0 21 17 0 0 0 |
3.141592654 3 314.1592654 321.84 28.27433388 29.14285714 |