Note that the inputs strictly follow the specification. No need to bother yourself.
Just pay attention to deal with multiple cases.
(1) A blank line to separate different output cases.
(2) Be sure that read the parameters successfully, or you use use the old parameters from previous case and still have code runnable.
(3) Push the front of the block queue to the front of ready queue.
(4) Not to remove the lock instruction if it is blocked. (Next time it should be execute again)