Given an array A of size n and a target integer X, we need to find an array B such that ΣA[i]&B[i]=X (1<=i<=n).
If multiple answers are possible find the lexicographically smallest array B.
As constraints are unknown, I hope someone can help me to find suitable constraints too.