We want to hike over a direct route from starting point $s$ to finish point $f$. We're given a list $p_1<p_2< \dots <p_n$ where the hotel at index $i$ is located $p_i$ kilometers from the start of the route. Throughout the travel we stop each night at a different hotel. The travel is time limited therefore we must finish the travel over $t$ days ($t<n$). The difficulty of walking a certain day is defined as $d^2$, the square of distance traveled.
We want to choose the stops in such a way that we minimize the sum of difficulty over the course of the travel (such that the overall difficulty is the lowest). Find the recurrence relation which describes the problem.
I encountered this problem in the context of dynamic programming. I don't understand how the problem can be described with a recurrence relation here.
This is a sample I drew:
For example we need to plan the travel for $2$ days. Then wouldn't we choose the distances from $p_1$ to $p_2$ and from $p_2$ to $p_3$ as they are minimal distances and hence will yield minimal squares?
Isn't this a matter of just sorting the distances and choosing $t$ minimal ones?