B-D freight: 18(300-X)
Freight for A-C: 20(240-X)
A-D freight: 25260-(300-X)
w = 15X+ 18(300-X)+20(240-X)+25260-(300-X)
That is W=2X+9200.
You'd better do it again ... it's good for you ~)
... you should understand ...