UVa 10451

From Algorithmist
Jump to navigation Jump to search

10451 - Ancient Village Sports[edit]

http://uva.onlinejudge.org/external/104/10451.html

Summary[edit]

You are given the area of the polygon. You'll have to find area for spectators = area of the outer circle - area of the polygon area for officials = area of the polygon - area of the inner circle remember and your output should be rounded currect to 5 decimal points.

Explanation[edit]

Find the area of the small triangle made up the polygon (see UVa 10432) from there you can find the area of the outer circle and you can find the area of the inner circle through this formula:


This is the square radious(r*r) of inner circle. Multiply it with PI, then it is the ares of the inner circle.

Implementations[edit]

Sample Input[edit]

3 0.43301
6 2.59808
9 6.18182
0 2.33333

Sample Output[edit]

Case 1: 0.61418 0.17121
Case 2: 0.54352 0.24188
Case 3: 0.53226 0.25314