#include <iostream> #include <string> #include <vector> #include <algorithm> #include <deque> #include <stack> #include <queue> #include <cmath> #include <set> #include <map> #include <unordered_set> #include <unordered_map> using namespace std; int main() { int n, t, c;//罪犯数量 罪行值之和 入狱时间连续 while (cin >> n >> t >> c) { vector<int> num(n); for (int i = 0; i < n; i++) { cin >> num[i]; } int count = 0; for (int i = 0; i < n - c + 1; i++) { int sum = 0; for (int j = i; j < i + c; j++) { sum = sum + num[j]; } if (sum <= t) { count++; } } cout << count << endl; } }