Wish
문제
Each second Martynas catches a glimpse of the sky through his telescope expecting to see a falling star. Every time he sees a falling star he makes a wish upon it.
Martynas believes that the more falling stars he will see while making a wish, the higher the probability the wish will come true.
Calculate the largest possible number of stars Martynas can see during a glimpse through his telescope.
The sky can be modelled as an endless plane. Martynas can see an area limited by a circle with center and radius .
Before opening his telescope Martynas checked the star chart:
- There are stars in the sky;
- During the first glimpse the coordinates of the ’th star will be , ;
- During the second glimpse (which will take place sec. after the first one) the ’th star will be , ;
- All the stars are moving at constant speed;
- The position of each star will change between the first and the second glimpse.
Martynas can keep looking at the stars forever.
입력
The first input line contains two numbers: the total amount of stars and the radius of the circle .
Each of remaining lines contains integers each: , , , describing the position of ’th star during the first and the second glimpse.
출력
The first and the only output line should contain one integer – largest possible number of stars visible through the telescope.
예제
예제 1
3 2 -5 0 -4 0 3 0 2 0 10 0 9 0
2
예제 2
2 1 -3 -2 -1 -1 -2 2 -1 1
2
예제 3
2 2 3 0 5 0 -2 1 2 1
0