Number of path with given length within an unrooted Tree
Hint: divide-and-conquer.  How many paths are there of length C in the left subtree of the root?  How many in the right subtree?  How many others not covered by either of those two cases?