Divide and conquer method to achieve schedule scheduling java