For a given N and C, find the lexicographically smallest triple (X, Y, Z) such that exactly C ordered N-tuples of 31-bit integers have OR X, AND Y, XOR Z, or report none exists.
Hard9Bit manipulationCombinatoricsMathDynamic programmingNo attempts yetTime limit1sMemory limit128 MB