Loading...
Sum Game II
Time: 1 s
Memory: 125 MB
Today is Bran’s birthday. So Bran enjoying his birthday party with his friends. Bran has n number of friends. To make the party more enjoyable they are playing a game. In this game, each of Bran’s friends guesses a unique non-negative integer number less than the number of Bran’s friends. Then Bran has to add all these numbers that Bran’s friends have guessed and tell the summation. Now Bran asked you to help him. Given a number n and you have to say what value Bran would say to his friends.
Input
First line contains an integer t the number of test cases. Next, each line contains an integer n.
Constraint
\(1<= t <=10\)
\(1<= n <= 4*10^8\)
Output
For each test case output the value and a new line.
Examples
Input
Output
2
2
3
1
3
Problem Info
Problem ID 19
Time Limit 1000 ms
Memory Limit 128000 KB
Moderators Saidur , muncityuni , amit_SK
Statistics
Submit
You need to Login or Registration for submit your solution