You are given an array of **n** cards, all initially with value **0**. You need to perform **q** updates on this array.
Each update follows a specific pattern:
- For an update **(i, x)**, add **x** to the element at index **i**, add **(x-1)** to elements at indices **(i-1)** and **(i+1)** if they exist, add **(x-2)** to elements at indices **(i-2)** and **(i+2)** if they exist, and so on — until the value to be added becomes **0 or negative**.
- Formally, for each update **(i, x)**, modify the array as:
$$arr[j] = arr[j] + (x - |j - i|) \quad \text{for all } j \text{ where } |j-i| < x \text{ and } 0 \leq j < n$$
After all **q** updates are applied, return the final state of the array.