#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int t;
  cin >> t;
  while (t--) {
    int m;
    cin >> m;
    vector<vector<int>> mat(2, vector<int>(m));
    vector<vector<long long>> dp(2, vector<long long>(m, 0));
    long long mn = 1e11;
    for (int i = 0; i < 2; i++) {
      cin >> mat[i][0];
      dp[i][0] += mat[i][0];
      for (int j = 1; j < m; j++) {
        cin >> mat[i][j];
        dp[i][j] += mat[i][j] + dp[i][j - 1];
      }
    }
    m--;
    mn = min(dp[0][m] - dp[0][0], dp[1][m] - mat[1][m]);
    for (int i = 1; i < m; i++) {
      mn = min(mn, max(dp[0][m] - dp[0][i], dp[1][i - 1]));
    }
    cout << mn << "\n";
  }
  return 0;
}
