Count numbers in whose digit sum equals . Classic digit DP with sum tracking. State: .
Transition: try each digit, add to , check against at the end. improvement: if , prune. At position , max remaining sum is . If , prune. Answer = . Handle carefully.