Let’s draw the diagram for a better understanding.
DIAGRAM 1
Let the school be at a distance $x$ km from town $A.$ Then the distance of school from $B = (100-x)$ km.
DIAGRAM 2
Now, the distance traveled by $30$ students from town $A$ to school $=30x.$
And, the distance traveled by $100$ students from town $B$ to school $=(100)(100-x) =(10000-100x).$
So, the total distance traveled by $130$ students $D=30x + 10000-100x = 10000-70x.$
$D= f(x) = 10000-70x $
If the total expenditure on transport by all $130$ students is to be small,then $x=0.$
$\therefore$ The school should be built at town $A.$
Correct Answer $: \text{C}$