I think this is the answer
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)
I believe it would be (9, 16). My reasoning for this is that if the slope is 1/3, then x would increase by 3 and y would increase by 1.
Let's say that, that equals some angle θ
thus

so.. .check your Unit Circle, what is that angle anyway?