Sam traveled 20 miles in 3 hours.

Sam walked part of the distance at a speed of 4 miles per hour.

Sam rode his bicycle for the remaining distance at a speed of 12 miles per hour.
note: this question has been asked before but i do not believe it was answered correctly, it was solved using 4 hours instead of 3