Comments

I guess it should have been, "If g is odd ci(ci-1) % (2g) == 0"
Second para of This Comment might help

Yes, but quoting the editorial of B

"since $$$0≤a_i≤n$$$, the maximum possible of value any $$$ai|aj$$$ is $$$≤2n$$$."

$$$a_i|a_j = 2n$$$ is not possible.
So shouldn't the symbol be $$$ \lt $$$ instead of $$$\leq$$$ , in the last part ?

If $$$a_i \leq n$$$ and $$$a_j \leq n$$$, then $$$(a_i|a_j) \leq 2n$$$.
Can someone, give me an example when $$$(a_i|a_j)$$$ is equal to $$$2n$$$.