Given an array how to find sum of all f(A',k) where A' is subarray of A(original array) and f(A',k) are total unordered pairs (i,j) such that abs(A[i]−A[j])>=k.How to solve this using segment tree.What should be the merge function?↵
Problem link :[Problem link](https://www.hackerearth.com/practice/data-structures/advanced-data-structures/fenwick-binary-indexed-trees/practice-problems/algorithm/micro-and-array-function/description/)↵
Problem link :[Problem link](https://www.hackerearth.com/practice/data-structures/advanced-data-structures/fenwick-binary-indexed-trees/practice-problems/algorithm/micro-and-array-function/description/)↵