Glyph Recognition

For each k from 3 to 8, fit the largest origin-centered regular k-gon with a vertex on the +x axis avoiding all points and the smallest one containing all points, then report the k with the best area ratio.

Medium5GeometryBinary searchMathImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

You are an archaeologist at an excavation site, and your team has dug up hundreds of clay tablets covered with glyphs of an ancient language. Little is known about the language so far, but there are only six different glyphs. Each one is a regular polygon with 3 to 8 corners, drawn with one corner pointing to the right, as in Figure G.1(a). Only the boundary of each polygon is carved out of the clay.

(a) The six glyphs.(b) The first sample input.(c) Triangles and hexagons fitted to the first sample input. The triangles give the higher score.

Figure G.1

You want to start analysing the language right away, so the writing has to be turned into a machine readable form. An OCR tool would be ideal, but none is installed on your laptop and there is no internet connection at the site.

So you digitise the tablets yourself. For every glyph you first collect a number of sample points that lie in the carved out region, that is, on the boundary of the polygon. From those points you compute a score for each of the six glyphs, and the glyph with the highest score is the recognised one.

For a given number of corners kk (3k83 \le k \le 8) the score is computed as follows. Two regular kk-gons are fitted to the sample points, one from the inside and one from the outside, so that all of the following hold.

  • Each polygon is centered at the origin, so all of its vertices have the same distance to (0,0)(0, 0).
  • Each polygon has a vertex on the positive xx axis.
  • The inner polygon is the largest such polygon that contains none of the sample points.
  • The outer polygon is the smallest such polygon that contains all of the sample points.

Figure G.1(c) shows an example. The score for this value of kk is Ainner/AouterA_{\text{inner}} / A_{\text{outer}}, where AinnerA_{\text{inner}} and AouterA_{\text{outer}} are the areas of the inner and the outer polygon.

Given the sample points, find the glyph with the highest score.

Input

The first line contains one integer nn (1n10001 \le n \le 1000), the number of sample points.

Each of the next nn lines contains two integers xx and yy (106x,y106-10^6 \le x, y \le 10^6), one sample point at coordinates (x,y)(x, y).

No sample point is at the origin, and all points are distinct.

Output

Print the number of corners kk of the recognised glyph, then a space, then the score of that glyph rounded to exactly 10 digits after the decimal point.

The score you print is the highest score over all kk from 3 to 8. If several values of kk reach a score that differs from the highest score by at most 10910^{-9}, print the smallest such kk. Every test is built so that the 10th digit after the decimal point is unambiguous.