#include <stdio.h>
// Function to find the maximum possible sum of array D
int maxSum(int A[], int B[], int C[], int N) {
int maxSum = 0;
// Iterate through each index and select the maximum value from A, B, or C
for (int i = 0; i < N; i++) {
int currentSum = 0;
if (A[i] >= B[i] && A[i] >= C[i])
currentSum = A[i];
else if (B[i] >= A[i] && B[i] >= C[i])
currentSum = B[i];
else
currentSum = C[i];
// Add the selected value to maxSum
maxSum += currentSum;
}
return maxSum;
}
int main() {
int T;
scanf("%d", &T);
while (T--) {
int N;
scanf("%d", &N);
int A[N], B[N], C[N];
for (int i = 0; i < N; i++)
scanf("%d", &B[i]);
for (int i = 0; i < N; i++)
scanf("%d", &C[i]);
printf("%d\n", maxSum(A, B, C, N));
}
return 0;
}