description: Alice and Bob are playing a game on a matrix, consisting of 2 rows and m columns. The cell in the i-th row in the j-th column contains a_{i, j} coins in it.
  
  Initially, both Alice and Bob are standing in a cell (1, 1). They are going to perform a sequence of moves to reach a cell (2, m).
  
  The possible moves are: 
  
    * Move right — from some cell (x, y) to (x, y + 1); 
    * Move down — from some cell (x, y) to (x + 1, y). 
  
  
  
  First, Alice makes all her moves until she reaches (2, m). She collects the coins in all cells she visit (including the starting cell).
  
  When Alice finishes, Bob starts his journey. He also performs the moves to reach (2, m) and collects the coins in all cells that he visited, but Alice didn't.
  
  The score of the game is the total number of coins Bob collects.
  
  Alice wants to minimize the score. Bob wants to maximize the score. What will the score of the game be if both players play optimally?
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of testcases.
  
  Then the descriptions of t testcases follow.
  
  The first line of the testcase contains a single integer m (1 ≤ m ≤ 10^5) — the number of columns of the matrix.
  
  The i-th of the next 2 lines contain m integers a_{i,1}, a_{i,2}, ..., a_{i,m} (1 ≤ a_{i,j} ≤ 10^4) — the number of coins in the cell in the i-th row in the j-th column of the matrix.
  
  The sum of m over all testcases doesn't exceed 10^5.
  
  Output
  
  For each testcase print a single integer — the score of the game if both players play optimally.
  
  Example
  
  Input
  
  
  3
  3
  1 3 7
  3 5 1
  3
  1 3 9
  3 5 1
  1
  4
  7
  
  
  Output
  
  
  7
  8
  0
  
  Note
  
  The paths for the testcases are shown on the following pictures. Alice's path is depicted in red and Bob's path is depicted in blue.
  
  <image>
solution: /*
      COLLECTIONS FRAMEWORK TUTORIAL
  
      * HashMap
  
      .add(key, value)
      .get(key)
      .containsKey(key) : true/false
      .size()
  */
  
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  
  import java.util.*;
  
  public class Main {
  
      static final long M = 1000000007;
  
      // use main for only io
      public static void main(String args[]) {
          FastReader io = new FastReader();
          new Solver().solve(io);
      }
  }
  
  //class Pair{
  //    int key;String value;
  //
  //    public Pair(int key, String value){
  //        this.key = key;
  //        this.value = value;
  //    }
  //}
  
  class SparseTable{
      int dp[][] = new int[300005][20];
  
      int log[] = new int[300005];
  
      public SparseTable(long a[], int n){
          for(int i =0;i<n;i++)dp[i][0] = i;
  
          for(int i = 1;i < 20;i++){
              for(int j = 0;j + (1 << i) < n;j++){
                  if(a[dp[j][i-1]] < a[dp[j + (1 << (i-1))][i-1]]){
                      dp[j][i] = dp[j][i-1];
                  }
                  else{
                      dp[j][i] = dp[j + (1 << (i - 1))][i-1];
                  }
              }
          }
  
          log[1] = 0;
          for(int i = 2;i <= n;i++){
              log[i] = log[i/2] + 1;
          }
      }
  
      int getMin(int L, int R, long a[]){
          if(L > R)return 0;
          int j = log[R - L + 1];
          if(a[dp[L][j]] < a[dp[R - (1 << j) + 1][j]])return dp[L][j];
  
          return dp[R-(1 << j) + 1][j];
      }
  }
  
  
  
  class Solver {
      static final int M = 998244353;
  
  
  
      void solve(FastReader io) {
          int t = io.nextInt();
  
          while(t-- > 0){
              int n = io.nextInt();
  
              int a[][] = new int[2][n];
  
              for(int i = 0;i < 2;i++){
                  for(int j = 0;j < n;j++)a[i][j] = io.nextInt();
              }
  
              int pre[] = new int[n];
              int suf[] = new int[n];
  
              pre[0] = a[1][0];
              for(int i = 1;i < n;i++)pre[i] = pre[i - 1] + a[1][i];
  
              suf[n - 1] = a[0][n - 1];
              for(int i = n - 2;i >= 0;i--)suf[i] = suf[i + 1] + a[0][i];
  
              int ans = (int)1e9;
              for(int i = 0;i < n;i++){
                  int option1 = 0, option2 = 0;
                  if(i + 1 < n)option1 = suf[i + 1];
                  if(i - 1 >= 0)option2 = pre[i - 1];
  
                  ans = Math.min(Math.max(option1, option2), ans);
              }
  
              System.out.println(ans);
          }
  
      }
  
      // returns the first key greater than or equal to val
      int lower_bound(int a[], int val) {
          int low = 0, high = a.length - 1, ret = -1;
  
          while (low <= high) {
              int mid = (low + high) / 2;
  
              if (a[mid] < val) low = mid + 1;
              else {
                  ret = mid;
                  high = mid - 1;
              }
  
          }
  
          return ret;
      }
  
      // returns the first key strictly greater than val
      int upper_bound(int a[], int val) {
          int low = 0, high = a.length - 1, ret = -1;
  
          while (low <= high) {
              int mid = (low + high) / 2;
  
              if (a[mid] <= val) low = mid + 1;
              else {
                  ret = mid;
                  high = mid - 1;
              }
  
          }
  
          return ret;
      }
      long modexp(long n, int m) {
          if (m == 0)
              return 1;
          else if (m == 1)
              return n;
          else {
              long p = modexp(n, m / 2);
  
              if (m % 2 == 1)
                  return (((p * p) % M) * n) % M;
              else
                  return (p * p) % M;
          }
      }
  
      long exp(long n, long m) {
          if (m == 0)
              return 1;
          if (m == 1)
              return n;
  
          long p = exp(n, m / 2);
  
          if (m % 2 == 1)
              return p * p * n;
          else
              return p * p;
      }
  
      long gcd(long a, long b) {
          if (a == 0)
              return b;
  
          return gcd(b % a, a);
      }
  
      long inv(long n) {
          return modexp(n, M - 2);
      }
  
      long lcm(long a, long b) {
          return a * b / gcd(a, b);
      }
  
      long factorial(long fact[], int n) {
          fact[0] = 1;
          fact[1] = 1;
  
          long prod = 1;
  
          for (int i = 2; i <= n; i++) {
              prod = (prod * i) % M;
  
              fact[i] = prod;
          }
  
          return prod;
      }
  
      boolean isPrime(long n) {
          for (int i = 2; i * i <= n; i++) {
              if (n % i == 0)
                  return false;
          }
          return true;
      }
  }
  
  
  class FastReader {
      BufferedReader br;
      StringTokenizer st;
  
      public FastReader() {
          br = new BufferedReader(new
                  InputStreamReader(System.in));
      }
  
      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
  
      int nextInt() {
          return Integer.parseInt(next());
      }
  
      long nextLong() {
          return Long.parseLong(next());
      }
  
      double nextDouble() {
          return Double.parseDouble(next());
      }
  
      String nextLine() {
          String str = "";
          try {
              str = br.readLine();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return str;
      }
  }