#include #include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int32_t T, i, j; cin >> T; vector N(T); vector> A(T, vector()); for (i = 0; i != T; ++i) { cin >> N[i]; A[i].resize(N[i]); for (j = 0; j != N[i]; ++j) cin >> A[i][j]; } for (i = 0; i != T; ++i) { auto l = -1, r = 1'000'000'001; while (l + 1 < r) { const auto c = (l + r) / 2; for (j = 1; j != N[i]; ++j) if (A[i][j - 1] + static_cast(j) * c >= A[i][j] + static_cast(j + 1) * c) break; if (j == N[i]) r = c; else l = c; } cout << r << '\n'; } return 0; }