CF903D Almost Difference
Description
Let's denote a function

You are given an array $ a $ consisting of $ n $ integers. You have to calculate the sum of $ d(a_{i},a_{j}) $ over all pairs $ (i,j) $ such that $ 1
Input Format
N/A
Output Format
N/A
Explanation/Hint
In the first example:
1. $ d(a_{1},a_{2})=0 $ ;
2. $ d(a_{1},a_{3})=2 $ ;
3. $ d(a_{1},a_{4})=0 $ ;
4. $ d(a_{1},a_{5})=2 $ ;
5. $ d(a_{2},a_{3})=0 $ ;
6. $ d(a_{2},a_{4})=0 $ ;
7. $ d(a_{2},a_{5})=0 $ ;
8. $ d(a_{3},a_{4})=-2 $ ;
9. $ d(a_{3},a_{5})=0 $ ;
10. $ d(a_{4},a_{5})=2 $ .