function to count all quadruples from four sorted arrays whose sum is equal to a given value x
static int countQuadruples ( int [ ] arr1 , int [ ] arr2 , int [ ] arr3 , int [ ] arr4 , int n , int x ) { int count = 0 ;