A power grid records an integer load reading for each of n consecutive minutes. A contiguous span of minutes is called TOLERABLE if, within that span, (maximum reading - minimum reading) <= tol.
Find the LENGTH of the LONGEST tolerable contiguous span. (A span consisting of a single reading is always tolerable, since its max equals its min.)
Input format
Line 1: two integers n and tol.
Line 2: n space-separated integers, the load readings.
Output format
A single integer: the length of the longest tolerable contiguous span.
Constraints
- 1 <= n <= 100000
- 0 <= tol <= 2000000
- -1000000 <= each reading <= 1000000