Break a number
Submissions: 530   Accuracy:

47.01%

  Difficulty: Easy   Marks: 2

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
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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

to report an issue on this page.