6. There are two flour mills supplying flour to three residential areas. The first flour mill produces 60 tons per month, and the second flour mill produces 100 tons per month. The first residential area requires 45 tons per month, the second residential area requires 75 tons per month, and the third residential area requires 40 tons per month. The distances from the first flour mill to the three residential areas are 10 km, 5 km, and 6 km, respectively. The distances from the second flour mill to the three residential areas are 4 km, 8 km, and 15 km, respectively. How should the flour be allocated to make the transportation most economical?
(1960, Shanghai City Mathematics Recontest)(Hint: Let the flour transported by the first flour mill to the first and second residential areas be $x, y$ tons, respectively. Thus, $s=15 x+6 y+840$, where $0 \leqslant x \leqslant 45,0 \leqslant y \leqslant 60 . x+y$ $\geqslant 20$. When $x=20, y=0$, $S_{\text {min }}=960$. The first flour mill delivers $0,20,40$ tons to the three areas, respectively; the second flour mill delivers 45, 55, 0 tons to the three areas, respectively.)