#include <bits/stdc++.h>
int MM[2] = {469762049, 595591169};
long long power(int a, int k, int md) {
  long long b = a, p = 1;
  while (k) {
    if (k & 1) p = p * b % md;
    b = b * b % md;
    k >>= 1;
  }
  return p;
}
int wu[2][18 + 1], wv[2][18 + 1], VV[2], V01;
void init() {
  int g, l, u, v;
  V01 = power(469762049, 595591169 - 2, 595591169);
  for (g = 0; g < 2; g++) {
    int md = MM[g];
    u = power(3, md - 1 >> 18, md), v = power(u, md - 2, md);
    VV[g] = power((1 << 18), md - 2, md);
    for (l = 18; l > 0; l--) {
      wu[g][l] = u, wv[g][l] = v;
      u = (long long)u * u % md, v = (long long)v * v % md;
    }
  }
}
void ntt(int *aa, int g, int inverse) {
  int md = MM[g], i, j, l, r;
  for (i = 0, j = 1; j < (1 << 18); j++) {
    int n, tmp;
    n = (1 << 18) >> 1;
    while ((i ^= n) < n) n >>= 1;
    if (i < j) tmp = aa[i], aa[i] = aa[j], aa[j] = tmp;
  }
  for (l = 1; l <= 18; l++) {
    int n = 1 << l, m = n >> 1;
    long long u = inverse ? wv[g][l] : wu[g][l], w = 1;
    for (r = 0; r < m; r++) {
      for (i = r; (j = i + m) < (1 << 18); i += n) {
        int a = aa[i], b = aa[j] * w % md;
        if ((aa[i] = a + b) >= md) aa[i] -= md;
        if ((aa[j] = a - b) < 0) aa[j] += md;
      }
      w = w * u % md;
    }
  }
}
long long garner(int r0, int r1) {
  r1 = (long long)(r1 - r0) * V01 % 595591169;
  if (r1 < 0) r1 += 595591169;
  return (long long)r1 * 469762049 + r0;
}
int main() {
  static long long ans[200000 + 1];
  static int aa[100000], bb[100000], aaa[2][(1 << 18)], bbb[2][(1 << 18)],
      cc[2][(1 << 18)];
  int n, m, q, g, i, j, x, y, z;
  init();
  scanf("%d%d%d", &n, &m, &q);
  for (i = 0; i < n; i++) scanf("%d", &aa[i]);
  for (j = 0; j < m; j++) scanf("%d", &bb[j]);
  if (n == 1 && m == 1)
    ans[aa[0] + bb[0]] = 1;
  else if (n == 1)
    ans[aa[0] + bb[0]]--, ans[aa[0] + bb[m - 1]]--;
  else if (m == 1)
    ans[aa[0] + bb[0]]--, ans[aa[n - 1] + bb[0]]--;
  else {
    x = bb[m - 1] >= bb[m - 2], y = bb[0] > bb[1];
    z = aa[0] > aa[1];
    if (z == y) ans[aa[0] + bb[0]]--;
    if (z == x) ans[aa[0] + bb[m - 1]]--;
    z = aa[n - 1] >= aa[n - 2];
    if (z == y) ans[aa[n - 1] + bb[0]]--;
    if (z == x) ans[aa[n - 1] + bb[m - 1]]--;
    z = aa[0] > aa[1];
    for (j = 1; j < m - 1; j++) {
      x = bb[j] >= bb[j - 1], y = bb[j] > bb[j + 1];
      ans[aa[0] + bb[j]] += (z ? -1 : 1) * (x != y ? 0 : (x ? 1 : -1));
    }
    z = aa[n - 1] >= aa[n - 2];
    for (j = 1; j < m - 1; j++) {
      x = bb[j] >= bb[j - 1], y = bb[j] > bb[j + 1];
      ans[aa[n - 1] + bb[j]] += (z ? -1 : 1) * (x != y ? 0 : (x ? 1 : -1));
    }
    z = bb[0] > bb[1];
    for (i = 1; i < n - 1; i++) {
      x = aa[i] >= aa[i - 1], y = aa[i] > aa[i + 1];
      ans[aa[i] + bb[0]] += (z ? -1 : 1) * (x != y ? 0 : (x ? 1 : -1));
    }
    z = bb[m - 1] >= bb[m - 2];
    for (i = 1; i < n - 1; i++) {
      x = aa[i] >= aa[i - 1], y = aa[i] > aa[i + 1];
      ans[aa[i] + bb[m - 1]] += (z ? -1 : 1) * (x != y ? 0 : (x ? 1 : -1));
    }
    for (i = 1; i < n - 1; i++) {
      x = aa[i] >= aa[i - 1], y = aa[i] > aa[i + 1];
      aaa[0][aa[i]] += x != y ? 0 : (x ? -1 : 1);
    }
    for (j = 1; j < m - 1; j++) {
      x = bb[j] >= bb[j - 1], y = bb[j] > bb[j + 1];
      bbb[0][bb[j]] += x != y ? 0 : (x ? -1 : 1);
    }
    memcpy(aaa[1], aaa[0], sizeof aaa[0]);
    memcpy(bbb[1], bbb[0], sizeof bbb[0]);
    for (g = 0; g < 2; g++) {
      for (i = 0; i < (1 << 18); i++) {
        if (aaa[g][i] < 0) aaa[g][i] += MM[g];
        if (bbb[g][i] < 0) bbb[g][i] += MM[g];
      }
      ntt(aaa[g], g, 0);
      ntt(bbb[g], g, 0);
    }
    for (g = 0; g < 2; g++) {
      int md = MM[g];
      for (i = 0; i < (1 << 18); i++)
        cc[g][i] = (long long)aaa[g][i] * bbb[g][i] % md * 2 % md;
    }
    for (g = 0; g < 2; g++) {
      int md = MM[g], v = VV[g];
      ntt(cc[g], g, 1);
      for (i = 0; i < (1 << 18); i++) cc[g][i] = (long long)cc[g][i] * v % md;
    }
    for (i = 0; i <= 200000; i++) {
      long long x = garner(cc[0][i], cc[1][i]);
      if (x > (long long)469762049 * 595591169 - x)
        x -= (long long)469762049 * 595591169;
      ans[i] -= x;
    }
  }
  ans[0]++;
  for (i = 1; i <= 200000; i++) ans[i] += ans[i - 1];
  while (q--) {
    int x;
    scanf("%d", &x);
    printf("%lld\n", ans[x - 1]);
  }
  return 0;
}
