CF601B Lipshitz Sequence
题目描述
**【题目翻译】**
对于一个序列 $v_{1...n}$,当 $1\leq x
输入格式
第一行两个整数 $n(n \le 10^5)$ 和 $q(q \le 100)$,分别表示序列的长度以及询问的个数。
第二行 $n$ 个数,表示序列 $v(0\leq v_i\leq 10^8)$。接下来 $q$ 行,每行两个数 $l$ 和 $r$,表示询问的区间为 $[l,r]$。
输出格式
对于每个询问,输出一行一个数,即 $v_{l,r}$ 的所有连续子序列(子段)的 Lipschitz 常数之和。
说明/提示
In the first query of the first sample, the Lipschitz constants of subarrays of  with length at least $ 2 $ are:
- 
- 
- 
The answer to the query is their sum.