Then->; D is 200-X,
Because the cost of transporting two villages to warehouse C is relatively low, warehouse C must be full in order to make the freight lowest.
Then b->; The transportation volume of c is 260-X,
Then b->; D is 300-(260-x) = 40+x.
So the freight of A is 20*X+25*(200-X)=5000-5X.
The cost of b is15 * (260-x)+18 * (40+x) = 3x+4620.
B-A=8X-380
X is an integer from 0 to 200, 8X-380 & gt;; 0,X & gt47.5,
Therefore, when x takes 0 to 47, the freight of B is greater than that of A,
When x takes 48 to 200, the freight of A is greater than that of B.
(2)
B freight 3x+4620
When the sum of the two villages' freight is 9620-2X and X=70, the sum of the two villages' freight is the least, which is 9620-2*70=9480 yuan.