Let the total distance be x km.
Part of the journey travelled by train =35 of x=3x5km
Part of the journey travelled by taxi =14 of x=x4 km
Part of the journey tracvelled by bus 18 of x=x8 km.
Total journey travelled by vehicles
=3x5+x4+x8km
=24x+10x+5x40km
=39x40km
Remaining journey travelled on foot
=x−39x40km
=40x−39x40 km
=x40km
According to the question x40=6
⇒ x=6×40km
=240km
Hence the total distance is 240km