Problem11255--[yosupo] Data Structure - Range Linear Add Range Min

11255: [yosupo] Data Structure - Range Linear Add Range Min

[Creator : ]
Time Limit : 2.000 sec  Memory Limit : 512 MiB

Description

Given a size $N$ interger sequence $a_0, a_1, \dots, a_{N - 1}$. Process $Q$ queries as follows:

- `0 $l$ $r$ $b$ $c$`: For each $i = l, l+1, \dots, {r - 1}$, $a_i \gets a_i+bi+c$.
- `1 $l$ $r$`: Print $\min_{i \in [l,r)} a_i$.

Input

$N$ $Q$
$a_0$ $a_1$ ... $a_{N - 1}$
$\textrm{Query}_0$
$\textrm{Query}_1$
:
$\textrm{Query}_{Q - 1}$

Output

- $1 \leq N, Q \leq 10^5$
- $|a_i| < 10^9$
- $0 \leq l < r\leq N$
- $|b| < 100$
- $|c| < 10^7$

Sample 1 Input

5 7
1 2 3 4 5
1 0 5
0 2 4 -10 101
1 0 3
0 1 3 12 103
1 2 5
0 2 5 -14 105
1 0 5

Sample 1 Output

1
1
5
1

HINT

Yosupo.

Source/Category