CF799F Beautiful fountains rows
Description
Butler Ostin wants to show Arkady that rows of odd number of fountains are beautiful, while rows of even number of fountains are not.
The butler wants to show Arkady $ n $ gardens. Each garden is a row of $ m $ cells, the $ i $ -th garden has one fountain in each of the cells between $ l_{i} $ and $ r_{i} $ inclusive, and there are no more fountains in that garden. The issue is that some of the gardens contain even number of fountains, it is wrong to show them to Arkady.
Ostin wants to choose two integers $ a
Input Format
The first line contains two integers $ n $ and $ m $ ( $ 1
Output Format
Print one integer: the total length of all suitable segments.
Explanation/Hint
In the first example the following pairs suit Ostin: $ (a,b) $ : $ (1,2) $ , $ (1,4) $ , $ (1,5) $ , $ (2,2) $ , $ (2,4) $ , $ (2,5) $ , $ (3,3) $ , $ (4,4) $ , $ (4,5) $ .
In the second example the following pairs suit Ostin: $ (a,b) $ : $ (1,2) $ , $ (1,5) $ , $ (2,2) $ , $ (2,5) $ , $ (3,3) $ , $ (4,4) $ , $ (4,6) $ , $ (5,5) $ , $ (6,6) $ .