You are given two integers and . Choose one or more distinct integers between and , inclusive, and add the chosen integers.
Find the number of distinct sums that can be obtained.
The input is given in the following format:
For each test case, print the number of distinct sums modulo .
Each test case is given in the following format:
No additional constraints.