13.387 A motorboat departed from point A upstream, and simultaneously a raft set off downstream from point B. They met after a hours and continued moving without stopping. Upon reaching point B, the boat turned back and caught up with the raft at point A. The boat's own speed remained constant throughout. How long were the raft and the boat in the water?
Solution. Let $x$ be the own speed of the boat, $y$ be the speed of the river current. Then, up to the first meeting, the boat has traveled a distance of $a(x-y)$, and the raft has traveled $ay$. Therefore, the distance between A and B is $ax$. The time it takes for the raft to travel from B to A is $a \frac{x}{y}$. The time it takes for the boat to travel from A to B and back is $\frac{a x}{x-y}+\frac{a x}{x+y}$. Therefore, $\frac{a x}{x-y}+\frac{a x}{x+y}=\frac{a x}{y} x^{2}-2 x y-y^{2}=0 \Rightarrow \frac{x}{y}=1+\sqrt{2} \Rightarrow \frac{a x}{y}=a(1+\sqrt{2})$.

Answer: $a(1+\sqrt{2})$ hours.