Given squares $M$ and $N$ are inscribed in right triangle $ABC$ as shown in fig. If the area of $M$ is $441$ and area of $N$ is $440$, then find the area of the triangle $ABC.$
My attempt: I did some lengthy calculation and I ended up with the equation
$k^3-882k^2-400k+400×441=0$
Where $k=ab, a=BC, b=AC$

Let $x$ and $y$ be a sides-lengths of the squares with areas $M$ and $N$ respectively.
Thus, by the similarity we obtain: $$\frac{x}{b}=\frac{a-x}{a}$$ and $$\frac{\frac{ab}{\sqrt{a^2+b^2}}-y}{\frac{ab}{\sqrt{a^2+b^2}}}=\frac{y}{\sqrt{a^2+b^2}},$$ which gives $$x=\frac{ab}{a+b}$$ and $$y=\frac{ab\sqrt{a^2+b^2}}{a^2+ab+b^2}.$$ Thus, $$a+b=\frac{k}{21}$$ and we obtain: $$\frac{k\sqrt{\frac{k^2}{441}-2k}}{\frac{k^2}{441}-k}=\sqrt{440}$$ or $$\frac{\sqrt{\frac{k^2}{441}-2k}}{\frac{k}{441}-1}=\sqrt{440}$$ or $$441(k^2-2\cdot441k)=440(k-441)^2$$ or $$441(k-441)^2-441^3=440(k-441)^2$$ or $$(k-441)^2=\left(21^3\right)^2,$$ which gives $$k-441=21^3$$ or $$k=9702$$ and the area is equal to $4851.$