The problem link is: https://www.codechef.com/problems/GAMCOUNT

Approach:

As we know Henry gonna win every game in which possible number of all valid moves is odd.

So we calculate total number of valid moves of each ofXi(see NOTE) and sum them.

More generally Henry wins if the sum of all these moves is odd ,also problem can be simplified if considering total moves of each numberXi as either even or odd, then just look if there are odd number of odds in initial givenXi set and count these games in answer.

- Is this approach is correct?

NOTE: we can simply get valid number of moves with**X**i by just knowing how many times we can subtract 2^**V**(**X**i) so that resulting number be >=0.