A rope is cut into 3 pieces in the ratio of 5:3:1. The longest piece is 32 meters longer than the shortest piece. Find the length of the rope.

Please include your whole solution and step-by-step explanation on how you got the answer.