On a tree of N restaurants with demand A_i, maximize total delivered peppers in M time units, where each visit costs 1 to deliver and each edge costs 1 to traverse.
Medium7TreeDynamic programmingDFSBacktrackingNo attempts yetTime limit2sMemory limit64 MB