Then winter comes — the snow keeps falling and accumulating, eventually covering all sins. Finally spring arrives — along with the melting snow, all punishments are delivered.
Just cure whoever you can. There is no way to fix the problem setter who designed this problem.
As we all know, a person who is obsessed with bad endings just like this problem setter can never be cured. But if a problem can be solved with only slope optimization, it is still worth a try.
Given a sequence of $$$n$$$ positive integers $$$a_1, a_2, \dots, a_n$$$. You need to perform $$$q$$$ operations in total, choosing from the two types below. It is guaranteed that every number in the sequence always stays within the range $$$[1, 2 \times 10^5]$$$.
The first line contains two positive integers $$$n, q$$$ $$$(2 \le n \le 2 \times 10^5, 1 \le q \le 2 \times 10^5)$$$.
The second line contains $$$n$$$ positive integers $$$a_1, a_2, \dots, a_n$$$ $$$(1 \le a_i \le 2 \times 10^5)$$$.
The following $$$q$$$ lines describe the operations:
Each line starts with an integer $$$op \in \{1,2\}$$$. If $$$op = 1$$$, three positive integers $$$l, r, x$$$ follow $$$(1 \le l \le r \le n, 1 \le x \le 2 \times 10^5)$$$, which means adding $$$x$$$ to every element in interval $$$[l,r]$$$. If $$$op = 2$$$, two positive integers $$$l, r$$$ follow $$$(1 \le l \lt r \le n)$$$, which means querying the minimal total weight of interval $$$[l, r]$$$.
For each query of type $$$op=2$$$, output two integers $$$a$$$ and $$$b$$$ separated by a single space on one line. Constraints: $$$a \ge 0,\ b \gt 0,\ \gcd(a, b) = 1$$$. The minimal weight equals $$$\dfrac{a}{b}$$$. Specially, if the minimal weight is an integer $$$x$$$, you should output $$$x$$$ and $$$1$$$.
6 101 2 3 4 5 62 2 51 1 6 12 1 61 3 4 22 1 32 4 61 5 5 11 1 2 31 1 1 12 1 6
1 1 3 2 26 3 2 3 0 1
| Name |
|---|


