The length of a rectangle is 7 cm longer than 3 times the width. The perimeter is 78. Find the dimensions of the rectangle.