链接:
https://ac.nowcoder.com/acm/contest/57361/H
来源:牛客网
You enjoy the mountain view, especially on a rainy day.
For a positive integer sequence
b1,b2,⋯,bk(k≥2)b_1,b_2,\cdots, b_k(k \geq 2)b1,b2,⋯,bk(k≥2), you define its
beauty as following:
Suppose there is a broken line connecting
(1,b1),(2,b2),⋯,(k,bk)(1, b_1), (2, b_2), \cdots, (k, b_k)(1,b1),(2,b2),⋯,(k,bk) one by one on the Cartesian plane, representing a mountain's outline. To the immediate right of
(k,bk)(k, b_k)(k,bk) is a vertical cliff whose height can be assumed infinite (but to the left of
(1,b1)(1, b_1)(1,b1) there isn't). Small ponds form on rainy days, and the
beauty is the maximum ponding area on this 2D graph.
Now you have an integer sequence
a1,a2,⋯,ana_1, a_2, \cdots, a_na1,a2,⋯,an. Support two operations:
-
`1 x y` — Set axa_xax to yyy.
-
`2 l r` — Print the beauty of al,al+1,⋯,ara_l, a_{l+1}, \cdots, a_ral,al+1,⋯,ar.