#K95842. Longest Continuous Rainfall Streak

    ID: 38953 Type: Default 1000ms 256MiB

Longest Continuous Rainfall Streak

Longest Continuous Rainfall Streak

You are given the number of days and the corresponding rainfall amount for each day. Your task is to find the longest streak of consecutive days during which the rainfall is positive (i.e. greater than 0).

Formally, given an integer \( n \) and an array \( a_1, a_2, \ldots, a_n \), determine the maximum integer \( k \) such that there exists an index \( i \) with \( 1 \le i \le n-k+1 \) where \( a_i, a_{i+1}, \ldots, a_{i+k-1} > 0 \) for all days in that interval.

inputFormat

The first line contains a single integer \( n \) representing the number of days. The second line contains \( n \) space-separated integers representing the rainfall amounts for each day.

outputFormat

Output a single integer which is the maximum number of consecutive days that had a positive amount of rainfall.

## sample
10
0 10 20 0 5 0 0 15 30 25
3