The
Our Mirko is nearing retirement. In his life he had published
I wonder, what would be my
-index had I only published papers through ?
Help him calculate the answers.
Input Specification
The first line contains integers
The second line contains
The following
Output Specification
Output
Constraints
Subtask | Points | Constraints |
---|---|---|
1 | 20 | |
2 | 40 | |
3 | 50 | No additional constraints. |
Sample Input 1
7 6
3 2 3 1 1 4 7
3 4
1 7
1 6
4 5
1 2
5 7
Sample Output 1
1
3
3
1
2
2
Comments