Minimum Operations to Maximize Last Elements in Arrays