1. A mask pattern generating method for generating patterns of a plurality of masks used for a mask manufacturing method for manufacturing the plurality of masks using data of the generated patterns of the plurality of masks used in a plurality of exposures in which exposure light is irradiated onto a substrate using a mask, and then exposure light is irradiated onto the substrate using another mask, the mask pattern generating method comprising the following steps executed by a computer: obtaining data for a pattern including a plurality of pattern elements, determining formulation of a disposition limitation condition for the pattern elements, analyzing the distance between the pattern elements, determining formulation of the distance limitation condition, and applying a first variable configured to express a number of pattern divisions and a second variable configured to express a distance related to all pattern elements in a cost function and thereby dividing the pattern, wherein the mask manufacturing method comprises a step of manufacturing the plurality of masks including the divided pattern using data of the divided pattern.