Optimal partitioning method for stability analysis of continuous/discrete delay systems