The correct option is A RSQP
The words 'they knew him to' mean that 'they' knew a particular aspect of a person, which is part R: "to be a hard taskmaster".
These words 'they knew him' will not be followed by part P: "to leave work early that day" as the action it states is a particular one that took place once 'that day'.
Hence, the part that comes first is R, and not P.
The part that follows R is S, as the words 'and were surprised' introduce a new clause.
Part Q follows next as the word 'when' is directly linked to 'surprised': and were surprised when... .
Part P comes last as this phrase 'to leave work...' is connected to the noun 'them': he permitted them to leave... .
This sequence is seen in option B, hence it is the correct option.
Since the other options begin with P, and it's been established that P comes last and not first, options A, C and D are incorrect.