#include <bits/stdc++.h>
using namespace std;
int gi() {
  int res = 0, w = 1;
  char ch = getchar();
  while (ch != '-' && !isdigit(ch)) ch = getchar();
  if (ch == '-') w = -1, ch = getchar();
  while (isdigit(ch)) res = res * 10 + ch - '0', ch = getchar();
  return res * w;
}
const double PI = acos(-1.0);
const int MAX_N = 1 << 19 | 10;
struct comp {
  double x, y;
} omg[MAX_N];
comp operator+(const comp &l, const comp &r) {
  return (comp){l.x + r.x, l.y + r.y};
}
comp operator-(const comp &l, const comp &r) {
  return (comp){l.x - r.x, l.y - r.y};
}
comp operator*(const comp &l, const comp &r) {
  return (comp){l.x * r.x - l.y * r.y, l.x * r.y + l.y * r.x};
}
int Limit, rev[MAX_N];
void FFT_prepare(int len) {
  int p = 0;
  for (Limit = 1; Limit <= len; Limit <<= 1) ++p;
  for (int i = 0; i < Limit; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (p - 1));
  static int L = 1;
  for (int &i = L; i < Limit; i <<= 1) {
    omg[i] = (comp){1, 0};
    comp w = (comp){cos(PI / i), sin(PI / i)};
    for (int j = 1; j < i; j++) omg[i + j] = omg[i + j - 1] * w;
  }
}
void FFT(vector<comp> &p, int op) {
  p.resize(Limit);
  for (int i = 0; i < Limit; i++)
    if (i < rev[i]) swap(p[i], p[rev[i]]);
  for (int i = 1; i < Limit; i <<= 1)
    for (int j = 0; j < Limit; j += i << 1) {
      for (int k = 0; k < i; k++) {
        comp x = p[j + k], y = omg[i + k] * p[i + j + k];
        p[j + k] = x + y, p[i + j + k] = x - y;
      }
    }
  if (op != 1) {
    reverse(p.begin() + 1, p.end());
    for (int i = 0; i < Limit; i++) p[i].x = p[i].x / (double)Limit + 0.5;
  }
}
int N, M, n, m, Q, a[MAX_N], b[MAX_N];
long long Vb[MAX_N], Vw[MAX_N], Eb[MAX_N], Ew[MAX_N], Sb[MAX_N], Sw[MAX_N];
int main() {
  N = gi(), M = gi(), Q = gi();
  for (int i = 1; i <= N; i++) a[i] = gi(), n = max(n, a[i]);
  for (int i = 1; i <= M; i++) b[i] = gi(), m = max(m, b[i]);
  vector<comp> A(n + 1), B(m + 1), C(n + 1), D(m + 1), E(n + 1), F(m + 1);
  for (int i = 1; i <= N; i++) A[a[i]].x += 1;
  for (int i = 1; i <= M; i++) B[b[i]].x += 1;
  for (int i = 1; i < N; i++) C[min(a[i], a[i + 1])].x += 1;
  for (int i = 1; i < M; i++) D[min(b[i], b[i + 1])].x += 1;
  for (int i = 1; i < N; i++) E[max(a[i], a[i + 1])].x += 1;
  for (int i = 1; i < M; i++) F[max(b[i], b[i + 1])].x += 1;
  FFT_prepare(2 + max(n, m) * 2);
  FFT(A, 1), FFT(B, 1), FFT(C, 1), FFT(D, 1), FFT(E, 1), FFT(F, 1);
  vector<comp> a(Limit), b(Limit), c(Limit), d(Limit), e(Limit), f(Limit),
      g(Limit);
  for (int i = 0; i < Limit; i++) a[i] = A[i] * B[i];
  for (int i = 0; i < Limit; i++) b[i] = A[i] * D[i], c[i] = B[i] * C[i];
  for (int i = 0; i < Limit; i++) d[i] = A[i] * F[i], e[i] = B[i] * E[i];
  for (int i = 0; i < Limit; i++) f[i] = C[i] * D[i], g[i] = E[i] * F[i];
  FFT(a, 0), FFT(b, 0), FFT(c, 0), FFT(d, 0), FFT(e, 0), FFT(f, 0), FFT(g, 0);
  N = 2e5;
  for (int i = 0; i < Limit; i++) Vb[i] = Vw[i] = (long long)a[i].x;
  for (int i = 0; i < Limit; i++) Eb[i] = (long long)b[i].x + (long long)c[i].x;
  for (int i = 0; i < Limit; i++) Ew[i] = (long long)d[i].x + (long long)e[i].x;
  for (int i = 0; i < Limit; i++) Sb[i] = (long long)f[i].x;
  for (int i = 0; i < Limit; i++) Sw[i] = (long long)g[i].x;
  for (int i = N; i >= 0; i--)
    Vb[i] += Vb[i + 1], Eb[i] += Eb[i + 1], Sb[i] += Sb[i + 1];
  for (int i = 1; i <= N; i++)
    Vw[i] += Vw[i - 1], Ew[i] += Ew[i - 1], Sw[i] += Sw[i - 1];
  while (Q--) {
    int x = gi();
    printf("%lld\n",
           (Vb[x] - Eb[x] + Sb[x]) - (Vw[x - 1] - Ew[x - 1] + Sw[x - 1]));
  }
  return 0;
}
