100 atcoder#ABC181B. [ABC181B] Trapezoid Sum
[ABC181B] Trapezoid Sum
Score : points
Problem Statement
We have a blackboard with nothing written on it. Takahashi will do operations to write integers on it.
In the -th operation, he will write each integer from through once, for a total of integers.
Find the sum of the integers written on the blackboard after the operations.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the sum of the integers written on the blackboard after the operations.
2
1 3
3 5
18
In the -st operation, he will write , , and on the blackboard.
In the -nd operation, he will write , , and on the blackboard.
The sum of the integers written is .
3
11 13
17 47
359 44683
998244353
1
1 1000000
500000500000