Optimized max and min.
With same currency, the time is reduce to 1/2.
With different currencies, the time is reduced to 1/4.