func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:200000000 )   using namespace std;   template <typename T>   inline T Abs(T x) {     return (x >= 0) ? x : -x;   }   template <typename T>   inline T sqr(T x) {     return x * x;   }   template <typename T>   string toStr(T x) {     stringstream st;     st << x;     string s;     st >> s;     return s;   }   inline int nextInt() {     int x;     if (scanf( %d , &x) != 1) throw;     return x;   }   inline long long nextInt64() {     long long x;     if (scanf( %I64d , &x) != 1) throw;     return x;   }   inline double nextDouble() {     double x;     if (scanf( %lf , &x) != 1) throw;     return x;   }   const int INF = (int)1E9;   const long long INF64 = (long long)1E18;   const long double EPS = 1E-9;   const long double PI = 3.1415926535897932384626433832795;   const int MAXN = 100100;   unsigned long long d[MAXN], ans;   vector<int> g[MAXN];   int n;   unsigned long long DFS(int v, int prev) {     if (prev != -1) g[v].erase(find((g[v]).begin(), (g[v]).end(), prev));     d[v] = 0;     long long sum2 = 0;     for (int i = 0; i < (int)(g[v].size()); i++) {       unsigned long long cur = DFS(g[v][i], v);       sum2 += 1LL * d[v] * cur;       d[v] += cur;     }     d[v]++;     ans -= sqr(sum2);     ans -= 2LL * sum2 * ((n - d[v] + 1) * d[v] - 1);     ans -= 2LL * (d[v] - 1) * ((n - d[v] + 1) * d[v] - 1) - sqr(d[v] - 1);     return d[v];   }   int main() {     n = nextInt();     for (int i = 0; i < (int)(n - 1); i++) {       int v = nextInt() - 1;       int u = nextInt() - 1;       g[v].push_back(u);       g[u].push_back(v);     }     ans = sqr(1LL * n * (n - 1) / 2);     DFS(0, -1);     cout << ans << endl;     return 0;   }   