Wish | 프로그래밍의 벗 PivotOJ
PivotOJ

Wish

시간 제한: 1000ms메모리 제한: 1024MB출처: LMIO 2018-2019BOJ 27346

문제

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 (0,0)(0, 0) and radius RR.

Before opening his telescope Martynas checked the star chart:

  • There are NN stars in the sky;
  • During the first glimpse the coordinates of the ii’th star will be aia_i, bib_i;
  • During the second glimpse (which will take place 11 sec. after the first one) the ii’th star will be cic_i, did_i;
  • 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 NN and the radius of the circle RR.

Each of remaining NN lines contains 44 integers each: aia_i, bib_i, cic_i, did_i describing the position of ii’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
코드를 제출하려면 로그인하세요.