Mr X requires teammate!
All submissions for this problem are available.
Mr. X wants to compete in programming competition but he alone cannot participate in the competition , hence he need a teammate probably a good one , therefore he gave a problem and the one who solves it first will get a chance to be in his team.
Imagine a plane with coordinate system. You are standing at the origin now u have to choose a direction to throw a ball. The ball will hit the ground at a distance L from the origin and again continue to fly in the same direction and now it will hit the ground at the distance 2L from the origin and so on.(it will continue to fly in the same direction and hitting the plane after each L units)
There are N circles marked on the plane. If a ball hits inside the circle(including its circumference) then you will get one point. You will get a point each if a ball hits multiple circles at once and also when ball hits the same circle multiple times. You have to throw the ball in such a direction so that you will get maximum number of points.
The first line of the input contains T the number of test cases. Second line contains two space seperated integers N and L. Next N lines contains the circle's description. The i'th line contains three space seperated integers xi , yi , ri.
Print a single integer - the maximum number of points you can get.
1 <= T <= 20
1 <= N <= 1000
5 <= L <= 10
-1000 <= xi,yi <= 1000
1 <= ri <= 50
Input: 2 1 6 3 4 2 2 5 5 10 3 6 7 4 Output: 1 2
Example case 1.Self-Explanatory.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH|
Fetching successful submissions