Determining the optimum strata boundary points using dynamic programming