Problem: A frog is initially at position on the number line. The frog has two positive integers and . From a position , it can either jump to position or .
Let be the number of distinct integers the frog can reach if it never jumps on an integer outside the interval . The frog doesn't need to visit all these integers in one trip, that is, an integer is counted if the frog can somehow reach it if it starts from .
Given an integer , find . That is, find the sum of all for from to .
Input Format: The first line contains three integers ().
Output Format: Print a single integer, the desired sum.
Note: In the first example, we must find . We have . The sum of these values is .
In the second example, we have , so we want to find .
In the third example, the frog can't make any jumps in any case.