#P8024. [ONTAK2015] Stumilowy sad
[ONTAK2015] Stumilowy sad
Background
Subtask 0 uses the original testdata, and Subtask 1 uses hack testdata.
Problem Description
On a straight road from left to right, there are regions. Each region initially has a tree planted in it. The tree in region has height . You need to process operations:
1 l r c: Increase the heights of all trees in regions to by units.2 l r h: Fix a knife in the air at height and cut all trees in regions to .3 l r h: Plant a new tree of height in each region from to .4 l r: Query the height of the tallest tree in regions to .
Note: In this problem, height is measured relative to some horizontal plane, so negative values may appear.
Input Format
The first line contains two integers .
The second line contains integers .
The next lines each contain three or four integers: , , or .
Output Format
Output several lines, each containing one integer, which is the answer to the corresponding query.
2 5
3 7
4 1 2
1 1 2 1
4 1 2
3 1 1 5
4 1 2
7
8
8
Hint
For of the data, , , , , .
Translated by ChatGPT 5