I'm naming the left shape shape A and the right one shape B to make things easier to understand:
If these are the same shapes we can assume that Shape A was reduced by a factor of 2.5 to form Shape B (10/4=2.5).
With this number we can solve for x by multiplying 5 by 2.5 since we are enlarging Shape B to create Shape A. 5*2.5 is 12.5 so x=12.5.
For the two other missing sides I did the same step except dividing instead because we are going from big to small.
Top side: 8/2.5= 3.2
Right side: 10/2.5= 4