#include using namespace std; using ll=long long; int main(){ ll n; cin>>n; vector> G(n); for(ll i=0;i>u>>v; u--; v--; G[u].push_back(v); G[v].push_back(u); } vector v(n,0); for(ll i=0;i1){ ll sz=G[i].size(); for(ll u:G[i]){ v[u]+=max((ll)1,(sz-1)*(sz-2)); } } } for(ll i=0;i