This problem can be solved by Kepler's law. According to his
third law, P^2=a^3 or a^3= p^2
P = period in yrs,
a = the avg distance between the star and the planet in AU.
Since it's given that distance, a = 40 AU,
a^3 = 64000= P^2
or P = square root of 64000= 253 years.