Necessary and sufficient conditions such that extended mean values are Schur-convex or Schur-concave