crossing the river maths problem