We have to find the least common multiple of 8 and 5.
Multiple of 5 = 5, 10, 15, 20, 25, 30, 35, 40, 45, 50
Multiples of 8 = 8, 16, 24, 32, 40, 48, 56, 64, 72, 80
40 is the least common multiple of 5 and 8.
So, they will complete the lap together after 40 min.