P9882 [HackerEarth] handshake
普及
题目描述

At the annual meeting of Board of Directors of Biana Inc, every one starts shaking hands with everyone else in the room. Given the fact that any two persons shake hand exactly once, Can you tell the total count of handshakes?

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 Board of Directors of Acme.

Output Format

Print the number of handshakes 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 : The lonely board member shakes no hands, hence 0.
Case 2 : There are 2 board members, 1 handshake takes place.

输入格式

见题面

输出格式

见题面

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