Given a tree T with N nodes where each node i has Ci coins attached to it, explain how you would solve the problem efficiently.