Mosquito, You Are Mine
Time limit2sMemory limit256 MB
Cover as many of up to 32 points as possible with one circle of the given diameter and report the maximum count.
- Level
Medium6 of 10
- Topics
- Geometry, Brute force
- Solved
- No attempts yet
Problem
The mosquitoes are back this year. They ruined your picnic, and now it is your turn to strike back. You have no gear that keeps these pests away. All you own is the round empty bowl that held the potato salad. Looking down at the picnic table, you see mosquitoes sitting still, waiting for your guard to drop. Your chance to fight back is right now.
Find the largest number of mosquitoes you can trap by turning the bowl over and slamming it down on the table. You are given the diameter of the bowl and the exact coordinates of every mosquito. A mosquito is infinitely small, so it is a single point, and a mosquito lying on the rim of the bowl counts as trapped.
Input
The first line holds the number of trapping scenarios (). A blank line comes before each scenario. Each scenario starts with an integer (), the number of mosquitoes, and a real number (), the diameter of the bowl. The next lines each hold the coordinates of one mosquito as real numbers , ().
Output
For each scenario, print on one line the largest number of mosquitoes you can trap at once. Every input keeps the same answer when the diameter of the bowl grows by .