An equilateral triangle has the same perimeter as a rectangle whose length is nine less than five times its width. If a side of the triangle is equal in length to the width of the rectangle, find the dimensions of each shape.