CF901C Bipartite Segments

Description

You are given an undirected graph with $ n $ vertices. There are no edge-simple cycles with the even length in it. In other words, there are no cycles of even length that pass each edge at most once. Let's enumerate vertices from $ 1 $ to $ n $ . You have to answer $ q $ queries. Each query is described by a segment of vertices $ [l;r] $ , and you have to count the number of its subsegments $ [x;y] $ ( $ l

Input Format

The first line contains two integers $ n $ and $ m $ ( $ 1

Output Format

Print $ q $ numbers, each in new line: the $ i $ -th of them should be the number of subsegments $ [x;y] $ ( $ l_{i}

Explanation/Hint

The first example is shown on the picture below: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF901C/9b1dc17b2719bb085fa0c10624f2d9373bdbe5c5.png) For the first query, all subsegments of $ [1;3] $ , except this segment itself, are suitable. For the first query, all subsegments of $ [4;6] $ , except this segment itself, are suitable. For the third query, all subsegments of $ [1;6] $ are suitable, except $ [1;3] $ , $ [1;4] $ , $ [1;5] $ , $ [1;6] $ , $ [2;6] $ , $ [3;6] $ , $ [4;6] $ . The second example is shown on the picture below: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF901C/d6699797f2ea521389d1d5d2e2e1a5397ed46123.png)