Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- signed main() {
- int n, m, c;
- cin >> n >> m >> c;
- int sum = 0, ans = n;
- for (int x, i = 1; i <= n; i++) {
- cin >> x;
- if (sum + x <= m * c) {
- sum += x;
- } else {
- ans = i;
- break;
- }
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement