Editorial for COCI '06 Contest 1 #2 Herman
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
A circle in taxicab geometry is a square in regular geometry (at an angle of degrees if when placed in a Cartesian coordinate system). The area of such a "circle" is thus .
The area of a regular circle is . can be embedded in the source code as a constant or calculated (better) as or . Some implementations of the C language define the constant M_PI
in the header <math.h>
, though this is not defined by the C standard.
Comments