Source Code
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

    int t;
    cin >> t;
    while (t--) {
        int n, ans = 0;
        cin >> n;
        int a[n];

        for (int &x : a)
            cin >> x;
        for (int i = 0; i < n; i++) {
            int b;
            cin >> b;
            ans = max(ans, b - a[i]);
        }
        cout << ans << '\n';
    }
}
Copy
Garden Walls ahmad_salah
GNU G++17
47 ms
956 KB
Accepted