the solution of the MinAvgTwoSlice