#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void rd(T &...args) {
  ((cin >> args), ...);
}
template <typename... T>
void wr(T &...args) {
  ((cout << args << " "), ...);
}
int gcd(int a, int b);
void scan(int &x);
long long mult(long long a, long long b, long long mod);
long long binpow(long long a, long long b, long long mod);
int lcm(int a, int b);
long long _sum(vector<int> a);
template <typename T>
void swap(T &n1, T &n2) {
  T temp;
  temp = n1;
  n1 = n2;
  n2 = temp;
}
void Amritesh() {
  int m;
  cin >> m;
  int arr[2][m];
  int prefirst[m];
  int presecond[m];
  int sufffirst[m];
  int suffsecond[m];
  for (int(i) = (0); (i) < (2); (i)++) {
    for (int(j) = (0); (j) < (m); (j)++) {
      cin >> arr[i][j];
      if (i == 0) {
        prefirst[j] = arr[i][j];
        sufffirst[j] = arr[i][j];
      } else {
        presecond[j] = arr[i][j];
        suffsecond[j] = arr[i][j];
      }
    }
  }
  if (m == 1) {
    cout << "0"
         << "\n";
    return;
  }
  for (int(i) = (1); (i) < (m); (i)++) {
    prefirst[i] += prefirst[i - 1];
    presecond[i] += presecond[i - 1];
  }
  for (int(i) = m - 2; (i) >= (0); (i)--) {
    sufffirst[i] += sufffirst[i + 1];
    suffsecond[i] += suffsecond[i + 1];
  }
  int index = 0;
  long long curr = INT_MAX;
  for (int(i) = (0); (i) < (m); (i)++) {
    if (i == 0) {
      if (curr > sufffirst[i + 1]) {
        curr = sufffirst[i + 1];
      }
    } else if (i == m - 1) {
      if (curr > presecond[i - 1]) {
        curr = presecond[i - 1];
      }
    } else if (max(presecond[i - 1], sufffirst[i + 1]) < curr) {
      curr = max(presecond[i - 1], sufffirst[i + 1]);
    }
  }
  cout << curr << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    Amritesh();
  }
  return 0;
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
long long _sum(vector<int> a) { return accumulate(a.begin(), a.end(), 0ll); }
long long mult(long long a, long long b, long long mod) {
  return (a * b) % mod;
}
long long binpow(long long a, long long b, long long mod) {
  long long powans = 1;
  for (; b > 0; a = mult(a, a, mod), b /= 2)
    if (b % 2 == 1) powans = mult(powans, a, mod);
  return powans;
}
void scan(int &x) {
  bool neg = false;
  register int c;
  x = 0;
  c = getchar();
  if (c == '-') {
    neg = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) x = (x << 1) + (x << 3) + c - 48;
  if (neg) x *= -1;
}
