At the annual meeting of Board of Directors of Acme Inc. If everyone attending shakes hands exactly one time with every other attendee, how many handshakes are there?
There are attendees, , and . shakes hands with and , and shakes hands with . Now they have all shaken hands after handshakes.
Complete the handshakes function in the editor below.
handshakes has the following parameter:
The first line contains the number of test cases .
Each of the following lines contains an integer, .
Case 1 : The lonely board member shakes no hands, hence 0.
Case 2 : There are 2 board members, so 1 handshake takes place.