The chef was searching for his pen in the garage but he found his old machine with a display and some numbers on it. If some numbers entered then some different output occurs on the display. Chef wants to crack the algorithm that the machine is following.
Example to identify the pattern :
Input                            Output
9                                   36
5                                   10
1                                    0
2                                    1
-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, $N$. 
-----Output:-----
For each test case, output in a single line answer as displayed on the screen.
-----Constraints-----
- $1 \leq T \leq 10^6$
- $1 \leq N \leq 10^6$
-----Sample Input:-----
1
7
-----Sample Output:-----
21
# cook your dish here
T = int(input())

for t in range(T):
    N = int(input())
    
    print(int(((N-1)*(N))/2))
# cook your dish here
T = int(input())

for t in range(T):
    N = int(input())
    
    print(int(((N-1)*(N))/2))