#include <bits/stdc++.h>
using namespace std;
long long le = 1, l = 0, rs[400010];
double p = acos(-1.0);
long long n, m, q, mn = 1e5;
long long A[500009], B[500009], b1[500009], b2[500009], b3[500009], b4[500009],
    b5[500009], b6[500009];
struct node {
  double a, k;
  node(double b = 0, double c = 0) {
    a = b;
    k = c;
  }
} x[400009], y[400009], h1[400009], h2[400009], h3[400009], h4[400009],
    a1[400009], a2[400009], a3[400009], a4[400009], a5[400009], a6[400009],
    a7[400009];
node operator*(node b, node c) {
  return node(b.a * c.a - b.k * c.k, b.a * c.k + b.k * c.a);
}
node operator+(node b, node c) { return node(b.a + c.a, b.k + c.k); }
node operator-(node b, node c) { return node(b.a - c.a, b.k - c.k); }
void fft(node *ans, long long flg) {
  for (long long i = 0; i < le; i++) {
    if (i < rs[i]) swap(ans[i], ans[rs[i]]);
  }
  for (long long i = 1; i < le; i <<= 1) {
    node d(cos(p / i), flg * sin(p / i));
    for (long long j = 0; j < le; j += (i << 1)) {
      node e(1, 0);
      for (long long k = 0; k < i; k++, e = e * d) {
        node f = ans[j + k], g = e * ans[j + k + i];
        ans[j + k] = f + g;
        ans[i + j + k] = f - g;
      }
    }
  }
  if (flg != 1) {
    for (long long i = 0; i < le; i++) {
      ans[i].a = (ans[i].a / (1.0 * le) + 0.5);
    }
  }
  return;
}
inline long long read() {
  long long sum = 0, fh = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') fh = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    sum *= 10;
    sum += c - '0';
    c = getchar();
  }
  return sum * fh;
}
void build(long long x) {
  for (le = 1, l = 0; le <= x; le <<= 1, l++) {
  }
  for (long long i = 0; i < le; i++) {
    rs[i] = rs[i >> 1] >> 1;
    rs[i] |= ((i & 1) << (l - 1));
  }
  return;
}
void work(node *as, node *bs, node *cs) {
  for (long long i = 0; i < le; i++) {
    as[i] = bs[i] * cs[i];
  }
  fft(as, -1);
  return;
}
int main() {
  n = read(), m = read(), q = read();
  for (long long i = 1; i <= n; i++) {
    A[i] = read();
    x[A[i]].a++;
    mn = max(mn, A[i]);
  }
  for (long long i = 1; i <= m; i++) {
    B[i] = read();
    y[B[i]].a++;
    mn = max(mn, B[i]);
  }
  for (long long i = 2; i <= n; i++) {
    h1[min(A[i], A[i - 1])].a++;
    h2[max(A[i], A[i - 1])].a++;
  }
  for (long long i = 2; i <= m; i++) {
    h3[min(B[i], B[i - 1])].a++;
    h4[max(B[i], B[i - 1])].a++;
  }
  build(mn * 2 + 3);
  fft(x, 1);
  fft(y, 1);
  fft(h1, 1);
  fft(h2, 1);
  fft(h3, 1);
  fft(h4, 1);
  work(a1, x, y);
  work(a2, x, h3);
  work(a3, y, h1);
  work(a4, x, h4);
  work(a5, y, h2);
  work(a6, h1, h3);
  work(a7, h2, h4);
  for (long long i = 0; i <= le; i++) {
    b1[i] = (long long)(a1[i].a);
    b2[i] = (long long)(a1[i].a);
    b3[i] = (long long)(a2[i].a) + (long long)(a3[i].a);
    b4[i] = (long long)(a4[i].a) + (long long)(a5[i].a);
    b5[i] = (long long)(a6[i].a);
    b6[i] = (long long)(a7[i].a);
  }
  for (long long i = le; i >= 1; i--) {
    b1[i - 1] += b1[i];
    b3[i - 1] += b3[i];
    b5[i - 1] += b5[i];
  }
  for (long long i = 1; i <= le; i++) {
    b2[i] += b2[i - 1];
    b4[i] += b4[i - 1];
    b6[i] += b6[i - 1];
  }
  while (q--) {
    long long x = read();
    long long ans = b1[x] - b2[x - 1] + b5[x] - b6[x - 1] - b3[x] + b4[x - 1];
    cout << ans << endl;
  }
  return 0;
}
