#ifndef LOCAL #include using namespace std; #define debug(...) (void(0)) #else #include "algo/debug.h" #endif void solve() { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) cin >> A[i]; int ans = -1; for (int i = 0; i + 1 < N; i++) ans = max(ans, A[i] - A[i + 1]); cout << ans + 1 << endl; } int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int tt = 1; std::cin >> tt; while (tt--) { solve(); } }