merge and split trick maths