#C3027. Minimum Blocks
Minimum Blocks
Minimum Blocks
You are given a single positive integer M, which represents the number of stacks that need to be built with heights 1, 2, ..., M. The task is to compute the minimum number of blocks required to build these stacks. The number of blocks corresponds to the sum of the first M natural numbers.
You can use the formula below to compute the result:
\( S = \frac{M(M+1)}{2} \)
For instance, if M = 3, the result is \(3\times4/2 = 6\). Similarly, if M = 4, the result is \(4\times5/2 = 10\).
inputFormat
The first line of input contains a single integer T, denoting the number of test cases. Each of the following T lines contains a single integer M, which represents the number of stacks.
outputFormat
For each test case, output a single line containing the minimum number of blocks required to build stacks of heights 1, 2, ..., M.
## sample1
3
6