You are given a disk-shaped or circular material. Determine the maximum number of pieces in which the material can be cut into by using exactly \(N\) straight cuts.
You must perform the task for \(T\) tasks separately.
Input format
- The first line contains \(T\) denoting the number of test cases.
- Next \(T\) lines contain a single integer \(N\).
Output format
Print \(T\) separate lines each containing answer for each test case.
Note: Use a 64-bit variable to store and read all the variables.
Constraints
For the first case where N = 0, using 0 cuts you can get a maximum of 1 piece of the material.
For the second case where N = 4, using exactly 4 straight cuts you can get 11 pieces of material.
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
Login to unlock the editorial
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