#K75337. Longest Increasing Sales Sequence
Longest Increasing Sales Sequence
Longest Increasing Sales Sequence
You are given the weekly sales figures for a company. Your task is to compute the length of the longest contiguous sequence of weeks during which the sales amounts strictly increase.
Formally, let the sales be represented as a sequence \( S = \{s_1, s_2, \dots, s_n\} \). A contiguous subsequence \( \{s_i, s_{i+1}, \dots, s_{i+k-1}\} \) is said to be strictly increasing if it satisfies the inequality:
\( s_{j} < s_{j+1} \quad \text{for every } j = i, i+1, \dots, i+k-2 \)
Your goal is to determine the maximum value of \( k \) among all such contiguous subsequences.
inputFormat
The input is given from the standard input and consists of two lines:
- The first line contains an integer \( n \) representing the number of weeks.
- The second line contains \( n \) space-separated integers \( s_1, s_2, \dots, s_n \) representing the sales figures.
You can assume that \( n \ge 1 \).
outputFormat
The output should be a single integer printed to the standard output, representing the length of the longest sequence of consecutive weeks during which the sales are strictly increasing.
## sample7
5 10 15 10 20 25 30
4