Codeforces Round #FF (Div. 1)
A
DZY Loves Sequences
Codeforces
1600
原题
←B →
翻译中…

DZY has a sequence $*a*$, consisting of $*n*$ integers.

翻译中…

We'll call a sequence $*a*_{*i*}, *a*_{*i* + 1}, ..., *a*_{*j*}$ $(1 ≤ *i* ≤ *j* ≤ *n*)$ a subsegment of the sequence $*a*$. The value $(*j* - *i* + 1)$ denotes the length of the subsegment.

翻译中…

Your task is to find the longest subsegment of $*a*$, such that it is possible to change at most one number (change one number to any integer you want) from the subsegment to make the subsegment strictly increasing.

翻译中…

You only need to output the length of the subsegment you find.

翻译中…

Input

翻译中…

The first line contains integer $*n* (1 ≤ *n* ≤ 10^{5})$. The next line contains $*n*$ integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*} (1 ≤ *a*_{*i*} ≤ 10^{9})$.

翻译中…

Output

翻译中…

In a single line print the answer to the problem — the maximum length of the required subsegment.

翻译中…

Note

翻译中…

You can choose subsegment $*a*_{2}, *a*_{3}, *a*_{4}, *a*_{5}, *a*_{6}$ and change its 3rd element (that is $*a*_{4}$) to 4.

翻译中…

样例

Input #1
6
7 2 3 1 5 6
Output #1
5
InputCopy OutputCopy
题目信息
题号
446A
时间限制
1 s
内存限制
256 MB
标签
动态规划
模拟
双指针

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。