A galaxy beyond the constellation Corona Borealis is moving directly away from our Galaxy at the rate of 21600 km/s.
This galaxy is now at a distance of $1.4x10^9$ light-years from our galaxy.
We assume that the Galaxy is been moving always at a constant speed.
How many years ago was it right on top of our Galaxy?
Distance $s = 1.4x10^9 $ ly
Average speed $v = 21600 $ km/s
Time $t = \frac{s}{v}$
1 light-year = $9460730472580.8$ km
Distance = 1.4e9 # in ly
Ly = 9460730472580.8 #km
Distance_km = Distance * Ly
Speed_km_s = 21600 # in km/s
Speed_km_y = Speed_km_s * 3600 * 24 * 365.24
Time = Distance_km / Speed_km_y
# limit to 2 significant figures as distance is given in 2 significants too
print(f'The distance in km is {Distance_km:.1e}.')
print(f'The distance traveled in one year is {Speed_km_y:.1e}.')
print(f'The time needed to travel the distance is {Time:.1e} year.')