P8563 Magenta Potion

Description

You are given an integer sequence $a$ of length $n$, where the absolute value of every number is at least $2$. There are $q$ operations of the following forms: $\texttt{1 i k}$: modify $a_i$ to $k$. It is guaranteed that the absolute value of $k$ is at least $2$. $\texttt{2 l r}$: consider the maximum subarray product $M$ among all subintervals of $[l, r]$ (including $[l, r]$ itself). If $M > 2^{30}$, output `Too large`; otherwise output $M$. In particular, the product of elements of an empty interval is defined as $1$.

Input Format

The first line contains two positive integers $n$ and $q$. The second line contains $n$ **integers** $a_i$. The next $q$ lines each contain three integers describing one operation, in the format given above.

Output Format

For each $\texttt{2}$ operation, output one line containing the answer to the query.

Explanation/Hint

For all testdata, $2 \le |a_i|, |k| \le 10^9$, $1 \le n, q \le 2 \times 10^5$, $1 \le l \le r \le n$. $$ \def\arraystretch{1.5} \begin{array}{c|c|c}\hline \textbf{测试点编号}&\bm{~~~~~~~~n,q\le~~~~~~~~}&~~~~\textbf{特殊限制}~~~~\cr\hline \textsf1\sim \sf2 & 10& \cr\hline \sf3\sim 6 & 100& \cr\hline \sf7\sim 10 & 5 \times 10^3&\cr\hline \sf 11\sim 13 & &\sf A\cr\hline \sf14\sim 16 & & \sf B\cr\hline \sf17\sim 20 & &\cr\hline \end{array} $$ $\textsf A$: it is guaranteed that $a_i, k \ge 2$. $\textsf B$: it is guaranteed that for each query, the corresponding $r - l \ge 100$. Translated by ChatGPT 5