#K95407. Longest Non-Decreasing Sublist

    ID: 38856 Type: Default 1000ms 256MiB

Longest Non-Decreasing Sublist

Longest Non-Decreasing Sublist

You are given a list of integers representing performance scores. Your task is to determine the length of the longest contiguous sublist that is non-decreasing. A sublist is non-decreasing if each element is greater than or equal to its previous element. Formally, given an array \(A\) of size \(n\), find the maximum length \(L\) such that there exists an index \(i\) (where \(0 \le i < n\)) for which the sequence \(A[i], A[i+1], \dots, A[i+L-1]\) satisfies \(A[j] \le A[j+1]\) for all valid \(j\).

The input should be read from standard input and the output should be written to standard output.

inputFormat

The first line contains a non-negative integer \(n\) representing the number of performance scores. If \(n > 0\), the second line contains \(n\) space-separated integers representing the performance scores.

outputFormat

Output a single integer representing the length of the longest contiguous non-decreasing sublist.

## sample
8
5 3 4 8 6 7 7 8
4

</p>