Function to find the length of a longest subarray in which elements greater than K are more than elements not greater than K
static int LongestSubarray ( int [ ] a , int n , int k ) { int [ ] pre = new int [ n ] ;