## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] Retrieve the Array CodeChef Solution | CodeChef Problem Solution 2022

Chef has an array $A$ of length $N$.

Let $f\left(i\right)$ denote the sum ${A}_{1}+{A}_{2}+\cdots +{A}_{i}\phantom{\rule{thinmathspace}{0ex}}$ and let $g\left(i\right)$ denote the sum ${A}_{i}+{A}_{i+1}+\cdots +{A}_{N}$.

Chef creates another array $B$ of length $N$ such that ${B}_{i}=f\left(i\right)+g\left(i\right)$ for all $1\le i\le N$.

Now, Chef has lost the original array $A$ and needs your help to recover it, given array $B$. It is guaranteed that Chef has obtained the array $B$ from a valid array $A$.

### Input Format

• The first line contains a single integer $T$ — the number of test cases. Then the test cases follow.
Solution Click Below:-  👉
👇👇👇👇👇

• The first line of each test case contains an integer $N$ — the size of the array $A$.
• The second line of each test case contains $N$ space-separated integers ${B}_{1},{B}_{2},\dots ,{B}_{N}$ denoting the array $B$.

### Output Format

For each testcase, output $N$ space separated integers ${A}_{1},{A}_{2},\dots ,{A}_{N}$ denoting the array $A$.

Note that $1\le {A}_{i}\le {10}^{5}$ must hold for all $1\le i\le N$ and it is guaranteed that a valid array $A$ that meets

Best of Two CodeChef Solution

Retrieve the Array CodeChef Solution

Even Equal Odd CodeChef Solution

Xor and Multiply CodeChef Solution

KBG and GN-Theory CodeChef Solution

Chef and his Apps CodeChef Solution

Change Row and Column Both CodeChef Solution

these constraints exists.

If there are multiple answers, output any.

### Constraints

• $1\le T\le 1000$
• $1\le N\le {10}^{5}$
• $1\le {B}_{i}\le 2\cdot {10}^{10}$
• Th sum of $N$ over all test cases does not exceed ${10}^{5}$.
• $1\le {A}_{i}\le {10}^{5}$
• It is guaranteed that a valid array $A$ always exists