#P3594. [POI 2015 R3] 狼坑 Trous de loup
[POI 2015 R3] 狼坑 Trous de loup
Description
Given a sequence of length , you have one chance to choose a contiguous segment of length at most and change all numbers inside it to . Find the longest contiguous segment such that the sum of all numbers within this segment does not exceed .
Input Format
The first line contains three integers, .
The second line contains integers; the -th integer is , the -th number in the sequence.
Output Format
Output a single integer, the length of the longest valid segment after the modification.
9 7 2
3 4 1 9 4 1 7 1 3
5
Hint
Constraints
For of the testdata, , , .
Original title: Wilcze doły.
Translated by ChatGPT 5
京公网安备 11011102002149号