#P11441. Protection of the Penguin Continent

    ID: 13521 Type: Default 1000ms 256MiB

Protection of the Penguin Continent

Protection of the Penguin Continent

Legend has it that in \(100000\) years, a barrage of meteorites will strike the Penguin Continent. The advanced penguin mages, stationed at fixed points, have cast protective formations across the land. A mage is located at a fixed point with non-negative integer coordinates \((X, Y)\) and no two mages share the same location.

A point in the plane is considered protected if there exist two mages \(A\) and \(B\) such that the angle \(APB\) formed at that point is at least \(90^\circ\). Using the cosine law, one can show that \(\angle APB \ge 90^\circ\) if and only if \[ PA^2+PB^2\le AB^2, \] which, after some algebra using the midpoint \(M\) of \(AB\), is equivalent to \[ PM \le \frac{AB}{2}. \] In other words, for every pair of mages with positions \(A\) and \(B\), the disk with center \(M = \big(\frac{X_A+X_B}{2},\frac{Y_A+Y_B}{2}\big)\) and radius \(\frac{AB}{2}\) is safe. The overall protected region is the union of all such disks. Your task is to compute the area of this protected region.

Note: When writing formulas use \(\LaTeX\) notation.

inputFormat

The first line contains a single integer \(n\) (the number of mages). Each of the following \(n\) lines contains two non-negative integers \(X\) and \(Y\), representing the coordinates of a mage.

If \(n < 2\), the protected area is zero.

outputFormat

Output a single number: the area of the protected region. An absolute or relative error of up to \(10^{-6}\) is acceptable.

sample

2
0 0
2 0
3.1415926536