Minimum sum of distance from entrance gate
I will try to give a solution. Tell me if I am mistaking anywhere.

First observation : When we have equal number of chairs and persons the solution is trivial.Ask all the people from 1st gate to fill chairs from start. then next gate starts where 1st gate stopped. I leave it to you to check that this is the optimal solution.

Second observation : We can use dynamic programming here and start removing chairs. (Here I must say I am sorry as my notations might not match with general notations but I will try my best)

Let us denote the first problem as $f(10,(4,5),(6,2),(10,2))$. 10 is number of chairs, rest are ordered pairs stating number of gate and number of people. Now we will start removing chairs. There are 4 cases : chair is removed before 1st gate or between 1st and 2nd gate or 2nd and 3rd gate or after 3rd gate.

Now we can make the following observation : $f(10,(4,5),(6,2),(10,2))=\min[f(9,(3,5),(5,2),(9,2)),f(9,(4,5),(5,2),(9,2)),f(9,(4,5),(6,2),(9,2))]=\min(19,20,18)=18$ (Note that there are 3 cases here as the 4th case doesn't make sense.)

Here as there are 9 people we get the result (of $f$ using the first observation) from here. This is how you can do the problems. There might even be more gates you just have to generalize the function.

Did you understand what I tried to do?