Mumbai is famous for its heavy rains. In a particular locality the arrangement of towers is such:
There is a chain of towers with no spaces in between, all having the same cross section of 1 unit square. The height of these buildings is given to you in an array. Water gets collected between them during rains. People living there decide to collect and store this. Your job is to calculate the amount of water that gets collected between these towers.
First line contains T (number of test cases).
Each test case contains 1 line: size(N) and elements of the array.
For each test case print the amount of water collected, in a separate line.
5 1 5 3 7 2
Problem Setter: Shradha Chhaparia