1800 to 1820 is 20 minutes.
1830 to 1838 is 8 minutes.
1840 to 1905 is 25 minutes.
The total time travelled is 20+8+25 = 53 minutes = 3180 seconds.
Since the question does not state the distance between Glasgow and Edinburgh, let the distance be X.
The average speed is X/3180 metres per second.
If your picture doesn't fully show the question and they tell you what the distance is, then replace X with the correct distance.