#include <bits/stdc++.h>
using namespace std;
void fft(vector<complex<double>>& a) {
  int n = (int)(a).size(), L = 31 - __builtin_clz(n);
  static vector<complex<long double>> R(2, 1);
  static vector<complex<double>> rt(2, 1);
  for (static int k = 2; k < n; k *= 2) {
    R.resize(n);
    rt.resize(n);
    auto x = polar(1.0L, acos(-1.0L) / k);
    for (int i = k; i < (2 * k); ++i)
      rt[i] = R[i] = i & 1 ? R[i / 2] * x : R[i / 2];
  }
  vector<int> rev(n);
  for (int i = 0; i < (n); ++i) rev[i] = (rev[i / 2] | (i & 1) << L) / 2;
  for (int i = 0; i < (n); ++i)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int k = 1; k < n; k *= 2)
    for (int i = 0; i < n; i += 2 * k)
      for (int j = 0; j < (k); ++j) {
        auto x = (double*)&rt[j + k], y = (double*)&a[i + j + k];
        complex<double> z(x[0] * y[0] - x[1] * y[1], x[0] * y[1] + x[1] * y[0]);
        a[i + j + k] = a[i + j] - z;
        a[i + j] += z;
      }
}
vector<double> conv(const vector<double>& a, const vector<double>& b) {
  if (a.empty() || b.empty()) return {};
  vector<double> res((int)(a).size() + (int)(b).size() - 1);
  int L = 32 - __builtin_clz((int)(res).size()), n = 1 << L;
  vector<complex<double>> in(n), out(n);
  copy(a.begin(), a.end(), begin(in));
  for (int i = 0; i < ((int)(b).size()); ++i) in[i].imag(b[i]);
  fft(in);
  for (complex<double>& x : in) x *= x;
  for (int i = 0; i < (n); ++i) out[i] = in[-i & (n - 1)] - conj(in[i]);
  fft(out);
  for (int i = 0; i < ((int)(res).size()); ++i) res[i] = imag(out[i]) / (4 * n);
  return res;
}
long long rd(double x) {
  if (x > 0) return (x + 0.5);
  return (x - 0.5);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  int n, m, Q;
  cin >> n >> m >> Q;
  const int M = int(1e5) + 2;
  vector<int> a(n), b(m);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  vector<long long> all_score(2 * M, 0);
  for (int q = 0; q < 2; q++) {
    vector<int> ac = a, bc = b;
    ac.insert(ac.begin(), q * M);
    ac.insert(ac.end(), q * M);
    bc.insert(bc.begin(), q * M);
    bc.insert(bc.end(), q * M);
    vector<double> freq_a(M, 0), freq_b(M, 0);
    for (int i = 1; i + 1 < (int)ac.size(); i++) {
      if (ac[i - 1] < ac[i] && ac[i] >= ac[i + 1]) freq_a[ac[i]] += 1;
      if (ac[i - 1] >= ac[i] && ac[i] < ac[i + 1]) freq_a[ac[i]] -= 1;
    }
    for (int i = 1; i + 1 < (int)bc.size(); i++) {
      if (bc[i - 1] < bc[i] && bc[i] >= bc[i + 1]) freq_b[bc[i]] += 1;
      if (bc[i - 1] >= bc[i] && bc[i] < bc[i + 1]) freq_b[bc[i]] -= 1;
    }
    vector<double> score = conv(freq_a, freq_b);
    for (int i = 0; i < (int)score.size(); i++) all_score[i] += rd(score[i]);
  }
  all_score[0] -= 1;
  for (int j = 1; j < 2 * M; j++) all_score[j] += all_score[j - 1];
  for (int _ = 0; _ < Q; _++) {
    int x;
    cin >> x;
    cout << -all_score[x - 1] << '\n';
  }
}
