func_code_string: #include <bits/stdc++.h>   using namespace std;   using cd = complex<double>;   const long long INF = 1e15;   const int mod = 1e9 + 7;   const double Pi = acos(-1);   void Fastio() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);   }   int n, cnt = 0;   long long x, y;   bool Deg[200005];   vector<int> Adj[200005];   void DFS(int node, int p = -1) {     int c = 0;     for (auto x : Adj[node]) {       if (x != p) {         DFS(x, node);         if (Deg[x]) {           c++;         }       }     }     cnt += min(2, c);     if (c < 2) {       Deg[node] = true;     }   }   signed main() {     Fastio();     cin >> n >> x >> y;     for (int i = 1; i < n; i++) {       int u, v;       cin >> u >> v;       Adj[u].emplace_back(v);       Adj[v].emplace_back(u);     }     if (x >= y) {       for (int i = 1; i <= n; i++) {         if (Adj[i].size() == n - 1) {           cout << y * (n - 2) + x;           return 0;         }       }       cout << y * (n - 1);       return 0;     }     DFS(1);     cout << x * cnt + y * (n - 1 - cnt);   }   