Geometry - Rectangle ABCD with inside point E. Find the least possible value for sum of interger distances from E to 4 vertices. 
The point E lies within the rectangle ABCD.
If the distances from the vertices to E are all distinct integers, what is the least possible value of AE + BE + CE + DE?

Suppose we have such rectangle.  Place it on a coordinate system so that the $E$ is on $(0,0)$ and $A = (-a, b); B= (-a,-c), C=(d,b); D=(d,-c)$ and we need for $\sqrt{a^2 + b^2}=m, \sqrt{a^2+c^2}=n, \sqrt{d^2 + b^2}=r, \sqrt{d^2+c^2}=s$ are all integers.
We must have $m^2 +s^2 = n^2 + r^2$ and that simply requires finding the smallest integer that is a sum of two distinct perfect squares in two possible ways that will have the smallest sum.
$m^2 + s^2 = n^2 + r^2 \implies m^2-n^2 = r^2 - s^2 \implies (m+n)(m-n)=(r+s)(r-s)$.
Now $m+n, m-n$ must be the same parity and and we could do $r+s=5, r-s=3$ and $m+n=15, m-n=1$ so $m=8;n=7;r=4;s=1$.  This would be the smallest set of four distinct  values for $m-n,r-s,r+s,m+n$.  And so $s+r+n+m=20$.
And $8^2 + 1^2 = 7^2 + 4^2=65$ is a probably this smallest such integer.
(I'm not sure how to verify this other than trial and error.  Oddly enough taking even values $m-n=2, r-s=4,r+s=6,m+n=12$ so $r=5;s=1;n=5;m=7$ gives us a smaller integer $7^2+1=5^2 + 5^2=50$ and as smaller sum of $18$ but the terms are not distinct.)
So we need $a^2 + b^2= 64; a^2+c^2=49; d^2+b^2=16; d^2 + c^2 =1$.
$d^2=1-c^2$ and so $a^2 + b^2 = 64; a^2+c^2=49; b^2-c^2=15$
$b^2 = 15+c^2$ and so $a^2+c^2=49$. So we need $0< c^2 <1$ the$1> d^2=1-c^2>0$, $b^2 = 15+c^2> 15$ and $a^2 = 49-c^2> 48$ are possible rectangles.
