CF935F Fafa and Array
Description
Fafa has an array $ A $ of $ n $ positive integers, the function $ f(A) $ is defined as . He wants to do $ q $ queries of two types:
- $ 1lrx $ — find the maximum possible value of $ f(A) $ , if $ x $ is to be added to one element in the range $ [l,r] $ . You can choose to which element to add $ x $ .
- $ 2lrx $ — increase all the elements in the range $ [l,r] $ by value $ x $ .
Note that queries of type $ 1 $ don't affect the array elements.
Input Format
The first line contains one integer $ n $ $ (3
Output Format
For each query of type $ 1 $ , print the answer to the query.