101392: [AtCoder]ABC139 C - Lower

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $300$ points

Problem Statement

There are $N$ squares arranged in a row from left to right.

The height of the $i$-th square from the left is $H_i$.

You will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.

Find the maximum number of times you can move.

Constraints

  • All values in input are integers.
  • $1 \leq N \leq 10^5$
  • $1 \leq H_i \leq 10^9$

Input

Input is given from Standard Input in the following format:

$N$
$H_1$ $H_2$ $...$ $H_N$

Output

Print the maximum number of times you can move.


Sample Input 1

5
10 4 8 7 3

Sample Output 1

2

By landing on the third square from the left, you can move to the right twice.


Sample Input 2

7
4 4 5 6 6 5 5

Sample Output 2

3

By landing on the fourth square from the left, you can move to the right three times.


Sample Input 3

4
1 2 3 4

Sample Output 3

0

Input

题意翻译

从左到右连续排列 $N$ 个正方形。 第 $i$ 个正方形从左起的高度为 $H_i$。 您将降落在您选择的正方形上,然后重复移动到右侧的相邻正方形,只要下一个正方形的高度不大于当前正方形的高度即可。 找到您可以移动的最大次数。

加入题单

上一题 下一题 算法标签: