#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using st = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using vb = vector<bool>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<db>;
using vs = vector<st>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
const int mod = 1e9 + 7;
template <typename T>
ostream& operator<<(ostream& out, const pair<T, T>& p) {
  out << "{" << p.first << "," << p.second << "}";
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  for (const auto& x : v) out << x << " ";
  return out;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    int m;
    cin >> m;
    vector<vi> a(2, vi(m));
    for (int i = (0); i < (m); i++) cin >> a[0][i];
    for (int i = (0); i < (m); i++) cin >> a[1][i];
    vector<vi> ps(2, vi(m));
    ps[0][0] = a[0][0];
    ps[1][0] = a[1][0];
    for (int i = (1); i < (m); i++) ps[0][i] = ps[0][i - 1] + a[0][i];
    for (int i = (1); i < (m); i++) ps[1][i] = ps[1][i - 1] + a[1][i];
    int ans = INT_MAX;
    for (int i = (0); i < (m); i++) {
      int down = (i > 0) ? ps[1][i - 1] : 0;
      int up = ps[0][m - 1] - ps[0][i];
      int bob = max(down, up);
      ans = min(ans, bob);
    }
    cout << ans << "\n";
  }
  return 0;
}
