#include <bits/stdc++.h>

using namespace std;

#define MAXN 100000 + 5

long long a[MAXN], b[MAXN], c[MAXN], h[MAXN], g[MAXN], s[MAXN];
int n, m, T;

long long Solve(int l, int r) {
  s[l - 1] = 0;
  for (int i = l; i <= r; ++i) {
    s[i] = s[i - 1] + g[i];
  }
  long long opt = h[l] - s[l], ret = 0;
  for (int i = l + 1; i <= r; ++i) {
    ret = max(ret, s[i - 1] + c[i] + 1 + opt);
    opt = max(opt, h[i] - s[i]);
  }
  return ret;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> T;
  for (int t = 0; t < T; ++t) {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> c[i];
    }
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
    }
    for (int i = 1; i <= n; ++i) {
      cin >> b[i];
    }
    h[n] = c[n] - 1, g[n] = 0;
    for (int i = 2; i <= n; ++i) {
      h[i - 1] = abs(a[i] - b[i]);
    }
    for (int i = 1; i <= n; ++i) {
      g[i] = c[i] - 1 - h[i] + 2;
    }

    int ptr = 1;
    long long ans = 0, tmp;
    for (int i = 2; i <= n; ++i) {
      if (a[i] == -1 || b[i] == -1) {
        tmp = Solve(ptr, i - 1);
        ans = max(ans, tmp);
        ptr = i;
      } else if (a[i] == b[i]) {
        tmp = Solve(ptr, i - 1);
        ans = max(ans, tmp);
        ptr = i - 1;
        h[ptr] = g[ptr] = c[ptr] = 0;
      }
    }
    if (ptr != n) {
      tmp = Solve(ptr, n);
      ans = max(ans, tmp);
    }
    cout << ans << endl;
  }
  return 0;
}
