#include <bits/stdc++.h>
using namespace std;
const int LNF = 2e9 + 10;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<vector<int>> a(2, vector<int>(n));
    for (long long int i = 0; i < 2; i++)
      for (long long int j = 0; j < n; j++) {
        cin >> a[i][j];
      }
    long long int ans = LNF;
    long long int sum1 = 0;
    long long int sum2 = 0;
    for (long long int i = 0; i < n; i++) {
      sum1 += a[0][i];
    }
    for (long long int j = 0; j < n; j++) {
      sum1 -= a[0][j];
      ans = min(ans, max(sum1, sum2));
      sum2 += a[1][j];
    }
    cout << ans << endl;
  }
}
