The perimeters of rectangles and squares