func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = (int)(1e6 + 7);   const long long oo = (long long)(1e18);   const double esp = (double)1e-6;   const long long MOD = (long long)(1e9 + 7);   int n, x, y, fre[MAXN];   vector<int> adj[MAXN];   void dfs(int u, int t) {     if (u == t) return;     fre[u] = 0;     for (int i = 0; i < (int)adj[u].size(); i++) {       int v = adj[u][i];       if (fre[v]) {         dfs(v, t);       }     }   }   int main() {     while (cin >> n >> x >> y) {       for (int i = 1; i <= n; i++) adj[i].clear();       int a, b;       for (int i = 0; i < n - 1; i++) {         cin >> a >> b;         adj[a].push_back(b);         adj[b].push_back(a);       }       long long res = 1LL * n * (n - 1) / 2;       for (int i = 1; i <= n; i++) fre[i] = 1;       dfs(x, y);       long long cnt2 = 0, cnt1 = 0;       for (int i = 1; i <= n; i++) {         if (fre[i]) {           ++cnt1;         }         fre[i] = 1;       }       dfs(y, x);       for (int i = 1; i <= n; i++) {         if (fre[i]) {           ++cnt2;         }         fre[i] = 1;       }       long long z = cnt2 * cnt1;       cout << res + res - z << endl;     }     return 0;   }   