INOI 2019 - Processor Scheduling

Can anybody help me to solve the INOI 2019, P1, Processor Scheduling?
Link to problem: INOI 2019 P1

Also can anybody please help me to with a previous question I asked: Previous

Ever tried searching for the editorial on this discuss forum?
The editorial of INOI1901 can be found here