For array A[] of N integers we call a function fA=∑Ni=1i∗Ai
Given array of N integers and in one move you can select a position and delete the array element. Then all elements to the right are shifted to the left by 1 position. For example, given array is [5,9,15,25,15,9], if you delete A2 then the array will be [5,15,25,15,9] and then if you delete A2 the array will be [5,25,15,9].
Find the maximum value of fA of modified array by performing the above move any number of times (possibly 0).
Input format
Output format
For each test case, print the answer in a new line.
Constraints
1≤T≤10
1≤N≤103
−109≤Ai≤109