atcoder#AGC015A. [AGC015A] A+...+B Problem

[AGC015A] A+...+B Problem

Score : 200200 points

Problem Statement

Snuke has NN integers. Among them, the smallest is AA, and the largest is BB. We are interested in the sum of those NN integers. How many different possible sums there are?

Constraints

  • 1N,A,B1091 \leq N,A,B \leq 10^9
  • AA and BB are integers.

Input

Input is given from Standard Input in the following format:

NN AA BB

Output

Print the number of the different possible sums.

4 4 6
5

There are five possible sums: 18=4+4+4+618=4+4+4+6, 19=4+4+5+619=4+4+5+6, 20=4+5+5+620=4+5+5+6, 21=4+5+6+621=4+5+6+6 and 22=4+6+6+622=4+6+6+6.

5 4 3
0
1 7 10
0
1 3 3
1