The diagram shows a rectangle that has been dissected into nine non-overlapping squares. The smallest two squares have side lengths of 2 and 5, respectively. Find the perimeter of the entire rectangle.
The perimeter of the rectangle is 242.