#include <iostream> #include <vector> using namespace std; int dfs(int p,vector<vector<int>> &edges,vector<int> &nums,int &maxnum,int &minnum){ int ma=nums[p],mi=nums[p],n=0; for(auto a:edges[p]) n+=dfs(a,edges,nums,ma,mi); maxnum=max(maxnum...