Timus 1084

From Algorithmist
Jump to navigation Jump to search

1084 - Goat in the Garden[edit]

Summary[edit]

Determine the area of a circular region bounded by a square, providing the result accurate to three decimal places.

Explanation[edit]

Gotchas[edit]

  • Check if you have enough digits of PI.

Notes[edit]

The main solution is calculating the area of the circle, then subtracting the areas of the four Circular segments.

Implementations[edit]

Optimizations[edit]

Input[edit]

10 6

Output[edit]

95.091

References[edit]

  1. Reference 1