SPOJ CTRICK, RRSCHED, ASSIST

All these problems are similar.
Can anyone explain how to come up with a BIT solution here??