The algorithm that you are to use for scheduling CPU time is priority-based. At each time step, you should first determine if any new processes are arriving, and put them into the priority queue. Then, for each available CPU, take a single process from the priority queue (if there is a process left in the queue), and assign it to that CPU. Once a process is assigned to a CPU, it stays in that CPU until it gets all of the time it requires or gets the maximum time slice permitted, whichever comes first. At this point that CPU is free again. If the process requires further time, it goes back into the priority queue to wait for another turn.