#K12901. Magic Infinity Tree Nodes Calculation
Magic Infinity Tree Nodes Calculation
Magic Infinity Tree Nodes Calculation
In this problem, you are given T test cases. For each test case, you are provided with an integer V which represents the value of the root node in a Magic Infinity Tree. The task is to compute the minimum number of nodes required to form such a tree.
The number of nodes for a test case is defined as follows:
$$ \text{nodes}(V)= \begin{cases} 1, & \text{if } V = 0, \\ V + 1, & \text{if } V > 0. \end{cases} $$
Your program should read the input from standard input and output the answer for each test case to standard output.
inputFormat
The first line contains a single integer T (1 ≤ T ≤ 105), representing the number of test cases.
The second line contains T space-separated integers, where the i-th integer represents the value of the root node V of the i-th test case. Each V satisfies 0 ≤ V ≤ 109.
outputFormat
Output T lines. The i-th line should contain a single integer representing the minimum number of nodes in the Magic Infinity Tree for the corresponding test case.
## sample3
0 1 10
1
2
11
</p>