Problem #299
Merge it!!!
You are given an array of integers of length 1000, the array is given by the following recurrence relation: a[i]={a[i-1]^{a[i-1]}} mod (100003) and a[0]=2. You can perform the following operation on it:
In one operation you can select any two adjacent elements X and Y , remove both of them and place element X+Y in their old position. After performing this operation you score increments by X+Y .
Eg: if you combine 4 and 8 , score will increase by 12. Find the expected value of the final score after performing the operation 999 times. Report the integer part of your answer.