In special relativity, the length contraction of an object moving with speed v is given by

where
L is the measured length
L0 is the proper length
v is the speed of the object
c is the speed of light
In our problem, the measured length is 30 m while the proper length was 40 m, therefore if we re-arrange the equation we can calculate the speed of the spaceship:
