Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

EI2122Q1ADAM1 - Number of pairs

Given N integers, denoted by numbers, and an integer X. Count the number of pair indices (i, j) that i < j and numbers[j] - numbers[i] = X

Input

-      The first line contains two integers N, X (1 ≤ N ≤ 105, -109 ≤ X ≤ 109).

-      The second line contains N integers (-109 ≤ numbers[i] ≤ 109).

Output

The number of pair indices.

 

Sample

Input

Output

6 1

1 6 4 2 4 5

3

 


Added by:Ha Minh Ngoc
Date:2021-11-15
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.