Ashok and Karan cross together in 2 minutes.
Karan returns alone in 2 minutes.
Hakim and Ramesh cross together in 10 minutes.
Ashok returns alone in 1 minute.
Ashok and Karan cross together again in 2 minutes.
Total time taken is 2 + 2 + 10 + 1 + 2 = 17 minutes.