1. A method for determining patterns for a plurality of masks, the method being executed by a processor, comprising: acquiring data on a pattern containing a plurality of pattern elements; and assigning the acquired plurality of pattern elements into masks, decomposing the acquired plurality of pattern elements into patterns of the masks, and calculating an evaluation value for an evaluation index, based on a number of masks, the distances between a plurality of pattern elements in each mask, and an angle of a line connecting a plurality of pattern elements in each mask, wherein a pattern of each mask is determined based on the calculated evaluation value.