4. As shown in Figure $1, D$ and $E$ are points on the sides $AB$ and $AC$ of $\triangle ABC$, respectively. The perimeters of $\triangle ACD$ and $\triangle BCD$ are equal, and the perimeters of $\triangle ABE$ and $\triangle CBE$ are equal. Let the area of $\triangle ABC$ be $S$. If $\angle ACB=90^{\circ}$, then the relationship between $AD \cdot CE$ and $S$ is ( ).
(A) $S=AD \cdot CE$
(B) $S>AD \cdot CE$
(C) $S<AD \cdot CE$
(D) Cannot be determined
4. A.

Let $B C=a, C A=b, A B=c$. From the problem, we know $A D+A C=B C+C E=\frac{1}{2}(a+b+c)$. Therefore, $A D=\frac{1}{2}(a+c-b), C E=\frac{1}{2}(b+c-a)$. Thus, $A D \cdot C E=\frac{1}{4}(a+c-b)(b+c-a)$ $=\frac{1}{4}\left[c^{2}-(a-b)^{2}\right]$ $=\frac{1}{4}\left(c^{2}-a^{2}-b^{2}\right)+\frac{1}{2} a b$. 
Given $\angle A C B=90^{\circ}$, we know $a^{2}+b^{2}=c^{2}, S=\frac{1}{2} a b$.
Therefore, $A D \cdot C E=S$.