https://leetcode-cn.com/contest/biweekly-contest-51/problems/maximum-element-after-decreasing-and-rearranging/