#include int ri() { int n; scanf("%d", &n); return n; } int main() { int n = ri(); int k = ri(); int a[n]; for (auto &i : a) i = ri(); int all[n - k + 1]; int cur = std::accumulate(a, a + k, 0); for (int i = 0; i <= n - k; i++) { all[i] = cur; cur -= a[i]; if (i + k < n) cur += a[i + k]; } std::sort(all, all + n - k + 1); int q = ri(); for (int i = 0; i < q; i++) { int x = ri(); printf("%d\n", (int) (std::upper_bound(all, all + n - k + 1, x) - all)); } return 0; }