Some Complex Formulas
You are given an integer and an array consisting of integers.
The subarray of the array beginning at and ending at is a segment of numbers . Let this subarray be nice if
That is, if the greatest common divisor of numbers equals their arithmetic mean.
Your task is to find the number of different pairs of integers such that subarray is nice. Also, you need to find the maximum length of a nice subarray of .
Input
The first line contains one integer — the number of elements in the array .
The second line contains integers — the elements of the array.
Output
In the only line, you need to output the number of nice subarrays of the array and the length of the longest such subarray.
Examples
Note
In the first example, there are subarrays in total: , , , , and .
Subarray is nice because .
Subarray is not nice because .
There are exactly 3 nice subarrays in this array: , , and all these subarrays have lengths of .
Scoring
( points): ;
( points): ;
( points): no additional constraints.