CF1739B Array Recovery
Description
For an array of non-negative integers $ a $ of size $ n $ , we construct another array $ d $ as follows: $ d_1 = a_1 $ , $ d_i = |a_i - a_{i - 1}| $ for $ 2 \le i \le n $ .
Your task is to restore the array $ a $ from a given array $ d $ , or to report that there are multiple possible arrays.
Input Format
N/A
Output Format
N/A
Explanation/Hint
In the second example, there are two suitable arrays: $ [2, 8, 5] $ and $ [2, 8, 11] $ .