REASONING and maths solution