Given a set

S(K) is defined as

where oplus is the bitwise XOR. Given any set A, find a set B such that B is a subset of A and S(B) is maximized.