#P5978. [CEOI 2018] Global warming

[CEOI 2018] Global warming

Problem Description

Given nn, you may choose any segment from ala_l to ara_r (1≤l≤r≤n1\le l\le r\le n), and add a value dd (−x≤d≤x-x\le d\le x) to each element in this segment. Find the maximum length of a strictly increasing subsequence of the array aa.

Input Format

The first line contains two integers n,xn, x.

The second line contains nn integers representing a1a_1 to ana_n.

Output Format

Output one number, the maximum length of a strictly increasing subsequence of the array aa.

8 10
7 3 5 12 2 7 3 4
5

Hint

For 100%100\% of the testdata, 1≤n≤2×1051\le n\le 2\times 10^5, 0≤x≤1090\leq x\leq10^9, 1≤ai≤1091\leq a_i\leq10^9.

Translated by ChatGPT 5