A Sufficient Condition for a Code to Achieve the Minimum Decoding Error Probability ---Generalization of Perfect and Quasi-Perfect Codes