4. On a highway, there is a warehouse every hundred kilometers, with a total of five warehouses. Warehouse No.1 has 10 tons of goods, Warehouse No.2 has 20 tons of goods, and Warehouse No.5 has 40 tons of goods, while the other two warehouses are empty. Now, it is desired to consolidate all the goods in one warehouse. If the transportation cost is 0.5 yuan per ton per kilometer, what is the minimum transportation cost required?
4.【Solution】If the goods in location A are more than those in location B, then transporting goods from location B to location A is cheaper than transporting goods from location A to location B. 

Therefore, 10 tons of goods should be transported from Warehouse No.1 to Warehouse No.2. Similarly, these $(10+20)$ tons of goods should be transported from Warehouse No.2 to Warehouse No.5,
$$
\text { for a total cost of }(10 \times 400+20 \times 300) \times 0.5=5000 \text { (yuan) }
$$

Answer: The minimum cost is 5000 yuan.