The length of the sides of a triangle are in the ratio 3:5:7. The difference between the longest side and the shortest side is 24cm. What is the perimeter of the triangle?​