There are two pieces of wire. The length of one is equal to the perimeter of the square, and the length of the second is equal to the perimeter of the rectangle. Together they are length P.
P = perimeter of square + perimeter of rectangle
P = 20 cm + perimeter of rectangle
perimeter of rectangle = P - 20 cm
square with length 2 cm has perimeter 4(2 cm) = 8 cm
rectangle width = 2(2 cm) = 4 cm
rectangle length = 3(2 cm) = 6 cm
rectangle perimeter = 2(4 cm) + 2(6 cm) = 20 cm
P = 20 cm + 8 cm = 28 cm