#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long m;
  long long s1 = 0, s2 = 0;
  cin >> m;
  long long a[m], b[m];
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    s1 += a[i];
  }
  for (long long i = 0; i < m; i++) {
    cin >> b[i];
    s2 += b[i];
  }
  vector<long long> v;
  for (long long i = 1; i < m; i++) a[i] = a[i - 1] + a[i];
  for (int j = m - 2; j >= 0; j--) {
    b[j] = b[j] + b[j + 1];
  }
  for (long long i = 0; i < m; i++) {
    long long c = s1 - a[i];
    long long d = s2 - b[i];
    v.push_back(max(c, d));
  }
  sort(v.begin(), v.end());
  cout << v[0] << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
