#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int N = 2e5+4;
void solve(int cs){
int n;cin>>n;
ll arr[5][n+5];
int s[n+5];
for(int i = 1; i <= 2; i++){
for(int j = 0; j <= n; j++)arr[i][j]=0;
//cout<<endl;
}
for(int i = 1; i <= 2; i++){
for(int j = 1; j <= n; j++){
cin>>arr[i][j];
if(i == 2)s[j] = arr[i][j];
}
}
/*for(int i = 1; i <= 2; i++){
for(int j = 1; j <= n; j++)cout<<arr[i][j]<<" ";
cout<<endl;
}*/
for(ll i = 1; i <= n; i++){
arr[1][i] = max(arr[1][i],-i) + arr[1][i-1];
}
for(ll i = 1; i < n; i++){
arr[2][i] = max(arr[2][i],-i) + arr[2][i-1];
}
arr[2][n] += arr[2][n-1];
/*for(int i = 1; i <= 2; i++){
for(int j = 1; j <= n; j++)cout<<arr[i][j]<<" ";
cout<<endl;
}*/
ll ans = -1e17;
for(int i = 1; i<= n; i++){
ans = max(ans, arr[1][i]+arr[2][n]-arr[2][i]+s[i]);
}
cout<<ans<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);
int t=1,cs=0;
cin >> t;
while(t--)
{
solve(++cs);
}
return 0;
}