#include #include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N, K, Q, i, x; cin >> N >> K; vector a(N); vector S(N - K + 1); for (i = 0; i != N; ++i) cin >> a[i]; S[0] = a[0]; for (i = 1; i != K; ++i) S[0] += a[i]; for (; i != N; ++i) S[i - K + 1] = S[i - K] - a[i - K] + a[i]; sort(S.begin(), S.end()); cin >> Q; for (i = 0; i != Q; ++i) { cin >> x; cout << upper_bound(S.begin(), S.end(), x) - S.begin() << '\n'; } return 0; }