UVa 12578 - 10:6:2

12578 - 10:6:2

 * http://uva.onlinejudge.org/external/125/12578.html

Summary
Simple math.

Explanation
Let,
 * Length of the rectangle $$ = l$$
 * Width of the rectangle $$ = w$$
 * Radius of the circle $$ = r$$

Here, $$l : r = 5 : 1 => r = \frac{l}{5} $$

So, area of the red circle $$ = \pi r^2$$ $$ = \frac{\pi l^2}{25} $$

And, $$l : w = 10 : 6 => w = \frac{3l}{5} $$ So, the area of the rectangle $$ = lw = \frac{3l^2}{5} $$ The area of the green portion $$ = $$ area of the rectangle $$ - $$ area of the red circle

Implementations
Just take the input & print the output by using the simple math formula.

Input
4 1 10 329 1000

Output
0.13 0.47 12.57 47.43 13601.97 51342.63 125663.71 474336.29

Solutions

 * C++ : https://github.com/shahed-shd/Online-Judge-Solutions/blob/master/UVa-Online-Judge/12578%20-%2010:6:2.cpp