#1424. Easy problem I
Easy problem I
For a given sequence of intergers .
There are two types of operations:
$1 \quad l \quad r \quad x_j \qquad (1 ≤ l ≤ r ≤ n, x_j \le x_{j+1})$ — for each , change .
— output ans = .
tips: Due to the large input data, it may be necessary to FastIO.
Input
The input consists of multiple test cases. The first line contains a single integer () — the number of test cases.
The first line of each test case contains two integers and , (, ) — the length of sequence and the number of operations.
The next line contains integer ()
The next line contains some integers , , , (, , ) — indicating the operations.
Output
For each query, output an interger in a single line indicating the ans.
Example
1
5 5
1 2 3 4 5
1 1 5 3
2 1 2
2 2 4
1 2 3 5
2 1 5
3
2
14
Limitation
Time limit: 9 second
Memory limit: 512 megabytes