Function to count the number of distinct medians of an array where each array elements are given by a range
static void solve ( int n , ArrayList vec ) { ArrayList a = new ArrayList ( ) ; ArrayList b = new ArrayList ( ) ;