You are given an integer and an array a_1, a_2, \dots, a_n consisting of integers.
The subarray of the array beginning at and ending at is a segment of numbers a_i, a_{i+1}, \dots, a_j. Let this subarray be nice if
That is, if the greatest common divisor of numbers a_i, a_{i+1}, \dots, a_j equals their arithmetic mean.
Your task is to find the number of different pairs of integers (1 \le i \le j \le n) such that subarray a_i, a_{i+1}, \dots, a_j is nice. Also, you need to find the maximum length of a nice subarray of .
The first line contains one integer (1 \le n \le 10^5) — the number of elements in the array .
The second line contains integers a_1, a_2, \dots, a_n (1 \le a_i \le 10^9) — the elements of the array.
In the only line, you need to output the number of nice subarrays of the array and the length of the longest such subarray.
Example 1
Example 2
Example 3
In the first example, there are subarrays in total: , , , , and .
Subarray is nice because GCD(a_1) = a_1 = \frac{a_1}{1}.
Subarray is not nice because GCD(a_2,a_3) = GCD(3,2) = 1 \neq \frac{a_2+a_3}{2} = \frac{3+2}{2} = 2.5.
There are exactly 3 nice subarrays in this array: , , and all these subarrays have lengths of .
( points): n \le 200;
( points): n \le 2\,000;
( points): no additional constraints.