Mountain tourism
The active tourism club on the planet Olympia has decided to offer clients a scenic route along a picturesque mountain ridge. Due to the ridge's considerable length and challenging terrain, the club aims to identify the most appealing route of a manageable length. Based on social research, tourists particularly enjoy traversing sections that are higher than others over the longest possible distance, as this provides a broader view and a thrilling sense of elevation.
To simplify the task, the ridge has been divided into one-meter segments, with the average altitude above sea level determined for each. The numerical attractiveness of each segment is defined as the number of consecutive segments to the left and right, starting with its immediate neighbors, that have a strictly lower height than the segment itself. The segment itself is not included in this count. The attractiveness of a route is calculated as the sum of the attractiveness values of the one-meter segments included in it. The route's length must not exceed T meters. The direction of the route is irrelevant, as it does not affect its attractiveness. The route can begin at any segment of the ridge and must consist of consecutive segments without any gaps.
Task
Write a program that, given the altitude information for each one-meter segment of the mountain ridge, calculates the attractiveness of the most appealing route with a length not exceeding T meters.
Input
The first line contains two integers: N - the total length of the ridge in meters, and T (1 ≤ T ≤ N ≤ 100,000) - the maximum allowable route length. The second line contains N integers ranging from 1 to 10^6 - representing the heights of the consecutive one-meter segments.
Output
Output a single integer - the numerical value of the attractiveness of the most appealing route along the mountain ridge with a length not exceeding T.