Vashist is a math enthusiast. One day, he decided to make a Rhombus of numbers. The numbers in the rhombus are filled as:
1) The center of the rhombus, i.e, where diagonals of the rhombus intersect has an integer N.
2) The numbers in its diagonals are filled by applying increasing Arithmetic Progression (A. P.) of size Z with a common difference D on left, right, top and bottom of the center of the rhombus.
3) Other numbers are filled as the sum of two adjacent numbers. Start filling other numbers from center.
See explanation of sample testcase for clarification.
In the above example, N=1, D=1 and Z=5.
He asks you to find the Rhombus Sum R which is equal to the sum of all the numbers in the rhombus formed if you are provided with the center of the rhombus N, the common difference D and the size Z of the progression.
Input:
Output:
Constraints
For case 1: N=1, D=1, Z=4, Rhombus is formed as:
Sum of all the numbers in the Rhombus = 109