We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Algebra
- Summing the K-N-R Series
Summing the K-N-R Series
Summing the K-N-R Series
You are given a sequence whose term is
You have to evaluate the series
Find .
Input Format
The first line of input contains , the number of test cases.
Each test case consists of three lines, each containing , and respectively.
Output Format
For each test case, print the required answer in a line.
Constraints
Sample Input
2
2
5
2
3
4
3
Sample Output
1146
5988
Explanation
Case 1:
Case 2: