P9817 [HackerEarth] free drives 1
普及
题目描述

Amer cabs has released a scheme through which a user gets a free drive when he shares a reference code with another Amer app user. Given N number of app users, output total number of free drives gained by all of them. Two same users cannot share reference code more than once.

Input Format
The first line contains the number of test cases T, T lines follow.
Each line then contains an integer N, the total number of Amer App Users.

Output Format

Print the number of Free Drives for each test-case in a new line.

Constraints

1 ≤ T ≤ 1000
0 < N < 10^6

SAMPLE INPUT
2
1
2

SAMPLE OUTPUT
0
1

Explanation

Case 1 : Single user shares no reference code, hence 0 free drives.
Case 2 : There are 2 app users, so reference code is shared once, hence 1 free drive.

输入格式

见题面

输出格式

见题面

样例输入
2 1 2 SAMPLE
样例输出
0 1