Care for a chat?
The opening ceremony of the Olympics was a spectacular event, lasting nearly 4 hours. Everyone in attendance was enthralled by the performances, with many, including UN Secretary-General Ban Ki-moon, capturing memorable moments on their mobile phones.
During the Olympics, spectators naturally wanted to connect with each other using their mobile phones. However, they faced a challenge: they could only communicate if they were within R miles of each other. We won't delve into the technical reasons for this limitation in London, as our task is different: given the coordinates of N spectators, we need to determine how many unique pairs of spectators could communicate with each other.
Keep in mind that the London coordinate system is measured in miles, and that the pairs {A, B} and {B, A} are considered identical.
Input
The first line contains 2 numbers: the number of spectators N (1 ≤ N ≤ 100) and the communication range R (1 ≤ R ≤ 1000). The following N lines each contain 2 numbers, representing the coordinates of each spectator. All coordinates are integers with an absolute value not exceeding 1000.
Output
Output a single number, which is the answer to the problem.