/** * @FileName a.cpp * @Author kanpurin * @Created 2020.06.26 00:21:15 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n,k;cin >> n >> k; vector a(n); vector s; int total = 0; for (int i = 0; i < n; i++) { cin >> a[i]; total += a[i]; if (i >= k-1) { s.push_back(total); total -= a[i-k+1]; } } sort(s.begin(), s.end()); int q;cin >> q; for (int i = 0; i < q; i++) { int x;cin >> x; cout << upper_bound(s.begin(), s.end(), x) - s.begin() << endl; } return 0; }