AtCoder Grand Contest 015
A
A+...+B Problem
AtCoder
⌀ 620
原题
←B →
翻译中…

Problem Statement

翻译中…

Snuke has $N$ integers. Among them, the smallest is $A$, and the largest is $B$. We are interested in the sum of those $N$ integers. How many different possible sums there are?

翻译中…

Constraints

翻译中…
  • $1 ≤ N,A,B ≤ 10^9$
  • $A$ and $B$ are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N A B

翻译中…

Output

翻译中…

Print the number of the different possible sums.

翻译中…

样例

Input #1
4 4 6
Output #1
5
There are five possible sums: $18=4+4+4+6$, $19=4+4+5+6$, $20=4+5+5+6$, $21=4+5+6+6$ and $22=4+6+6+6$.
Input #2
5 4 3
Output #2
0
Input #3
1 7 10
Output #3
0
Input #4
1 3 3
Output #4
1
题目信息
题号
agc015_a
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。