Minimum Adjustment Cost(LintCode 91):

Problem