#d2616. A-B 数对

A-B 数对

A-B Pairs

Problem Description

You are given a sequence of numbers and a number CC. Count the number of pairs (A,B)(A, B) satisfying A−B=CA - B = C (two numbers at different positions with the same value are counted as different pairs).

Input Format

Two lines in total.

The first line contains two integers NN, CC.

The second line contains NN integers, the sequence to process.

Output Format

One line containing the number of pairs in the sequence that satisfy A−B=CA - B = C.

Sample Input

4 1
1 1 2 3

Sample Output

3

Constraints

1≤N≤2×1051\leq N \leq 2\times 10^5, 1≤C≤2×1051 \leq C \leq 2\times 10^5. The NN input numbers are guaranteed to be below 2302^{30}.