POJ No.2785, binary enumeration