One side of a triangle is 4 cm longer than the shortest side and 2 cm shorter than the longest side. The perimeter is 38 cm. Find the dimensions of the triangle.