You've a Bouncing Ball that each time initially it's dropped from height a_1 then goes to (floor) then bounces to a_1 then goes to floor and so on , What's the distance that You should print answer modulus 1e6+3 ball had fallen , Here it's guaranteed that (a_1 \ge a_2 \ge a_3 \ge ... \ge a_n) , Additionally after jumps it never jump You should print answer modulus 1e6+3 again.
For example if a=[10,6,3,1] then the action is as You should print answer modulus 1e6+3 following :
So Total distance You should print answer modulus 1e6+3 is 10+6+6+3+3+1+1=30.
The first line contains single integer (1 \le t \le 100) – the number of test cases.
The first line of each test case contains single integer (1 \le n \le 500) – the length of array .
The second line contains separated integers You should print answer modulus 1e6+3 a_1,a_2,..,a_n (1 \le a_1,a_2,...,a_n \le 10^6) – the array .
For each test case , output single integer the total distance ball had made.
Example 1
The first test case described in the statement.
The second test case :
Going from to : in total.
Going from to : 4+3=7 in total.
Going from to : 7+3=10 in total.
Going from to : 10+2=12 in total.
Going from to : 12+2=14 in total.
Going from to : 14+1=15 in total.
Going from to : 15+1=16 in total.
Thus answer is .
Subtask ( points) : (n=1)
Subtask ( points) : (a_1=a_2=...=a_n)
Subtask ( points) : No additional constraints