Denote the vertices of the dodecagon as on Fig. 21. Since QI=AS and IS=QA, we have
DQ+QI+IS+SG=DQ+AS+QA+SG=DA+AG.
Similarly we obtain ER+RK+KP+PB=EA+AB. Therefore
CD+DQ+QI+IS+SG+GF+FE+ER+RK+KP+PB+BC=CD+DA+AG+GF+FE+EA+AB+BC=AB+BC+CD+DA+AE+EF+FG+GA.
So the sum of the perimeters of the squares ABCD and AEFG is equal to the perimeter of the dodecagon (72 cm).

Since QA=IS, AP=RK, SA=IQ and AR=PK, we have
AP+PH+HQ+QA+AR+RJ+JS+SA=RK+PH+HQ+IS+PK+RJ+JS+IQ=HI+IJ+JK+KH.
So the perimeter of the square HIJK is equal to the sum of the perimeters of the rectangles APHQ and ARJS. However we are given that the sum of the perimeters of APHQ and ARJS is equal to one fifth of the sum of the perimeter of ABCD, the perimeter of AEFG and twice the perimeter of HIJK.
Denoting the side length of HIJK by x cm, its perimeter will be 4x cm. Then we can combine the relations of the previous two paragraphs into the equation
4x=51(72+2⋅4x).
Solving it, we obtain 4x=24, which gives x=6. So the side length of the square HIJK is 6 cm.