4. Linear function. The distance between villages $\mathcal{A}$ and $B$ is 3 km. In village $\mathcal{A}-300$ students, and in village $B-$ 200 students. Where should a school be built to minimize the total distance traveled by students on their way to school?
4. It is clear that the school should be built on the segment $A B$, but where exactly? Let the distance from village $A$ to the school be $x$, then the total distance traveled by all schoolchildren on the way

![](https://cdn.mathpix.com/cropped/2024_05_21_b6bdef2bf90cccc464adg-077.jpg?height=385&width=560&top_left_y=1926&top_left_x=1136)

77 What is the best?

to school is $f(x)=300 x+200(a-x)=200 a+100 x$, where $a-$ is the length of segment $A B$. The minimum value of $f(x)$ is achieved at $x=0$. Therefore, the school should be built in village $A$.