CF601B Lipshitz Sequence

Description

A function ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF601B/430ebcefe96c88310ccd261882b0ff945145df52.png) is called Lipschitz continuous if there is a real constant $ K $ such that the inequality $ |f(x)-f(y)|=2 $ , ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF601B/02820989bea357555f19945647d60c22d98153a5.png) over all $ 1

Input Format

The first line of the input contains two space-separated integers $ n $ and $ q $ ( $ 2

Output Format

Print the answers to all queries in the order in which they are given in the input. For the $ i $ -th query, print one line containing a single integer — the sum of Lipschitz constants of all subarrays of ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF601B/5d9ebef2ff7149a76a7b22b08cb78cb7d7617492.png).

Explanation/Hint

In the first query of the first sample, the Lipschitz constants of subarrays of ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF601B/6f9417fdcb9c3ca8d78dd9307c5187f8fb187e89.png) with length at least $ 2 $ are: - ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF601B/ad0807635c6133e89feb982a2e00b9c60b15e05e.png) - ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF601B/b5fd24d5adf442c68d175bf047b1975f7d5e9c25.png) - ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF601B/bb2421b16fa9a9eeeb4115e7a2a3b1e115becb80.png) The answer to the query is their sum.