F. Easy Game
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

You are playing a game on array $$$a_1, a_2, \ldots, a_n$$$. Each turn you will do the following:

  1. Find the minimal index $$$i$$$ with the biggest value $$$a_i$$$.
  2. Delete $$$i$$$. After that, you will have two arrays (possibly empty) $$$a_1, a_2, \ldots, a_{i - 1}$$$ and $$$a_{i + 1}, a_{i+2}, \ldots, a_n$$$.
  3. Choose one of the arrays.
  4. If the chosen array is empty, stop. Otherwise, start again with the chosen array.

You want to finish this game in a minimal number of turns.

Given an array $$$a_1, a_2, \ldots, a_n$$$ of length $$$n$$$ and $$$q$$$ queries of two types:

  • $$$1\ l\ r\ x$$$ — add $$$x$$$ to each $$$a_l, a_{l + 1}, \ldots, a_r$$$.
  • $$$2\ l\ r$$$ — find the minimal number of turns to finish the game on array $$$a_{l}, a_{l + 1}, \ldots, a_r$$$.

Good luck!

Input

The first line contains two integers $$$n$$$ and $$$q$$$ $$$(1 \le n, q \le 10^5)$$$ — the length of the array and the number of queries.

The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ $$$(0 \le a_i \le 10^9)$$$ — initial permutations.

The next $$$q$$$ lines contain descriptions of queries — $$$1\ l\ r\ x$$$ $$$(1 \le l \le r \le n, 0 \le x \le 10^9)$$$ or $$$2\ l\ r$$$ $$$(1 \le l \le r \le n)$$$.

It is guaranteed that there is at least one second-type query.

Output

For each query of the second type, print the minimal number of turns to finish the game.

Example
Input
5 10
1 2 3 1 5
2 1 5
1 1 4 10
2 1 5
1 5 5 6
1 4 5 2
2 1 5
1 2 2 1
2 1 5
1 1 1 2
2 1 5
Output
1
2
2
2
1