From a rectangular sheet of paper, two squares are cut off as shown below:
The remaining rectangle should have area 24 squares centimetres. What should be the lengths of the sides of the squares?