In a high-tech industrial facility, a series of nuclear reactors are arranged in a linear configuration. Each reactor operates under strict pressure regulations to ensure safety and efficiency. To prevent critical failures, each reactor has a specific maximum pressure limit. When a reactor’s internal pressure reaches or exceeds this limit, a controlled pressure release (venting) is initiated. This system requires sophisticated management due to dynamic operational adjustments and the need for continuous monitoring.
You are tasked with designing and implementing a system to manage the pressure of a line of $n$ reactors. Each reactor, indexed from $1$ to $n$, has an initial maximum pressure limit $p_i$. All of the reactors’ initial pressure are $0$. The system must support two types of operations:
The first line contains two integers $n$ and $q$, representing the number of reactors and the number of operations, respectively.
The second line contains $n$ integers, the $i$-th integer $p_i$ represents the initial maximum pressure limit of the $i$-th reactor.
The following $q$ lines describe the operations. Each line begins with an integer $op$.
For each query that $op = 2$, print a single integer on a new line, representing the total number of venting operations that have occurred among all reactors within the specified range since the beginning of the system’s operation.