Two bodies move from $A$ to $B$. The first body covers $a$ meters more per second than the second, and it completes the entire journey in $t$ seconds. The second body covers $b$ meters more in the same time than $\frac{p}{q}$ of the distance. What is the distance $AB$, and what is the speed of each body?
Suppose the second object travels $x$ meters per second, then the first object travels $(x+a)$ meters per second, and thus $(x+a) t = A B$.

According to the problem,

$$
t x = \frac{p}{q} \cdot A B + b = \frac{p}{q}(x+a) t + b
$$

which means

$$
q t x = p t x + a p t + b q
$$

from which the speed of the second object is

$$
x = \frac{a p t + b q}{t(q-p)} \text{m} \text{sec}^{-1}
$$

from this, the speed of the first object is

$$
x + a = \frac{a p t + b q + a t q - a p t}{t(q-p)} = \frac{q(a t + b)}{t(q-p)} \text{m} \text{sec}^{-1}
$$

and thus

$$
A B = (x + a) t = \frac{q(a t + b)}{q-p} = \frac{a t + b}{1 - \frac{p}{q}} \text{~m}
$$

For $a > 0, b \geq 0, t > 0$, it is reasonable that $\frac{p}{q} < 1$, which means $q > p$, so $q - p > 0$, and thus the solution always exists in these cases. In other cases (e.g., $a < 0$), the solution may not exist.