Why is $ab+bc+ac = 0$ in some situation? This is originally a Computer Science question, but I ran a equation that is too hard to solve. Here goes.
So the problem is quite simple, given positive integers $a$, $b$, $c$, and calculate $\sqrt{a^2+b^2+c^2}$
But here's the problem, if I calculate any of the squares, I will trigger an integer overflow, where the computer have not enough allocated space to save the result.
So the problem gives me an additional condition: the difference between the minimum of the three and the bigger other two is perfect squares.
That said, if $c$ is the smallest of the three. $b-c$ and $a-c$ will both be perfect squares. And the answer itself is an integer, which means $a^2+b^2+c^2$ is also a perfect square.
So, here's what I got so far.
assume $c$ is the smallest of the three.
let $m=\sqrt{a-c}$, and $n=\sqrt{b-c}$, so $2m^2n^2=2ab-2ac-2bc+2c^2$
and $a^2+b^2+c^2=(a+b-c)^2-2ab+2ac+2bc$
Organize the two, and I am able to get:
$(a+b-c)^2-2(a-c)(b-c)=a^2+b^2+c^2$
And the answer to this problem simply output: $a+b-c$, so $2(a-c)(b-c)$ must be zero under the given condition.
Here's some sample to test it out.
2, 2, 1   - 3
3, 6, 2   - 7
4, 12, 3  - 13

And the following is wrong, since $\sqrt{a^2+b^2+c^2}$ is not an integer:
2, 5, 1   - 6, which is wrong, should be sqrt(30)
7, 6, 6   - 7, which is wrong, should be 11, here's what I think
          - it violate the clues set by the problem. The problem state
          - the smallest ONE, and the bigger TWO.

P.S. I tagged it under elementary number theory, if you think it's better off to be somewhere else, comment below. Need more information? Comment below. Thanks!

In your question you say:
So the problem gives me an additional condition: the difference between the minimum of the three and the bigger other two is perfect squares.
That said, if c is the smallest of the two. $b−c$ and $a−c$ will both be perfect squares. And the answer itself is an integer, which means $a^2+b^2+c^2$ is also a perfect square.
The second paragraph contradicts the first-the first only guarantees that one of $a-c$ and $b-c$ is a square.  If the numbers are as you say, you will still get overflow of $(a+b-c)^2$, which is greater than $a^2$
Your derivation is incorrect.  $2m^2n^2=2(a-c)^2(b-c)^2=2(a^2-2ac+c^2)(b^2-2bc+c^2)$ which has a term $2a^2b^2$
