#include #define foreach(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i) #define BETWEEN(a, x, b) (a<=x&&x>n; vector vec(n); for(int i=0;i>a>>b; vec[a]++, vec[b]++; } int cnt=0; for(int i=1;i<=n;i++){ if(vec[i] == 1)cnt++; } if(cnt==2)cout<<0<