Escape from the Minefield

No attempts yetTime limit2sMemory limit512 MB

Problem

After a failed parachute drop, Lieutenant Jones and his platoon land in the middle of an enemy minefield instead of at their target coordinates.

Jones carries an accurate map showing the location of every mine. Each anti-personnel mine has a blast-and-detection radius of $2$ meters: anyone who comes within $2$ meters of a mine dies.

For the moment the platoon is safe, hidden beneath a bush at Jones' position. They will escape in a single circular formation: a disk of radius $r$ centered on the bush. Each soldier needs $1$ square meter of area on average, so a formation of radius $r$ can hold $\lfloor \pi r^2 \rfloor$ soldiers.

The formation must stay outside every mine's blast radius at all times. That is:

  • At the start, the whole disk (centered on the bush) must lie at least $2$ meters away from every mine.
  • To escape, the disk must be able to move from the bush all the way out of the field, and at every moment no point of the disk may come within $2$ meters of any mine (the disk has to squeeze through the gaps between mines).

Jones wants to bring out as many soldiers as possible; anyone who does not fit inside the largest formation that can safely escape is left behind to be captured. Determine that maximum number of soldiers.

Input

The first line contains a positive integer $T$, the number of test cases. Each test case is given as follows:

  • A line with a single positive integer $n$ ($1 \le n < 10^5$), the number of mines.
  • $n$ lines follow, each with two integers $x$ and $y$ ($|x|, |y| < 10^5$): the coordinates in meters of a mine relative to Jones' position (the bush is at the origin). No two mines share the same coordinates.

Output

For each test case, output a single line containing one integer: the maximum number of soldiers that can escape.