func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<int> q[200010], g[200010];   int n, m, a[200010], b[200010];   unsigned long long A, B, C, ans;   unsigned long long calc(unsigned long long a, unsigned long long b,                           unsigned long long c) {     unsigned long long s[3] = {a, b, c};     sort(s, s + 3);     return s[0] * A + s[1] * B + s[2] * C;   }   int main() {     scanf( %d%d , &n, &m);     scanf( %lld%lld%lld , &A, &B, &C);     for (int i = 1; i <= m; i++) {       scanf( %d%d , &a[i], &b[i]);       if (a[i] > b[i]) swap(a[i], b[i]);       q[a[i]].push_back(b[i]), q[b[i]].push_back(a[i]);     }     for (int i = 0; i < n; i++) {       ans += (unsigned long long)i * A *              ((unsigned long long)(n - i - 1) * (n - i - 2) / 2LL);       ans += (unsigned long long)i * B * ((unsigned long long)(i) * (n - i - 1));       ans +=           (unsigned long long)i * C * ((unsigned long long)(i) * (i - 1) / 2LL);     }     for (int i = 1; i <= m; i++) {       ans -= (unsigned long long)a[i] * a[i] * B +              (unsigned long long)a[i] * b[i] * C +              (unsigned long long)a[i] * (a[i] - 1) / 2LL * A;       ans -= (unsigned long long)(b[i] - a[i] - 1) * a[i] * A +              (unsigned long long)(b[i] - a[i] - 1) * b[i] * C +              (unsigned long long)(b[i] - a[i] - 1) * (a[i] + b[i]) / 2LL * B;       ans -= (unsigned long long)(n - b[i] - 1) * a[i] * A +              (unsigned long long)(n - b[i] - 1) * b[i] * B +              (unsigned long long)(n - b[i] - 1) * (n + b[i]) / 2LL * C;     }     for (int i = 0; i < n; i++) sort(q[i].begin(), q[i].end());     for (int i = 0; i < n; i++) {       unsigned long long pre = 0, pre_tot = 0;       for (int j = 0; j < q[i].size(); j++) {         int to = q[i][j];         if (to > i) continue;         ans += pre_tot * i * C + pre * A + to * pre_tot * B;         pre += to;         pre_tot++;       }       unsigned long long nex = 0, nex_tot = 0;       for (int j = 0; j < q[i].size(); j++) {         int to = q[i][j];         if (to < i) continue;         ans += nex_tot * i * A + nex * B + to * nex_tot * C;         nex += to;         nex_tot++;       }       ans += pre_tot * nex_tot * i * B + pre_tot * nex * C + nex_tot * pre * A;     }     for (int i = 1; i <= m; i++) {       if (q[a[i]].size() < q[b[i]].size())         g[a[i]].push_back(b[i]);       else         g[b[i]].push_back(a[i]);     }     for (int i = 0; i < n; i++) sort(g[i].begin(), g[i].end());     for (int i = 1; i <= m; i++) {       int t1 = 0, t2 = 0;       while (t1 < g[a[i]].size() && t2 < g[b[i]].size()) {         if (g[a[i]][t1] < g[b[i]][t2])           t1++;         else if (g[a[i]][t1] > g[b[i]][t2])           t2++;         else {           ans -= calc(a[i], b[i], g[a[i]][t1]);           t1++, t2++;         }       }     }     printf( %llu n , ans);     return 0;   }   