CF32A Reconnaissance
Description
According to the regulations of Berland's army, a reconnaissance unit should consist of exactly two soldiers. Since these two soldiers shouldn't differ much, their heights can differ by at most $ d $ centimeters. Captain Bob has $ n $ soldiers in his detachment. Their heights are $ a_{1},a_{2},...,a_{n} $ centimeters. Some soldiers are of the same height. Bob wants to know, how many ways exist to form a reconnaissance unit of two soldiers from his detachment.
Ways $ (1,2) $ and $ (2,1) $ should be regarded as different.
Input Format
The first line contains two integers $ n $ and $ d $ ( $ 1
Output Format
Output one number — amount of ways to form a reconnaissance unit of two soldiers, whose height difference doesn't exceed $ d $ .