#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

Given a sequence of *N* integers, find the number of pairs of integers of difference exactly *K*.

The integers will range from 0 to *D* inclusive.

## Input

The first line of input will contain 2 single integers, *N* and *K*

The next line will contain *N* integers, which describe the sequence.

## Output

Output a single integer, the number of pairs of integers where their difference is exactly *K*.

## Subtasks

Subtask 1 (10 points): *N*, *K*, *D* ≤ 1000

Subtask 2 (10 points): *N*, *K*, *D* ≤ 10000

Subtask 3 (20 points): *N* ≤ 100000, *K*, *D* ≤ 1000000

Subtask 4 (20 points): *N* ≤ 500000, *K*, *D* ≤ 1000000

Subtask 5 (40 points): *N* ≤ 1000000, *K*, *D* will fit into a 32-bit signed integer

Subtask 6 (0 points): Sample Testcases

For subtask 1,2 and 3 there will be no repeated numbers.

For subtask 4 and 5 there will be repeated numbers.

## Sample Input

10 5 1 2 3 4 5 6 7 8 9 10

## Sample Output

5

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 10 | 100 | 1s | 64MB | Minimum |

2 | 10 | 100 | 1s | 64MB | Minimum |

3 | 20 | 100 | 1s | 64MB | Minimum |

4 | 20 | 50 | 1s | 64MB | Minimum |

5 | 40 | 21 | 1s | 64MB | Minimum |

6 | 0 | 1 | 1s | 64MB | Minimum |

### Judge Compile Command

g++-7 ans.cpp -o difference -Wall -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512