Let $n$ be the smallest integer that can be written as a sum of two squares in exactly three different ways. Then
$$n=x_1^2+x_2^2=x_3^2+x_4^2=x_5^2+x_6^2,$$
for some nonnegative integers $x_i$. Consider the prime factorization of $n$:
If $n$ is divisible by a prime $p\equiv3\pmod{4}$, then also the $x_i$ are all divisible by $p$. But then dividing the $x_i$ by $p$ shows that $\frac{n}{p^2}$ is a sum of two squares in exactly three different ways, contradicting the minimality of $n$.
Similarly, if $n$ is divisible by $4$ then reducing mod $4$ shows that all the $x_i$ are even. But then dividing the $x_i$ by $2$ shows that $\frac{n}{4}$ is a sum of two squares in exactly three different ways, contradicting the minimality of $n$.
If $n\equiv2\pmod{4}$ then reducing mod $4$ shows that all the $x_i$ are odd. But then the identity
$$\left(\frac{x_1+x_2}{2}\right)^2+\left(\frac{x_1-x_2}{2}\right)^2=\frac{x_1^2+x_2^2}{2}=\frac{n}{2},$$
shows that $\frac{n}{2}$ is a sum of two squares in exactly three different ways, contradicting the minimality of $n$.
This shows that all prime factors of $n$ are congruent to $1$ modulo $4$. Of course if $n$ is prime then it can be written as a sum of squares in only one way. If $n$ is a product of two primes then it can be written as a sum of squares in at most two ways. So $n$ must be a product of at least three primes congruent to $1$ mod $4$.
The smallest such number is $5^3=125$. If $125=x_i^2+x_j^2$ with $x_i>x_j$ then $x_i\geq8$ and of course $x_i\leq11$. It is then easy to check that $125$ can not be written as a sum of two squares in exactly three ways.
The next such number is $5^2\times13=325$. If $325=x_i^2+x_j^2$ with $x_i>x_j$ then $x_i\geq13$, and of course $x_i\leq18$. It is then easy to check that $325$ can be written as a sum of two squares in exactly three ways.
Best Answer
Hint:
To maximise $x$, we need to pay attention to the condition $x + e = 119$. The maximum possible is $x = 118$ as $e ≥ 1$, and with this value of $x$, it is possible to satisfy the other conditions (try it yourself!).
Then to minimise $x$, the largest three numbers should be consecutive, which results in $96 ≤ x$. When $x = 96, e = 23$, but then the remaining number is $320 - 23 - 283 = 14$, so $23$ is no longer the smallest number and $14 + 96 \ne 119$. Hence we need $283 + e = 320 - d$, and in the optimal case where $d = e+1$, what value of $x$ do we need?