The perimeter P of the rectagle is

where W is the width and H the height.
By substituting the given values into the perimeter, we have

which is equal to

and we need to isolate W. This can be obtained by moving +12 to the left hand side as -12. It yields,

and finally, W is given by

That is, each of the remaining sides measure 4 cm