Given N numbers and an integer K find :
Formally: we can define maxmed as the maximum median of each subarray of length K.
Note that: the median of K numbers indexed from 1 is ((K+1)/2)th smallest of them, rounding down for even K.
Input format
Output format
Print the answer as described above.
Constraints
2≤N,K≤105
1≤ai≤105
K≤N
In the example, we can notice that we have 3 subarrays of size 2
{1,2},{2,3},{3,4} here the median of every subarray is the mean of the 2 middle values (rounded down) since we have an even size subarray.
all medians will be(1,2,3) and the maxmed is 3 and finally (Nmaxmed) will be 43=64.