Let total distance be x,
then for 3/5 distance time taken will be
= (3x/5)/40
since time= distance/ speed
similarly,
for remaining distance,
time taken= (2x/5)/60.
now total time,
(3x/5)/40 + (2x/5)/60= 6 1/2 hrs
=>3x/200+2x/300=6.5 hrs
=>900x+400x=6.5*300*200
=>1300x=390000
=>x=300
Total distance x = 300 km