\(B=\left|x-1\right|+2\left|x-2\right|+3\left|x-3\right|+4\left|x-4\right|+5\left|x-5\right|\)
\(=\left(\left|x-1\right|+\left|x-5\right|\right)+2\left(\left|x-2\right|+\left|x-5\right|\right)+2\left(\left|x-3\right|+\left|x-5\right|\right)+\left(\left|x-3\right|+\left|x-4\right|\right)+3\left|x-4\right|\)
\(B\ge\left|x-1+5-x\right|+2\left|x-2+5-x\right|+2\left|x-3+5-x\right|+\left|x-3+4-x\right|+3\left|x-4\right|\)
\(=4+2.3+2.2+1+3.0\)
= 15
B min = 15 khi x =4