logo AlgoBeat OnlineJudge
登录 注册

#209443. [EC Final 2021] Vacation

内存限制:1024 MiB 时间限制:4000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Prof. Pang has an annual leave of days and he wants to go on vacation.

Now there are days in a year. Prof. Pang can gain happiness if he rests on the -th day. The values of happiness, , may be negative.

Prof. Pang wants you to do operations:

  • , change the happiness of the -th day to .
  • , Prof. Pang wants to find a period of vacation in . He wants to rest for several (possibly ) days in a row and gain as much happiness as possible. However, he only has days off, thus he can rest for no more than consecutive days in .

That means he wants to find

输入格式

The first line contains three integers indicating the number of days in a year, the number of operations, and Prof. Pang's annual leave days.

The next line contains integers indicating the values of happiness of every day.

The next lines are the operations in the format described above.

It is guaranteed that .

输出格式

For each operation of the second type, print the answer.

样例

样例输入 1

5 6 3
0 -5 -3 8 -3
2 3 5
1 2 5
2 1 5
1 4 -3
2 3 5
2 1 5

样例输出 1

8
10
0
5