Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
Language:
Escape from the Minefield
Time Limit: 10000MSMemory Limit: 65536K
Total Submissions: 68Accepted: 12

Description

After a failed parachute drop lieutenant Jones nds himself in a precarious situation. Instead of landing at the target coordinates, he and his platoon are trapped in the middle of an enemy minefield!
Fortunately, as a special-ops soldier, lieutenant Jones has come prepared for all situations. Among other things, he carries an accurate map that shows the locations of all the mines in the area. Intelligence brie ngs further suggest that the type of anti-personnel mine used by the enemy has a blast- and detection-radius of 2 meters; if you get any closer, you die.
For the moment Jones' platoon is safe, hiding beneath a bush. To keep things simple they plan to make a run for it while staying in a circular formation (In a circular formation the distance of each soldier to the circle's center is less than the circle's radius. The total area of the circle should be enough to accommodate all soldiers.), starting centered at the bush. In this formation each soldier needs an area of 1 square meter on average. For the sake of morale the entire formation should stay outside the blast-radius of any mines.
Of course, lieutenant Jones wants to escape with as many soldiers as possible. But in order to ensure that no one steps on a mine he may have to leave some men behind to be captured by the enemy.

Input

On the first line of the input is a positive integer, the number of test cases. Then for each test case:
A line with a single positive integer n < 105, the number of mines in the minefield.
n lines, each containing two integers, the x and y coordinates (in meters) of each mine relative to Jones' current location. |x|, |y| < 105. No two mines have the exact same coordinates.

Output

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

Sample Input

3
3
2 2
2 -2
-2 -2
8
4 2
4 -1
1 4
-2 4
-4 2
-4 -2
-1 -4
2 -4
7
-10 -1
-4 3
-4 -4
-1 -6
2 4
3 -4
7 0

Sample Output

2
0
7

Source

[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator