#CCBCHBAHAI0000013. Kefa and First Steps (Kefa and First Steps)
Kefa and First Steps (Kefa and First Steps)
Kefa and First Steps
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem
Given , find the maximum length of a contiguous segment satisfying for every .
Input
Line 1 contains . Line 2 contains .
Output
Print the required integer answer.
Subtasks
Subtask 1 (20 points): ; .
Subtask 2 (30 points): ; .
Subtask 3 (50 points): ; .
Example
Input
6
2 2 1 3 4 1
Output
3
Explanation
The values follow directly from the definitions and illustrate the valid index range of the array scan.