Xenny's is competing in a race and his car has X litres of fuel. There are N milestones in the competition. It takes no fuel at all to travel between gas stations, but at the \(i^{th}\) gas station, \(P_i\) amount of petrol is drained.
Find the number milestones Xenny crosses before his car gets out of fuel.
Input
The first line of input consists of 2 space-separated integers - N and X.
The second line contains N space-separated integers - \(P_i\)
Output
Print a single integer - the number of milestones Xenny crosses.
Constraints
\(1 \le N \le 100\)
\(1 \le X \le 10^9\)
\(1 \le P_i \le 10^9\)
Initial fuel = 7
After visiting the first station, the fuel left is 6 litres.
After visiting the second station, no fuel is left as all of it is drained out.
Hence, 2 stations are visited.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor