Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

You just got a multi-million dollar contract to operate radar infrastructure.

Each radar outputs N data points it has collected while rotating in a circle. Each data point i consists of a value a_i. You are to find the longest consecutive sequence of data points that has a value strictly less than K.

Notice points a_1 and a_N are considered consecutive since it wraps around!

Input Specification

The first line contains the integers N (1 \le N \le 5\,000) and K (1 \le K \le 500\,000), representing the number of data points, and the condition specified above.

On the next line, there are N space-separated numbers a_i (1 \le a_i \le 500\,000)

Output Specification

On a single line, output the longest sequence length. If no sequence exists, output 0.

Sample Input

5 3
1 3 5 2 2

Sample Output

3

Explanation

In this example, the longest sequence wraps around and consists of the numbers 2 2 1 going from right to left.


Comments

There are no comments at the moment.