N,A,B = list(map(int,input().split()))

if A>B:

    ans = 0

elif N==1 and A!=B:

    ans = 0

elif N==1 and A==B:

    ans = 1

else:

    ans = (N-2)*(B-A)+1

print(ans)
N,A,B = list(map(int,input().split()))

X = A*(N-1)+B

Y = A+B*(N-1)

print((max(Y-X+1,0)))
N, A, B = list(map(int, input().split()))
if A > B:
    ans = 0
elif N == 1 and A != B:
    ans = 0
elif N == 1 and A == B:
    ans = 1
else:
    ans = (N - 2) * (B - A) + 1
print(ans)

N, A, B = list(map(int, input().split()))
X = A * (N - 1) + B
Y = A + B * (N - 1)
print((max(Y - X + 1, 0)))

-if A > B: -    ans = 0 -elif N == 1 and A != B: -    ans = 0 -elif N == 1 and A == B: -    ans = 1 -else: -    ans = (N - 2) * (B - A) + 1 -print(ans) +X = A * (N - 1) + B +Y = A + B * (N - 1) +print((max(Y - X + 1, 0)))