Answer: 1 hour
Explanation:
Let the distance they walked be
in time
and the distance they walked be
in time
,then
Walking speed=


Riding speed=


Also the total time taken=3 hours
∴
...(1)
Since the total distance= 20 km
∴
![d_1+d_2=20\\\Rightarrow4t_1+12t_2=20\\\Rightarrow4t_1+12(3-t_1)=20..............[\text{from (1)}]\\\Rightarrow4t_1+36-12t_1=20\\\Rightarrow-8t_1=-8\\\Rightarrow\ t_1=1](https://img.qammunity.org/2020/formulas/mathematics/middle-school/aj6sa7b6ojf9mth63gn41lvve79o2xc52n.png)
Thus, the they spent 1 hour time in walking.