A store shelf holds n items in a row, each labeled by an integer brand id. A restocking rule allows a contiguous stretch to mix at most k distinct brands. Find the length of the longest contiguous stretch that contains at most k distinct brand ids.
Input format
Line 1: two integers n and k.
Line 2: n space-separated integers, the brand ids in shelf order.
Output format
A single integer: the length of the longest contiguous window with at most k distinct values.
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ k ≤ n
- 1 ≤ each brand id ≤ 1000000000