Function to find the number of subsequences of the given array with a sum in range [ L , R ] and the difference between the maximum and minimum element is at least X
static int numberofSubsequences ( int [ ] a , int L , int R , int X , int n ) {