John cycled to school and back.

The distance to school and back is 20 km.

On the way to school, John cycled atxkm per hour.

On his way back, John’s speed decreased by 2 km per hour.

It took 4 hours altogether to cycle to school and back.

Write an equation forx.