P5978 [CEOI 2018] Global warming
Description
Given $n$, you may choose any segment from $a_l$ to $a_r$ ($1\le l\le r\le n$), and add a value $d$ ($-x\le d\le x$) to each element in this segment. Find the maximum length of a strictly increasing subsequence of the array $a$.
Input Format
The first line contains two integers $n, x$.
The second line contains $n$ integers representing $a_1$ to $a_n$.
Output Format
Output one number, the maximum length of a strictly increasing subsequence of the array $a$.
Explanation/Hint
For $100\%$ of the testdata, $1\le n\le 2\times 10^5$, $0\leq x\leq10^9$, $1\leq a_i\leq10^9$.
Translated by ChatGPT 5