By clever selection of ADC resistors.
This had been solved long time ago, and not by me