Adding the parts in the ratio gives 18 so there are two triangles possible with perimeters less than 54cm where the side lengths are all integers: a 5, 6, 7 triangle or a 10, 12, 14 triangle.
Therefore the length of the longest side must be either 7cm or 14cm (unless you want to include non-integer side lengths, then it could also be 3.5cm, 1.75cm etc)