#include <bits/stdc++.h>
using namespace std;
int mina = 0x3f3f3f3f;
long long int MINI = 1e9 + 1;
const int N = 1e6 + 5;
int c1[N];
int c2[N];
int v[N];
int v2[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    for (long long int i = 1; i <= n; i++) cin >> v[i];
    for (long long int i = 1; i <= n; i++) cin >> v2[i];
    for (long long int i = 1; i <= n; i++) {
      c1[i] = v[i] + c1[i - 1];
    }
    for (long long int i = 1; i <= n; i++) {
      c2[i] = v2[i] + c2[i - 1];
    }
    long long int m = INT_MAX;
    for (long long int i = 1; i <= n; i++) {
      long long int alice = c1[i] + (c2[n] - c2[i - 1]);
      long long int b1 = c1[n] - c1[i];
      long long int b2 = c2[i - 1];
      long long int fbob = max(b1, b2);
      m = min(m, fbob);
    }
    cout << m << endl;
  }
  return 0;
}
