BETA

Difficulty Level: Basic

Submissions: 330 Accuracy:

23.03%

Break Numbers[Duplicate problem]
     

Given a large number N, write a program to 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 of input contains a single integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains a single integer N.

Output:
For each test case print the total number of ways to divide the given number into 3 whole numbers such that sum of the three whole numbers is equal to the number itself.

Constraints:
1<=T<=100
1<=N<=109

Example:
Input:

2
3
6
Output:
10
28

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

Contributor: Harsh Agarwal

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.