#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<vector<long long int>> A(2, vector<long long int>(n, 0));
  auto P = A;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < n; j++) {
      cin >> A[i][j];
      P[i][j] = A[i][j];
      if (j > 0) {
        P[i][j] += P[i][j - 1];
      }
    }
  }
  bool winner = false;
  long long int score = 1e18;
  for (int j = 0; j < n; j++) {
    long long int a = A[0][j] + A[1][j];
    if (j > 0) {
      a += P[0][j - 1];
    }
    a += (P[1][n - 1] - P[1][j]);
    long long int top = P[0][n - 1] - P[0][j];
    long long int bottom = (P[0][n - 1] + P[1][n - 1]) - (a + top);
    long long int t = max(top, bottom);
    score = min(score, t);
  }
  cout << score << endl;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(nullptr);
  int test;
  cin >> test;
  while (test) {
    solve();
    test--;
  }
  return 0;
}
