BETA
Successful submissions of School Problems are not counted in user ratings.

Submissions : 368 Accuracy :

55.98

Number of Diagonals
     

Given a number N. Write a program to the find number of diagonals possible in N sided convex polygon.

Input:
First line of input contains a single integer T which denotes the number of test cases. T test cases follows. First line of each test case contains a single integer N.

Output:
For each test case print number of diagonals possible in N sided convex polygon.

Constraints:
1<=T<=100
3<N<=104

Example:
Input:

2
5
6
Output:
5
9

**For More Examples Use Expected Output**


Contributor: Harsh Agarwal

Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



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