Let's see. Suppose John swims at speed v metres per second. Then he would have finished in 100/v seconds.
Since Jim was then 10 metres behind, he swam 90 meters in 100/v seconds and so was swimming at the rate of (90)(v/100)= (9/10)v. At that rate he will have completed the race in 100((10/9)v)= 1000/(9v) seconds.
Since Ken was 20 metres behind Jim, he swam 80 meters in 1000/9v seconds so he was swimming at the rate of (80)(9v/1000)= (72/100)v.
When John finished the race, in 100/v seconds, Ken had also been swimming for 100/v seconds and so had gone (100/v)(72/100)v= 72 metres. Ken was 100-72= 28 meters behind John!