Calculating the priority of each process, priority of P1 is (16 + 4) / 4 = 5 and the priority of P2 is (10 + 5) / 5 = 3, the priority of P3 is (7 +7) / 7 = 2 and the priority of P4 is (18 + 6) / 6 = 4. Thus, P1 is the highest priority; the CPU is allocated according to the priority of the P4, P2, and P3.