BETA

Difficulty Level: Easy

Total Submissions: 362 Accuracy:

41.71%

Break a number
       

Given a really large number, break it into 3 whole numbers such that they sum up to the original number and count number of ways to do so.

Input:
First line consists of T test cases. Only line consists of a integer.

Output:
Single line output, print the count.

Constraints:
1<=T<=100
1<=N<=10^4

Example:
Input:

2
2
3
Output:
6
10

Explanation:
For the 2nd test case. 
Possible ways to break the number.
0+0+3 = 3
0+3+0 = 3
3+0+0 = 3
0+1+2 = 3
0+2+1 = 3
1+0+2 = 3
1+2+0 = 3
2+0+1 = 3
2+1+0 = 3
1+1+1 = 3

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.