Nissy likes Arithmetic Progression. He sees an array of integers of length . He wants to find all values of satisfying these conditions:
occurs in the array
Consider the positions/indices of occurrence of number in the array and on sorting these positions/indices in the ascending order, they must form an arithmetic progression.
But Nissy can’t find them all on his own. He needs your help in finding them.
Input Format:
First Line: An integer
The next line contains integers separated by spaces.
Output Format:
In the first line print an integer = the total number of valid .
On each of the next lines print two space-separated integers and , where is the value and is the common difference between the positions/indices of occurrences in the progression(if occurs exactly once in the sequence, must equal 0). Print the pairs in the order of increasing .
Constraints: