Олимпиадный тренинг

Задача 38193. Thaw


Задача

Темы: Цикл for
Tired of an unusually warm winter, Muscovites decided to find out if this is indeed the longest thaw on record. They turned to weather forecasters, who, in turn, began to study the statistics for the past years. They are interested in how many days the longest thaw lasted.

They call a thaw a period in which the average daily temperature exceeds 0 degrees Celsius every day. Write a program to help weather forecasters in their work.

Input
First enter the number N – the total number of days considered (1 ≤ N ≤ 100). The next line contains N integers separated by spaces. Each number – average daily temperature on the corresponding day. Temperatures – integers belonging to the range from –50 to 50.

Imprint
It is required to display one number – the length of the longest thaw, that is, the largest number of consecutive days during which the average daily temperature exceeded 0 degrees. If the temperature on each day was non-positive, print 0.
Examples
# Input Output Explanation
1 6
-20 30 -40 50 10 -10
2 We are considering 6 days. The longest thaw was on the 4th and 5th days (50 and 10 degrees respectively)
2 8
10 20 30 1 -10 1 2 3
4 The longest thaw was in the first 4 days
3 5
-10 0 -10 0 -10
0 There were no days with a positive temperature