Maximum Number of K-Divisible Components
Process a tree bottom-up and cut off every subtree whose total is divisible by k, passing other totals upward.
Process a tree bottom-up and cut off every subtree whose total is divisible by k, passing other totals upward.