#K57702. Maximum Nesting Depth

    ID: 30479 Type: Default 1000ms 256MiB

Maximum Nesting Depth

Maximum Nesting Depth

You are given an array of integers, and your task is to determine its maximum nesting depth. The ( \textbf{nesting depth} ) is defined as the length of the longest consecutive strictly decreasing subsequence in the array. In other words, if the array is ( A ), find the maximum ( k ) such that there exists an index ( i ) with ( A[i] > A[i+1] > \dots > A[i+k-1] ). Note that if the array contains only a single element, the nesting depth is defined to be ( 1 ).

For example, for the array [4, 2, 3, 1], the longest strictly decreasing subsequence is [4, 2] which has a length of 2, so the maximum nesting depth is 2. Similarly, for an array that is sorted in non-decreasing order, the answer is ( 1 ).

inputFormat

Input is provided via standard input as a single line containing space-separated integers representing the list.

outputFormat

Output a single integer—the maximum nesting depth—on standard output.## sample

4 2 3 1
2