Basically, you use the speed-distance-time formula.
Let the time for the walking section, the cycling section and the motoring section be a, b and c respectively.
For the walk:
x=7/a (1)
For the cycle:
4x=7/b
x=7/4b
a=4b
b=a/4 (2)
For the motoring part:
6x+3=36/c
Substituting in (1),
6(7/a)+3=36/c
(42/a)+3=36/c
(14/a)+1=12/c
c((14/a)+1)=12
c=12/((14/a)+1) (3)
Using the fact that (1)+(2)+(3) is 4 hours,
a+b+c
=a+0.25a+12/((14/a)+1)=4
1.25a+12/((14/a)+1)=4
125a+1200/(14/a+1)=400
125a+1200a/(14+a)=400
125a(14+a)+1200a=400(14+a)
125a2+1750a+1200a=400a+5600
125a2+2950a=400a+5600
125a2+2550a-5600=0
5a2+102a-224=0
Using the quadratic equation, we get solutions of a=2 or a=-112/5. Since x is positive, a is positive and hence a=2.
Using (1), x=7/2.
This means that the 7km walk is done at 3.5km/h, and this takes 2 hours.
It means that the 7km cycle is done at 14km/h, and this takes 0.5 hours.
It means that the 36km motoring is done at 3.5*6+3=24km/h, and this takes 1.5 hours.
So we have travelled 50km in 4 hours.