Let us consider incline surfaces of wedge as `x`-axis and `y`-axis respectively. We can write accelerations of blocks `A` and `B`.
`veca_(A)=mg sin 30^(@) hati` and `veca_(B)=mg cos 30^(@)hatj`
The acceleration of centre of mass of two blocks can be written as
`veca_(cm)=(m_(A)veca_(A)+m_(B)veca_(B))/(m_(A)+m_(B))=(mgsin30^(@)hati+mgsin60^(@)hatj)/(m+m)`
`(gsin30^(@)hati+gsin60^(@)hatj)/2`
`=g/4hati+(sqrt(3)g)/4hatjimplies |veca_(cm)|=g/2`