func_code_string: #include <bits/stdc++.h>   using namespace std;   template <class T>   ostream &operator<<(ostream &str, vector<T> &a) {     for (auto &i : a) {       str << i <<    ;     }     return str;   }   template <class T>   istream &operator>>(istream &str, vector<T> &a) {     for (auto &i : a) {       str >> i;     }     return str;   }   template <class T>   ostream &operator<<(ostream &str, pair<T, T> &a) {     str << a.first <<     << a.second;     return str;   }   template <class T>   istream &operator>>(istream &str, pair<T, T> &a) {     str >> a.first >> a.second;     return str;   }   void solve();   signed main() {     srand(time(0));     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cout.setf(ios::fixed);     cout.precision(6);     solve();     return 0;   }   const long long MOD = 998244353, MAXN = 5e5 + 10, INF = 1e18 + 10, BASE = 37;   long long bin_pow(long long a, long long n) {     if (n == 0) {       return 1;     }     if (n & 1) {       return a * bin_pow(a, n - 1) % MOD;     } else {       long long tmp = bin_pow(a, n / 2);       return tmp * tmp % MOD;     }   }   void solve() {     long long n;     cin >> n;     vector<long long> c(n);     cin >> c;     sort((c).rbegin(), (c).rend());     long long ans = 0;     for (long long i = 0; i < n; ++i) {       ans = (ans + i * c[i] % MOD) % MOD;     }     cout << ans * bin_pow(n, MOD - 2) % MOD <<    ;     vector<long long> ps(n);     ps[0] = c[0];     for (long long i = 1; i < n; ++i) {       ps[i] = (ps[i - 1] + c[i]) % MOD;     }     for (long long k = 2; k <= n; ++k) {       ans = 0;       for (long long i = k - 1; i <= n - 1; i += k) {         ans = (ans +                ((i / k) * (ps[i] - (i - k == -1 ? 0 : ps[i - k]) + MOD)) % MOD) %               MOD;       }       if (n % k != 0) {         ans = (ans + ((n - 1) / k) *                          (ps[n - 1] -                           (n - 1 - n % k == -1 ? 0 : ps[n - 1 - n % k]) + MOD) %                          MOD) %               MOD;       }       cout << ans * bin_pow(n, MOD - 2) % MOD <<    ;     }   }   