Back to the Problem
Track the four extremes in one pass; the area needs 64-bit arithmetic.
Complexity: O(N)