Жишээ тэстүүд

Оролт
4
7 1 2 3
Гаралт
2
Оролт
2
2 1
Гаралт
1
Оролт
3
1 1 1
Гаралт
6

Тэмдэглэл

In the first sample the superior subarrays are (0, 1) and (3, 2).

Subarray (0, 1) is superior, as $a_{0} ≥ a_{0}, a_{0} ≥ a_{1}, a_{0} ≥ a_{2}, a_{0} ≥ a_{3}, a_{0} ≥ a_{0}, ...$

Subarray (3, 2) is superior $a_{3} ≥ a_{3}, a_{0} ≥ a_{0}, a_{3} ≥ a_{1}, a_{0} ≥ a_{2}, a_{3} ≥ a_{3}, ...$

In the third sample any pair of $(l, s)$ corresponds to a superior subarray as all the elements of an array are distinct.