Submit solution
Points:
10 (partial)
Time limit:
3.0s
Memory limit:
64M
PyPy 3
150M
Authors:
Problem type
It's Halloween again! Little Trehalose. There are houses numbered to . Each house has a Trehalose tolerance of . Output the largest range of houses can spook in a consecutive row.
goes scaring people in his neighbourhood. Each neighbour he visits has a certain amount of Trehalose (noise tolerance). Some neighbours are easily scared and some are quite fearless! This is very sad for whose voice can only screamInput Specification
The first line contains an integer , the number of houses followed by , the amount of Trehalose can scream.
The next lines will contain the integer the neighbour's Trehalose tolerance.
Output Specification
On one line, print the integers and denoting the range of the most consecutive houses Sankeeth can scare (inclusive).
If there is more than one solution, output the first occurrence.
Constraints
For all subtasks:
Subtask 1 [10%]
Subtask 2 [20%]
Subtask 3 [70%]
No further constraints.
Sample Input
5 1000
700
300
200
10
850
Sample Output
2 4
Sample Explanation
Starting at house 2 ending at house 4, Sankeeth screams at 3 neighbours using 300 + 200 + 10 trehalose.
Comments