There are times when money is needed. For this purpose, he tries to convince his father…
- User
There are times when money is needed. For this purpose, he tries to convince his father to give him a sack of money. His father, who is worried about Zoroast's studies, makes a bet with him that if he has a satisfactory academic progress, he will give him a sack of money. What he means by academic progress is a sequence of Zorro tests that, if we arrange them in chronological order, their scores form an ascending sequence. The satisfaction level of an educational achievement is equal to the number of its tests.
Zoro, who thinks badly about money, wants to violate ethics and cheat. He shows a consecutive interval of his list of tests (arranged in order of time) along with the integer number. d d with compliance
x ≤ d ≤ x Selects −x≤d≤x and to all scores in the selected interval d d adds units. Be careful that d d can be negative (Zoro might get overwhelmed by losing and forget his original goal).
Now he asked you to reach him. By taking the number of Zorro tests ( n n) and his list of grades ( A A) and number x x, print the value of the most satisfactory academic achievement after cheating.
input In the first line of input two numbers in order n n and x x is spaced apart.
In the second input line n There are n numbers with spaces that represent the list of Zoro's scores. Grades are given in chronological order. 1 ≤ n ≤ 200
000 1≤n≤200 000 0 ≤ x , A i ≤ 1 0 9 0 ≤ x, A i ≤10 9
output Print only one number that equals the maximum amount of satisfaction for an educational achievement.
Sub-problems Constraint score subproblem 1 5 n , x ≤ 10 n,x≤10 2 10 n , x ≤ 50 n,x≤50 3 13 n ≤ 1000 n≤1000 4 10 x
0 x=0 5 20 x ≤ 5 x≤5 n ≤ 5 x 1 0 4 n≤5×10 4
6 17 x
1 0 9 x=10 9
7 25 without additional restrictions Example Sample entry 1 8 10 7 3 5 12 2 7 3 4 Plain text Sample output 1 5
- Assistant
- User
عنوان پروژهی جدید آقای مهندس «نوسازی جادههای نزدیک پایتخت» است. در کشور n n شهر وجود دارد که بعضی از آنها با جادههای دوطرفه قدیمی به هم متصل شدهاند. در این پروژه قرار است تعدادی از این جادههای قدیمی دوباره آسفالت شوند، به طوری که از حداقل k k شهر (شامل خود پایتخت) بتوان با استفاده از جادههای نوسازی شده به پایتخت رسید. از طرفی آقای مهندس میخواهد هر چه زودتر پروژه انجام شود تا به خانهاش برگردد.
روند اجرای پروژه به این صورت است که آسفالت کردن تمام جادههایی که قرار است آسفالت شوند، به طور همزمان شروع میشود. میدانیم که آسفالت کردن یک جاده به طول l l، دقیقن l l روز طول میکشد. به عبارت دیگر پروژه آسفالتسازی به اندازهی طول بلندترین جادهای که قرار است آسفالت شود طول میکشد.
به ازای سناریوهای مختلف که کدام شهر پایتخت باشد و مقدار k k چقدر باشد، کمترین زمان لازم برای انجام پروژه را پیدا کنید.
- Assistant
- User
Mr. ــــــــــــــــــــــــــــــــــــــــــرـــــــــــــــــــــــــــــــــــــرـــــــــــــــــــــــــــــــــــ, But it's been a few days since I heard from a reliable source that someone is spying in that organization. From that day to this moment, the mentioned person has not been calm. Even his relatives have mentioned that due to his anxiety, the number of his nerve pill consumption has skyrocketed.
- Assistant
- User
variable input
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.