Count Non Adjacent Subsets in a Rooted Tree
Process the tree bottom-up, tracking for each node the subset counts by sum modulo k with and without the node picked.
Process the tree bottom-up, tracking for each node the subset counts by sum modulo k with and without the node picked.