Compute the sum of consecutive integers starting with $ M $ and ending with $ N $.
Input
The only line of input contains two integers $ M $ and $ N $. ($ -10000 \le M \le N \le 10000 $)
Output
Output $ \displaystyle \sum_{i=M}^{N} i $, i.e. the sum of all integers start from $ M $ and ending with $ N $.
You can learn more about the summation notation $ \displaystyle \left(\sum\right) $ here.
Sample Test Cases
Input | Output | |
---|---|---|
1 100 | 5050 | |
-10 1 | -54 |
Scoring: Per Case
Authored by s16f22