5.2.4.22 Various problems on the plane
Given a trapezoid with the sum of the base lengths 18 and the sides equal to 3 and 5. The straight line \( \ell \) intersects the bases so that the area of the trapezoid is divided in half and the perimeters of the two quadrangles into which the trapezoid is divided are in the ratio 8:9. Find the length of the line segment \( \ell \), the ends of which lie on the bases of the trapezoid.