With a linear time O(N) first pass you can identify the minimum element in the list. This reduces M from being the largest element to being the difference between the largest and the smallest element.
If we are playing with this, why not take one pass to find the largest element, then another pass to divide each element in the list by that number, leaving it 3N+M/M.
Edit:
Why divide by m, when you can divide by M*C. Where C will speed this portion up by a factor!
Edit:
Why divide by m, when you can divide by M*C. Where C will speed this portion up by a factor!