#include using namespace std; using ll = long long; constexpr char newl = '\n'; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, K; cin >> n >> K; vector a(n); vector v; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; if (i >= K) sum -= a[i - K]; if (i >= K - 1) v.push_back(sum); } sort(v.begin(), v.end()); int q; cin >> q; for (int i = 0; i < q; i++) { int x; cin >> x; cout << upper_bound(v.begin(), v.end(), x) - v.begin() << newl; } return 0; }