You are given an array A. You are required to divide this array into exactly K non-empty segments and check whether the minimum element S amongst the maximum elements amongst all segments is less than Q or not.
In other words, if you store the maximum element of each of the segment in an array P, then you must check if the minimum element in P is less than Q or not.
Input format
Output format
For each test case, if S is less than Q, then print S, else print NO. The answer for each test case must be printed in a new line.
Constraints
1≤T≤10
1≤N≤105
1≤K≤N
0≤Q≤109
1≤Ai≤109
We can divide the complete array into 5 segments ---1, 2, 3, 4, 5. The minimum number among this number is 1 which is less than 2.