Are you sure you want to participate in this contest ?
If you select a team then virtual participation for other team members will be disabled. So, pick one if and only if your teammates are ready to compete with you.
Given an array of size n, which initially has all elements equal to zero (0), you need to perform three types of queries:
1 i j v: Increase the numbers between indices $i$ and $j$ (inclusive) by $v$. It is guaranteed that $1 \leq i \leq j \leq n$ and $1 \leq v \leq 1000$.
2 i j: Replace the numbers between indices $i$ and $j$ (inclusive) with the increasing sequence $[1, 2, 3, \ldots, j-i+1]$. It is guaranteed that $1 \leq i \leq j \leq n$.
3 i j: Count how many numbers between indices $i$ and $j$ (inclusive) are divisible by 5. It is guaranteed that $1 \leq i \leq j \leq n$.
Input
The first line of input contains two integers $1 \leq n \leq 10^5$ and $1 \leq q \leq 50000$, denoting the size of the array and the number of queries to perform, respectively.
The following $q$ lines contain the description of the queries, in the format explained above.
Output
For each query of type $3$, print the result of the query.
Sample test(s)
Input
10 6
1 1 10 5
3 1 10
2 1 5
2 6 10
2 3 8
3 1 10
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
10
2
--- Showing first 30 lines (click "Copy" to get full content) ---
Input
5 6
2 1 5
1 1 3 4
1 2 4 1
3 1 5
3 2 5
3 2 4
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
3
2
1
--- Showing first 30 lines (click "Copy" to get full content) ---