As you know, in the tribe of giants, each person has a misfortune number and a…
- User
As you know, in the tribe of giants, each person has a misfortune number and a reputation number. Giant unlucky number no i i with b i b i And his credit number with a i a i We show
The emotional distance between two giants i i and J j is equal to: f ( i , J )
∣ a i
a J ∣ + ∣ b i
b J ∣ f(i,j)=∣a i
- a J ∣+∣b i -b J ∣
Three giants i i and J j and l They form a team if the sum of their two-by-two emotional distances from k not more than k. In other words: f ( i , J ) + f ( i , l ) + f ( J , l ) ≤ k f(i,j)+f(i,l)+f(j,l)≤k
Since Mino realized the intelligence and intelligence of the tribe's people; He wants to know the number of clan teams. help him
input In the first line, enter the number n n number of clan members and k k are separated by a space.
in n n the next line, two numbers in each line a i a i and b i b i has come
1 ≤ n ≤ 2
000 1≤n≤2000 1 ≤ k ≤ 4 x 1 0 9 1≤k≤4×10 9
0 ≤ a i , b i ≤ 1 0 9 0≤a i ,b i ≤10 9
output In the output, print a number that is the number of giant teams.
Example Sample input 5 10 4 2 5 3 1 1 3 1 2 4 Plain text Sample output 5 write in c++
- Assistant