
The diagram represents the locations of the masses as mentioned in the question.
For point 1, r1=0i^+0j^ for point 2, r2=3i^+0j^ and for point 3, r3=0i^+3j^.
The formula for centre of mass is
rcom=m1+m2+m3m1r1+m2r2+m3r3
⇒rcom=3MM(0i^+0j^)+M(3i^)+M(3j^)
⇒rcom=i^+j^
∣rcom∣=12+12=2=x
⇒x=2