#include using namespace std; int main() { int n; int64_t p; cin >> n >> p; for(int i = 1; i <= n; i++) { int64_t curr; cin >> curr; if((p+i-1)/i < curr) { cout << (i-1) << "\n"; return 0; } p -= curr; } cout << n << "\n"; }