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<=10^{9}

**Example:
Input:**

2

3

6

10

28

Author: harsh.agarwal0

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.

thanuvinu94 | 467 |

kunalk02141 | 429 |

RishabhTanwar1 | 384 |

the_coder95 | 380 |

RitikRosan | 288 |

the_coder95 | 1226 |

RishabhTanwar1 | 1104 |

thanuvinu94 | 676 |

tathagat289 | 652 |

themanhasnoname | 620 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4885 |

Quandray | 4547 |

Login to report an issue on this page.