Problem Statement
$N$ plates are arranged in a straight line from left to right. Let us call the $i$-th plate from the left $(1\le i\le N)$ plate $i$. Initially, all plates are placed face-up, and no plates have takoyaki (octopus dumplings) on them.
Process a total of $Q$ queries of the following three types:
- Type
$1$: You are given integers$L,R,X$. For$i=L,L+1,\ldots,R$, if plate$i$is placed face-up, place$X$takoyaki on plate$i$. - Type
$2$: You are given integers$L,R$. For$i=L,L+1,\ldots,R$, if there is at least one takoyaki on plate$i$, eat all the takoyaki on plate$i$. Flip plate$i$(if the plate is placed face-up, place it face-down; otherwise, place it face-up). - Type
$3$: You are given integers$L,R$. Print the maximum number of takoyaki on one plate among plates$L,$$L+1,\ldots,$$R$.
Constraints
$1\le N\le2\times10 ^ 5$$1\le Q\le2\times10 ^ 5$- In all queries,
$1\le L\le R\le N$. - In type
$1$queries,$1\le X\le10 ^ 9$. - There is at least one type
$3$query. - All input values are integers.
Input
The input is given from Standard Input in the following format:
N Q
\mathrm{query} _ 1
\mathrm{query} _ 2
\vdots
\mathrm{query} _ Q
Here, $\mathrm{query} _ i$ represents the $i$-th $(1\le i\le Q)$ query and is given in one of the following formats:
t L R X
t L R
These indicate that the $i$-th query is of type $t$ and the given integers are $L,R,X$ or $L,R$. Type $1$ queries are given in the former format, and other queries are given in the latter format.
Output
Let $q$ be the number of type $3$ queries. Print $q$ lines. The $i$-th line $(1\le i\le q)$ should contain the answer to the $i$-th type $3$ query from the beginning.
样例
6 6
1 3 5 4
3 2 3
1 1 6 2
2 3 4
3 1 6
3 2 3
4
6
2
2 8
1 1 2 1000000000
1 1 2 1000000000
2 2 2
1 1 2 1000000000
1 1 2 1000000000
1 1 2 1000000000
3 2 2
3 1 2
0
5000000000
24 30
1 11 24 4326
1 4 16 1149
1 14 20 2331
1 12 14 8930
1 22 23 6989
3 15 20
3 10 19
1 3 12 7988
1 18 23 8450
3 9 19
3 13 15
2 8 15
2 9 14
1 11 17 4062
1 6 15 1721
3 7 13
1 11 20 8541
1 8 10 3748
1 1 17 3252
2 9 23
2 1 23
3 2 22
1 5 23 7468
3 1 12
3 12 19
2 6 24
3 2 14
3 1 15
2 15 19
3 2 14
7806
16736
22393
16736
10858
0
7468
7468
0
0
0
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。