Two motorboats are travelling up and down a lake at constant speeds and turning at each end without slowing down. They leave opposite ends A and B at the same instant, passing each other, for the first time 600 metres from A and, for the second time, 400 metres from B.

How long is the lake (the distance from A to B) and what is the ratio of the speeds of the boats?