Updated Pseudocode with task division