Cutting a material
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 straight cuts.
You must perform the task for tasks separately.
Input format
- The first line contains denoting the number of test cases.
- Next lines contain a single integer .
Output format
Print separate lines each containing answer for each test case.
Note: Use a 64-bit variable to store and read all the variables.
Constraints
Explanation
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.
Comments
Post a Comment
Please give us your valuable feedback