You just got a multi-million dollar contract to operate radar infrastructure.
Each radar outputs data points it has collected while rotating in a circle. Each data point consists of a value . You are to find the longest consecutive sequence of data points that has a value strictly less than .
Notice points and are considered consecutive since it wraps around!
The first line contains the integers and , representing the number of data points, and the condition specified above.
On the next line, there are space-separated numbers
On a single line, output the longest sequence length. If no sequence exists, output
5 3 1 3 5 2 2
In this example, the longest sequence wraps around and consists of the numbers
2 2 1 going from right to left.