Example: First line contains number of nodes and initial power Next n-1 lines contains node-node-cost-profit 5 4 1 2 1 2 1 3 2 3 1 4 2 4 4 5 2 2 Answer => 7. We can start from 4 and go to 1 and than to 3.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)