Array A contains the elements, A 1 ,A 2 ...A N . And array B contains the elements, B 1 ,B 2 ...B N . There is a
relationship between A i and B i , ∀ 1 ≤ i ≤ N, i.e.,
any element Ai lies between 1 and Bi .
Let the cost S of an array A be defined as:
You have to print the largest possible value of S.
Input Format
The first line contains, T, the number of test cases. Each test case contains an integer, N, in first line. The
second line of each test case contains N integers that denote the array B.
Constraints
1 ≤ T ≤ 20
1 ≤ N ≤ 10 5
1 ≤ B i ≤ 100
Output Format
For each test case, print the required answer in one line(i.e. value of S).Answer for each test case should be on a new line.
The maximum value occurs when A1=A3=A5 =10 and A2 =A4 =1.