The triangles are congruent by SSS, as indicated by the ticks through the sides. That means you can set corresponding side lengths equal to each and solve for x and y.
The corresponding sides are the sides which have the same amount of ticks; 4y + 8 corresponds to 24 and 7x - 4 corresponds to 31. Let's make the equations and solve.