**40 km**

Let distance be the x km and y be the usual speed and t be the time,

=> t = x/y......(1).

Since, speed is inversely prop. to time. i.e. faster speed -> slower time.

Now, original time(t)- slow time(t1) => x/y - x/y+3 = 40/60 => 9x = 2y(y+3)........(2).

And, fast time(t2) - original time(t) => x/y-2 - x/y = 40/60 => 6x = 2y(y-2)........(3)

So dividing (2) by (3) we get y=12 km/hr

Now put y= 12 in (2) we get,

9x = 24(12+3) => x = 24*15/9 = 5*8 = 40.

Hence distance = 40 km