Decrease the Sum of Digits

CodeForces - 1409D