First we calculate centre of mass of system let block A is at origin ( x=0 )
xCM​=10+25+1510(0)+25(10)+15(20)​xCM​=50550​=11mNow, 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 positionThen,xCM​=115010(2)+25(y)+15(17)​550=20+25y+25525y=550−275=275y=25275​=11mSo, block B should move 11−10=1 metre towards block C.