#include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N = 210; int h[N],e[N],ne[N],idx; int sum[N]; void add(int a,int b){ e[idx] = b; ne[idx] = h[a]; h[a] = idx++; } int main() { memset(h,-1,sizeof h); int n,m; cin&g...