Problem Statement
A mountain hiker is descending from the mountain ranges. There are many mountains along his way each with it's own height. He will descend from
  mountain only if the mountains' height ahead of him are Non Increasing.

 You are given the height of the mountains ahead of you. Your task is to determine the minimum amount of height you have to reduce from the mountains
  ahead of the hiker in order to complete his expedition.


Input
Input description.

The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows
The first line of each test case contains a single integer N denoting the number of mountains ahead of him.
   The second line contains N space-separated integers A1, A2, ..., AN denoting the height of the mountains. 

 

Output
Output description.

For each test case, output a single line containing the answer.

 

Constraints

1 ≤ T ≤  100
1 ≤ N ≤  10^7
1 ≤ Ai ≤  10^7

 

Example
Input:
1
5
3 2 4 1 2

Output:
3
import sys 

T = int(raw_input())

while T > 0:
    N = int(raw_input())
    ans = 0
    prev = None
    #l = map(int, raw_input().split())
    l = list(map(int,sys.stdin.readline().split()))
 
    for i in range(N):
        curr = l[i]
        if i>0 and curr>prev:
            ans += curr-prev
            curr = prev 
        prev = curr
    print ans
            
    T -= 1