
1. Middle point is the point at which we want to break the segment [L;R]. In the DP we have to consider all possible positions for the break(middle) point ranging from L+1 to R1 inclusive. The mid(L,R) is the first middle point that gives optimal result for the (L,R) state.
2. The M positions of cuts plus beginning and the end are stored in the x vector. F.i. in the example test x = {0, 3, 8, 10, 20}. This array represents the required break points and it influences the DP results.
If you cannot understand the meaning of something from the text please refer to the code sample  it should be clear. 