#1424. Easy problem I

Easy problem I

For a given sequence of nn intergers aia_i.

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 i[l,r]i \in [l, r], change ai=aixja_i = |a_i − x_j|.

2lr(1lrn)2 \quad l \quad r \qquad (1 ≤ l ≤ r ≤ n) — output ans = i=lrai\sum_{i=l}^{r} a_i.

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 TT(1T51 ≤ T ≤ 5) — the number of test cases.

The first line of each test case contains two integers nn and mm, (1n21051 ≤ n ≤ 2 \cdot 10^5, 1m21051 ≤ m ≤ 2 \cdot 10^5) — the length of sequence and the number of operations.

The next line contains nn integer aia_i (0ai1070 ≤ a_i ≤ 10^7)

The next mm line contains some integers optopt, ll, rr, xx (1opt21 ≤ opt ≤ 2, 1lrn1 ≤ l ≤ r ≤ n, 0x1070 ≤ x ≤ 10^7) — 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