#include <limits.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main()
{
int c; cin >> c;
while(c--)
{
int n; cin >> n; n++;
vector<vector<int>> dp(n, vector<int>(n + 1));
for (int i = 1; i <= n - 1; i++)
cin >> dp[0][i];
for (int i = 1; i <= n - 1; i++)
cin >> dp[1][i];
for (int i = 2; i < n; i++)
{
dp[0][i] += max(dp[1][i - 1], dp[1][i - 2]);
dp[1][i] += max(dp[0][i - 1], dp[0][i - 2]);
}
cout << max(dp[0][n - 1], dp[1][n - 1]) << endl;
}
return 0;
}