#C1123. Counting Strictly Increasing Consecutive Subarrays

    ID: 40523 Type: Default 1000ms 256MiB

Counting Strictly Increasing Consecutive Subarrays

Counting Strictly Increasing Consecutive Subarrays

You are given an array of n integers. Your task is to find the number of consecutive subarrays (of length 1 or greater) which form a strictly increasing sequence.

A subarray is defined as a contiguous segment of the array. Only segments with length at least 2 are considered, and a segment is strictly increasing if for all valid indices i in the subarray, a[i] < a[i+1] holds.

The number of increasing subarrays in a contiguous strictly increasing block of length \( k \) can be computed using the formula: \( \frac{k \times (k-1)}{2} \).

It is required to read the input from stdin and output the result to stdout.

inputFormat

The first line contains an integer n representing the length of the array. The second line contains n space-separated integers representing the elements of the array.

outputFormat

Output a single integer representing the number of strictly increasing consecutive subarrays found in the array.

## sample
4
1 2 3 4
6

</p>