I don't just tell people my answers. But I'll help you to arrive at it.
First idea: assume equal intervals. Then the area under the linear pieces paired with is given by the trapezoidal rule
In looking at this formula, what values can I swap without changing the sum?