#P5972. [PA 2019] Desant
[PA 2019] Desant
Description
Given a permutation of to , it has non-empty subsequences.
For each , find a subsequence of length such that the number of inversions in this subsequence is minimal, and output the number of subsequences whose inversion count is minimal.
Input Format
The first line contains a positive integer .
The second line contains positive integers .
Output Format
Output lines, each containing two integers. On the -th line, output the minimum number of inversions among subsequences of length , and the number of subsequences that achieve this minimum.
5
5 3 1 4 2
0 5
0 3
1 2
3 1
7 1
Hint
For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号