Consider a rectangular box, the sum of the lengths of its twelve edges is 140, and the distance from one corner of the box to the farthest corner is 21. Then, the total surface area of the box is 
(A) 776 
(B) 784 
(C) 798 
(D) 800
4. (B).

Let the length, width, and height of the rectangular prism be $a, b, c$, respectively. Then, according to the problem, we have $4(a+b-c)=140, a^{2}+b^{2}+c^{2}=21^{2}$, so $2(ab+bc+ca)=(a+b+c)^{2}-\left(a^{2}+b^{2}+c^{2}\right)=35^{2}-441=784$.