#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
const long long mod = 1e9 + 7;
const long long inf = 1e18;
const double eps = 1e-7;
const long double pi = acos(-1);
const int N = 5e4 + 5, M = 3e5 + 5;
void test() {
  int n;
  cin >> n;
  long long x[2][n], pref[2][n + 1];
  pref[0][0] = pref[1][0] = 0;
  for (int i = 0; i <= 1; i++) {
    for (int j = 0; j <= n - 1; j++) {
      cin >> x[i][j];
      pref[i][j + 1] = pref[i][j] + x[i][j];
    }
  }
  long long ans = inf;
  for (int j = 0; j <= n - 1; j++) {
    ans = min(ans, max(pref[1][j], pref[0][n] - pref[0][j + 1]));
  }
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int cases = 1;
  cin >> cases;
  while (cases--) test();
  return 0;
}
