Suppose we have an array which consist of n elements: a1, a2, a3, ..... , an and we have given the value of k which is the count of removed elements from the array. So after removing k elements from the array what is the maximum value of absolute difference of the adjacent elements of the array. Suppose,

n=5 k=3

1 2 5 2 1

then we remove 1,2,2 then the remaining elements of the array will be 5 1 so, ans=abs(5-1)=4 (maximum value which we can get).