Problem K
Beach
Maja has had enough of all the big seaside estates that occupy the coastline. Instead, she wants to create a long and beautiful beach that anyone can use. She is planning to buy a segment of plots along the coast to create the beach.
Maja has a budget of
Input
The first line contains the two integers
The second line contains
Output
Print one integer, the maximum number of adjacent plots Maja can afford to buy.
Constraints and Scoring
-
. -
. -
for each such that .
Your solution will be tested on a set of test groups, each worth a number of points. Each test group contains a set of test cases. To get the points for a test group you need to solve all test cases in the test group.
Group |
Score |
Limits |
|
|
|
|
|
|
|
|
No additional constraints |
Example
In the first example, Maja has enough money to buy all the plots.
In the second example, Maja can buy either the first three, or the last three plots.
In the third example, Maja can buy the plots with indices
Sample Input 1 | Sample Output 1 |
---|---|
3 14 4 7 3 |
3 |
Sample Input 2 | Sample Output 2 |
---|---|
4 36 11 5 7 14 |
3 |
Sample Input 3 | Sample Output 3 |
---|---|
9 18 1 5 3 4 6 2 1 2 4 |
6 |