#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 200010;
int n, k, a[N], q, x, ans;
signed main() {
freopen("tioj_interactive.in", "r", stdin);
freopen("tioj_interactive.out", "w", stdout);
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
cin >> n >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i] += a[i-1];
}
if (k <= 0) ans = (n + 1) * n / 2;
cin >> q;
while (q--) {
cin >> x;
if (k > 0) {
ans = 0;
for (int i = 1; i <= n; i++) {
for (int j = i; j - i + 1 <= x; j++) {
for (int p = i; p <= j; p++) {
for (int l = p; l <= j; l++) {
if (a[l] - a[p-1] >= k) {
ans++;
p = n + 1;
break;
}
}
}
}
}
}
cout << ans << "\n";
}
return 0;
}