If in a race of 240 m M can beat N by 40 m and P by 70 m, then N can beat P by:
36m
In a race of 240m, as M beats N by 40m, when M runs 240m, N runs 200m.
Similarly, as M beats P by 70m, when M covers 240m, P covers 170m.
Hence, when N runs 200m, P runs 170m.
When N runs 240m, P runs 240×170200=204m
Hence, N beats P by 36m.