static int lengthPunishment(int actualLength, int pivotLength) { ret pivotLength <= 0 ? 0 : max(0, actualLength-pivotLength); }