Given a sequence of integers, where each element is distinct and satisfies . For each where , that is increments from to , find any integer such that and keep a history of the values of in a return array.
Each value of between and , the length of the sequence, is analyzed as follows:
The values for are .
Complete the permutationEquation function in the editor below.
permutationEquation has the following parameter(s):
int p[n]: an array of integers
int[n]: the values of for all in the arithmetic sequence to
The first line contains an integer , the number of elements in the sequence.
The second line contains space-separated integers where .
, where .
Each element in the sequence is distinct.
Sample Input 0
32 3 1
Sample Output 0
Given the values of , , and , we calculate and print the following values for each from to :