#4507. HDU5306-Gorgeous Sequence(华丽的序列)
HDU5306-Gorgeous Sequence(华丽的序列)
Problem - 5306: Gorgeous Sequence
Problem Description
There is a sequence of length . We use to denote the -th element in this sequence. You should do the following three types of operations to this sequence:
- : For every , we use to replace the original 's value.
- : Print the maximum value of that .
- : Print the sum of that .
Input
The first line of the input is a single integer , indicating the number of testcases.
The first line contains two integers and denoting the length of the sequence and the number of operations.
The second line contains separated integers ().
Each of the following lines represents one operation ().
It is guaranteed that , , .
Output
For every operation of type 1 or 2, print one line containing the answer to the corresponding query.
Sample Input
1
5 5
1 2 3 4 5
1 1 5
2 1 5
0 3 5 3
1 1 5
2 1 5
Sample Output
5
15
3
9
Hint
Please use efficient IO method.
Author
XJZX