This could require a somewhat complicated method to calculate the distance. You can work out the solution much more easily if you consider time as the most important factor:
Both cyclists will take an hour to reach the halfway point.
The dove flies back and forth for an hour between the two cyclists until they meet. Since the dove flies at a speed of 20 km/h (12.5 mph), it covers a total distance of 20 km.