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: /*
      Rating: ---
      Date: 02-09-2021
      Time: 12:39
      Author: Kartik Papney
      Linkedin: https://www.linkedin.com/in/kartik-papney-4951161a6/
      Leetcode: https://leetcode.com/kartikpapney/
      Codechef: https://www.codechef.com/users/kartikpapney
  */
  
  import java.util.*;
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  
  
  public class Main {
      public static void solve() {
          int m = sc.nextInt();
          int[][] arr = new int[2][m];
          for(int i=0; i<arr.length; i++) {
              for(int j=0; j<arr[0].length; j++) {
                  arr[i][j] = sc.nextInt();
              }
          }
          if(m == 1) {
              p.writeln(0);
              return;
          }
          for(int i=1; i<arr[0].length; i++) {
              arr[1][i]+=arr[1][i-1];
          }
          for(int i=arr[0].length-2; i>=0; i--) {
              arr[0][i]+=arr[0][i+1];
          }
          int minv = Integer.MAX_VALUE;
          for(int i=0; i<arr[0].length; i++) {
              if(i == 0) {
                  minv = Math.min(minv, arr[0][i+1]);
              } else if(i == arr[0].length-1) {
                  minv = Math.min(minv, arr[1][i-1]);
              } else {
                  minv = Math.min(minv, Math.max(arr[0][i+1], arr[1][i-1]));
              }
          }
          p.writeln(minv);
      }
  
      public static void main(String[] args) {
          int t = 1;
           t = sc.nextInt();
          while (t-- != 0) {
              solve();
          }
          p.print();
      }
  
  
      static final Integer MOD = (int) 1e9 + 7;
      static final FastReader sc = new FastReader();
      static final Print p = new Print();
  
      static class Functions {
  
          static void sort(int[] a) {
              ArrayList<Integer> l = new ArrayList<>();
              for (int i : a) l.add(i);
              Collections.sort(l);
              for (int i = 0; i < a.length; i++) a[i] = l.get(i);
          }
  
          static void sort(long[] a) {
              ArrayList<Long> l = new ArrayList<>();
              for (long i : a) l.add(i);
              Collections.sort(l);
              for (int i = 0; i < a.length; i++) a[i] = l.get(i);
          }
  
          static int max(int[] a) {
              int max = Integer.MIN_VALUE;
              for (int val : a) max = Math.max(val, max);
              return max;
          }
  
          static int min(int[] a) {
              int min = Integer.MAX_VALUE;
              for (int val : a) min = Math.min(val, min);
              return min;
          }
  
          static long min(long[] a) {
              long min = Long.MAX_VALUE;
              for (long val : a) min = Math.min(val, min);
              return min;
          }
  
          static long max(long[] a) {
              long max = Long.MIN_VALUE;
              for (long val : a) max = Math.max(val, max);
              return max;
          }
  
          static long sum(long[] a) {
              long sum = 0;
              for (long val : a) sum += val;
              return sum;
          }
  
          static int sum(int[] a) {
              int sum = 0;
              for (int val : a) sum += val;
              return sum;
          }
  
          public static long mod_add(long a, long b) {
              return (a % MOD + b % MOD + MOD) % MOD;
          }
  
          public static long pow(long a, long b) {
              long res = 1;
              while (b > 0) {
                  if ((b & 1) != 0)
                      res = mod_mul(res, a);
                  a = mod_mul(a, a);
                  b >>= 1;
              }
              return res;
          }
  
          public static long mod_mul(long a, long b) {
              long res = 0;
              a %= MOD;
              while (b > 0) {
                  if ((b & 1) > 0) {
                      res = mod_add(res, a);
                  }
                  a = (2 * a) % MOD;
                  b >>= 1;
              }
              return res;
          }
  
          public static long gcd(long a, long b) {
              if (a == 0) return b;
              return gcd(b % a, a);
          }
  
          public static long factorial(long n) {
              long res = 1;
              for (int i = 1; i <= n; i++) {
                  res = (i % MOD * res % MOD) % MOD;
              }
              return res;
          }
  
          public static int count(int[] arr, int x) {
              int count = 0;
              for (int val : arr) if (val == x) count++;
              return count;
          }
  
          public static ArrayList<Integer> generatePrimes(int n) {
              boolean[] primes = new boolean[n];
              for (int i = 2; i < primes.length; i++) primes[i] = true;
              for (int i = 2; i < primes.length; i++) {
                  if (primes[i]) {
                      for (int j = i * i; j < primes.length; j += i) {
                          primes[j] = false;
                      }
                  }
              }
              ArrayList<Integer> arr = new ArrayList<>();
              for (int i = 0; i < primes.length; i++) {
                  if (primes[i]) arr.add(i);
              }
              return arr;
          }
      }
  
      static class Print {
          StringBuffer strb = new StringBuffer();
  
          public void write(Object str) {
              strb.append(str);
          }
  
          public void writes(Object str) {
              strb.append(str).append(" ");
          }
  
          public void writeln(Object str) {
              strb.append(str).append("\n");
          }
  
          public void writeln() {
              strb.append('\n');
          }
  
          public void writes(int[] arr) {
              for (int val : arr) {
                  write(val);
                  write(' ');
              }
          }
  
          public void writes(long[] arr) {
              for (long val : arr) {
                  write(val);
                  write(' ');
              }
          }
  
          public void writeln(int[] arr) {
              for (int val : arr) {
                  writeln(val);
              }
          }
  
          public void print() {
              System.out.print(strb);
          }
  
          public void println() {
              System.out.println(strb);
          }
      }
  
      static 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());
          }
  
          int[] readArray(int n) {
              int[] a = new int[n];
              for (int i = 0; i < n; i++) a[i] = nextInt();
              return a;
          }
  
          long[] readLongArray(int n) {
              long[] a = new long[n];
              for (int i = 0; i < n; i++) a[i] = nextLong();
              return a;
          }
  
          double[] readArrayDouble(int n) {
              double[] a = new double[n];
              for (int i = 0; i < n; i++) a[i] = nextInt();
              return a;
          }
  
          String nextLine() {
              String str = "";
              try {
                  str = br.readLine();
              } catch (IOException e) {
                  e.printStackTrace();
              }
              return str;
          }
      }
  }
  