First we calculate centre of mass of system let block A is at origin ( x=0 )
‌xCM=‌
10(0)+25(10)+15(20)
10+25+15
‌xCM=‌
550
50
=11m Now, new position of block A with respect to origin is x=2m and new position of block C,x=20−3=17m. Let new position of block B with respect to origin is Y, so that centre of mass remains at same position Then, xCM‌=11=‌
10(2)+25(y)+15(17)
50
550‌=20+25y+255 25y‌=550−275=275 y‌=‌
275
25
=11m So, block B should move 11−10=1 metre towards block C.