思维题好难emmm
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1E5 + 10;
ll arr[N];
ll brr[N];
ll now, res1, res2;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> now;
arr[i] = arr[i - 1] + now;
}
for (int i = 1; i <= n; i++)
{
cin >> now;
brr[i] = brr[i - 1] + now;
}
ll ans = LLONG_MAX;
for (int i = 1; i <= n; i++)
{
res1 = arr[n] - arr[i];
res2 = brr[i - 1];
ans = min(ans, max(res1, res2));
}
cout << ans << endl;
}
//system("pause");
return 0;
}