#P8563. Magenta Potion

Magenta Potion

Problem Description

You are given an integer sequence aa of length nn, where the absolute value of every number is at least 22. There are qq operations of the following forms:

1 i k\texttt{1 i k}: modify aia_i to kk. It is guaranteed that the absolute value of kk is at least 22.

2 l r\texttt{2 l r}: consider the maximum subarray product MM among all subintervals of [l,r][l, r] (including [l,r][l, r] itself). If M>230M > 2^{30}, output Too large; otherwise output MM. In particular, the product of elements of an empty interval is defined as 11.

Input Format

The first line contains two positive integers nn and qq.

The second line contains nn integers aia_i.

The next qq lines each contain three integers describing one operation, in the format given above.

Output Format

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

5 7
2 2 3 4 5
2 1 5
1 3 -3
2 1 5
2 3 3
1 1 100000
1 2 100000
2 1 2
240
20
1
Too large

Hint

For all testdata, 2ai,k1092 \le |a_i|, |k| \le 10^9, 1n,q2×1051 \le n, q \le 2 \times 10^5, 1lrn1 \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}$$

A\textsf A: it is guaranteed that ai,k2a_i, k \ge 2.

B\textsf B: it is guaranteed that for each query, the corresponding rl100r - l \ge 100.

Translated by ChatGPT 5