func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   vector<int> graph[80005];   bool vis[100005];   long long int size[100005];   long long int arr[100005];   long long int ans2;   long long int ans;   int dfs1(int node) {     vis[node] = true;     int ret = 1;     for (int i = 0; i < graph[node].size(); i++) {       if (vis[graph[node][i]]) continue;       ret += dfs1(graph[node][i]);     }     return (size[node] = ret);   }   void dfs2(int node, long long int cum) {     vis[node] = true;     long long int rem = n - size[node];     int i;     long long int sum = 0, sqsum = 0, temp;     for (i = 0; i < graph[node].size(); i++) {       if (vis[graph[node][i]]) continue;       temp = size[graph[node][i]];       sum += temp;       sqsum += temp * temp;     }     long long int paths = (sum * sum - sqsum) / 2 + sum;     ans += (rem * (rem - 1) / 2) * paths;     ans2 += cum * paths;     for (i = 0; i < graph[node].size(); i++) {       if (vis[graph[node][i]]) continue;       temp = size[graph[node][i]];       dfs2(graph[node][i], cum + (-(sum - temp) + (sqsum - temp * temp)) / 2);     }   }   int main() {     int i, a, b;     scanf( %d , &n);     for (i = 0; i < n - 1; i++) {       scanf( %d , &a);       scanf( %d , &b);       graph[a].push_back(b);       graph[b].push_back(a);     }     memset(vis, 0, sizeof(vis));     dfs1(1);     ans = 0;     ans2 = 0;     memset(vis, 0, sizeof(vis));     dfs2(1, 0);     ans = 2 * ans - ans2;     printf( %lld n , ans);     return 0;   }   