Bear and Haircut ,please tell me how to approach this problem , editorial is incomplete

HAIRCUT
I am unable to form recurrence ,please help and editorial is not complete of this problem.editorial