How to solve task? With simultaneous movement Sorry for my bad English. I was preparing for entry into physical and mathematical School high school in my city. But I am stuck while trying to solve this task:
On a river, at the same time from locations A and B, with the same speed, two boats sail towards each other. The boat coming from location A reached location B two hours after meeting the boat coming from location B, and the boat coming from location B reached location A 4.5 hours after meeting the boat that came from location A. How much more is the speed  of the boats as compared to the flow rate?
I was trying to make an equality, but it did not help me to solve the task.
S = 2(x+y) + 4,5(x-y)

x is the speed of the boat, y is flow rate
I do not have an idea how to solve this, thank you for helping.
 A: Assuming units of distance to be $km$ and that of time to be $hrs$.
Let the velocity of the river be $v$, in the direction from $A$ to $B$, and let the speed of the boats be $u$. Then, the velocity of the boat leaving from location $A$ (or boat $A$) will be $u+v$ from $A$ to $B$, and that of the boat leaving from location $B$ (or boat $B$) will be $u-v$ from $B$ to $A$. Let the distance between $A$ and $B$ be $d$. Let $t$ be time at which the two boats meet. Then, as $$\text{Distance}=\text{Speed}\times{Time}$$
For boat $A$,
$$\tag1d=(u+v)\times(t+2)$$
For boat $B$,
$$\tag2d=(u-v)\times(t+4.5)$$
Thus,
$$ut+vt+2u+2v=ut-vt+4.5u-4.5v$$
$$\tag32vt=2.5u-6.5v$$
Moreover, when the boats meet, the sum of distances covered by boat $A$ and boat $B$ is $d$. The time taken to meet is $t$. So,
$$\tag4d=(u+v)\times t+(u-v)\times t$$
Using $(1)$ and $(4)$,
$$ut+vt+2u+2v=2ut$$
$$ut-vt=2u+2v$$
$$t=\frac{2(u+v)}{u-v}$$
Using in $(3)$,
$$\frac{4v(u+v)}{u-v}=2.5u-6.5v$$
$$4uv+4v^2=2.5u^2-6.5uv-2.5uv+6.5v^2$$
$$2.5u^2-13uv+2.5v^2=0$$
$$5u^2-26uv+5v^2=0$$
$$5u^2-25uv-uv+5v^2=0$$
$$5u(u-5v)-v(u-5v)=0$$
$$(5u-v)(u-5v)=0$$
The speed of the boat must be more than that of the river.
Thus, $$u=5v$$
Thus, the speed of the boat is $5$ times the flow rate.
