## GUPTA MECHANICAL

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

## [Solution] Find A, B, C CodeChef Solution | Codechef Solution

Chef has $3$ hidden numbers $A,B,$ and $C$ such that $0\le A,B,C\le N$.

Let $f$ be a function such that $f\left(i\right)=\left(A\oplus i\right)+\left(B\oplus i\right)+\left(C\oplus i\right)$. Here $\oplus$ denotes the bitwise XOR operation.

Given the values of $f\left(0\right),f\left(1\right),\dots ,f\left(N\right)$, determine the values of $A,B,$ and $C$.

It is guaranteed that at least one tuple exists for the given input. If there are multiple valid tuples of $A,B,C$, print any one.

### Input Format

• The first line of input will contain a single integer $T$, denoting the number of test cases.
Solution Click Below:-  👉
👇👇👇👇👇

• Each test case consists of multiple lines of input.
• The first line of each test case contains a single integer $N$ denoting the upper bound on the values of $A,B,C$.
• Next line contains $N+1$ space-separated integers denoting $f\left(0\right),f\left(1\right),\dots ,f\left(N\right)$.

### Output Format

For each test case, output on a new line, three space-separated integers, the values of $A,B,$ and $C$.

Bidding CodeChef Solution

Pass the Exam CodeChef Solution

Chef and Candies CodeChef Solution

Journey of the Knight CodeChef Solution

Slow Solution CodeChef Solution

Game of Piles Version 1 CodeChef Solution

Find A, B, C CodeChef Solution

Largest Square in the garden CodeChef Solution

Game of Piles Version 2 CodeChef Solution

If there are multiple valid tuples of $A,B,C$, print any one.

### Constraints

• $1\le T\le 2\cdot {10}^{4}$
• $2\le N\le {10}^{5}$
• Sum of $N$ over all test cases does not exceed