#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int N = 5e5 + 5;
inline int read() {
  int x = 0, rev = 0, ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') rev = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return rev ? -x : x;
}
struct Cp {
  double x, y;
  Cp(double _x = 0, double _y = 0) { x = _x, y = _y; }
} A[N], B[N], Amn[N], Amx[N], Bmn[N], Bmx[N], V[N], Q1[N], Q2[N], E11[N],
    E12[N], E21[N], E22[N];
Cp operator+(Cp x, Cp y) {
  Cp z;
  z.x = x.x + y.x;
  z.y = x.y + y.y;
  return z;
}
Cp operator-(Cp x, Cp y) {
  Cp z;
  z.x = x.x - y.x;
  z.y = x.y - y.y;
  return z;
}
Cp operator*(Cp x, Cp y) {
  Cp z;
  z.x = x.x * y.x - x.y * y.y;
  z.y = x.y * y.x + x.x * y.y;
  return z;
}
struct _FFT {
  int all, k, M, r[N];
  void init() {
    for (M = 1; M <= all; M <<= 1, k++)
      ;
    for (int i = 1; i < M; i++) r[i] = (r[i >> 1] >> 1) | ((i & 1) << (k - 1));
  }
  void FFT(Cp *x, int f) {
    for (int i = 0; i < M; i++)
      if (r[i] > i) swap(x[r[i]], x[i]);
    for (int i = 1; i < M; i <<= 1) {
      Cp wn(cos(acos(-1.0) / i), f * sin(acos(-1.0) / i));
      for (int j = 0; j < M; j += i << 1) {
        Cp w = 1;
        for (int k = 0; k < i; k++, w = w * wn) {
          Cp a = x[j + k], b = w * x[j + k + i];
          x[j + k] = a + b, x[j + k + i] = a - b;
        }
      }
    }
    if (f == -1)
      for (int i = 0; i < M; i++) x[i].x /= M;
  }
} fft;
long long n, m, Q, a[N], b[N], heat[N], cold[N];
int main() {
  n = read(), m = read(), Q = read();
  for (int i = 1; i <= n; i++) a[i] = read(), fft.all = max(fft.all, (int)a[i]);
  for (int i = 1; i <= n; i++) A[a[i]].x += 1;
  for (int i = 1; i < n; i++) Amn[min(a[i], a[i + 1])].x += 1;
  for (int i = 1; i < n; i++) Amx[max(a[i], a[i + 1])].x += 1;
  for (int i = 1; i <= m; i++) b[i] = read(), fft.all = max(fft.all, (int)b[i]);
  for (int i = 1; i <= m; i++) B[b[i]].x += 1;
  for (int i = 1; i < m; i++) Bmn[min(b[i], b[i + 1])].x += 1;
  for (int i = 1; i < m; i++) Bmx[max(b[i], b[i + 1])].x += 1;
  fft.all <<= 1, fft.init();
  fft.FFT(A, 1), fft.FFT(Amn, 1), fft.FFT(Amx, 1);
  fft.FFT(B, 1), fft.FFT(Bmn, 1), fft.FFT(Bmx, 1);
  for (int i = 0; i < fft.M; i++) {
    Q1[i] = Amn[i] * Bmn[i];
    Q2[i] = Amx[i] * Bmx[i];
    E11[i] = Amn[i] * B[i];
    E12[i] = A[i] * Bmn[i];
    E21[i] = A[i] * Bmx[i];
    E22[i] = Amx[i] * B[i];
    V[i] = A[i] * B[i];
  }
  fft.FFT(Q1, -1), fft.FFT(Q2, -1);
  fft.FFT(E11, -1), fft.FFT(E12, -1);
  fft.FFT(E21, -1), fft.FFT(E22, -1);
  fft.FFT(V, -1);
  for (int i = 0; i < fft.M; i++) {
    heat[i] = (long long)(Q1[i].x + 0.5) + (long long)(V[i].x + 0.5) -
              (long long)(E11[i].x + 0.5) - (long long)(E12[i].x + 0.5);
    cold[i] = (long long)(Q2[i].x + 0.5) + (long long)(V[i].x + 0.5) -
              (long long)(E21[i].x + 0.5) - (long long)(E22[i].x + 0.5);
  }
  for (int i = N - 2; i >= 0; i--) heat[i] += heat[i + 1];
  for (int i = 1; i < N; i++) cold[i] += cold[i - 1];
  while (Q--) {
    int x = read();
    cout << heat[x] - cold[x - 1] << endl;
  }
  return 0;
}
