#P11544. Guardian Circle Perimeter
Guardian Circle Perimeter
Guardian Circle Perimeter
A long time ago — in fact, $100000$ years ago — a huge number of meteorites were on a collision course with Penguin Continent. The penguin mages, scattered across the continent at distinct locations with non‐negative integer coordinates \( (X,Y) \), joined their magical powers to form protective circular arrays. For every two mages (located at distinct points), a circle is formed with the line joining them as its diameter. The entire protected region is the union of all such circles.
Your task is to compute the length of the outer boundary (perimeter) of the protected region. It can be proven that the union of all circles with diameters defined by the mage points is exactly the minimal enclosing circle of the given points. In other words, if \(R\) is the radius of the smallest circle that contains all mage points, then the perimeter of the protected region is \[ 2\pi R. \]
Note: It can be shown that the protected region is always a circle (namely, the minimal enclosing circle of the given points).
inputFormat
The first line contains an integer \(n\) (\(n \ge 2\)), the number of mage points. Each of the following \(n\) lines contains two non‐negative integers \(X\) and \(Y\), representing the coordinates of a mage. No two mages are at the same position.
outputFormat
Output a single floating‑point number — the perimeter of the protected region (i.e. \(2\pi R\), where \(R\) is the radius of the minimal enclosing circle of the given points). Answers within an absolute error of \(10^{-6}\) will be accepted.
sample
2
0 0
4 0
12.566370614359
</p>