Say no to Handshakes!!!
Practice
5 (1 votes)
Easy
Simple Math
Problem
88% Success 372 Attempts 20 Points 5s Time Limit 256MB Memory 1024 KB Max Code

Before the outbreak of corona virus to the world, a meeting happened in a room in Wuhan. A person who attended that meeting had COVID-19 and no one in the room knew about it! So everyone started shaking hands with everyone else in the room as a gesture of respect and after meeting unfortunately every one got infected! Given the fact that any two persons shake hand exactly once, Can you tell the total count of handshakes happened in that meeting?

Say no to shakehands. Regularly wash your hands. Stay Safe.

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 people attended that meeting.

Output Format

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

Constraints 

1 <= T <= 1000 
0 < N < 106    

 

Please fill this form(ignore if already filled)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
2 votes
Tags:
EasyMath
Points:20
5 votes
Tags:
Ad-HocEasyMathematicsSieveOpenApprovedMathamatics
Points:20
4 votes
Tags:
Easy