func_code_string: #include <bits/stdc++.h>   using namespace std;   long long read() {     long long x = 0, F = 1;     char c = getchar();     while (c <  0  || c >  9 ) {       if (c ==  - ) F = -1;       c = getchar();     }     while (c >=  0  && c <=  9 ) {       x = (x << 3) + (x << 1) + c -  0 ;       c = getchar();     }     return x * F;   }   int add(int x, int y) {     return (x + y >= 998244353) ? x + y - 998244353 : x + y;   }   int dec(int x, int y) { return (x - y < 0) ? x - y + 998244353 : x - y; }   int mul(int x, int y) { return 1LL * x * y % 998244353; }   int n;   pair<int, int> a[800000 + 5];   int dp[800000 + 5][7], pre[800000 + 5];   int ans[800000 + 5], pt[800000 + 5];   int cnt;   int main() {     n = read();     for (int i = 1; i <= n; i++) a[i] = pair<int, int>(read(), i);     sort(a + 1, a + n + 1);     memset(dp, 0x3f, sizeof(dp));     dp[1][1] = 0, pre[1] = 1;     for (int i = 2; i <= n + 1; i++) {       for (int j = 1; j <= 5; j++) {         dp[i][j + 1] =             min(dp[i][j + 1], dp[i - 1][j] - a[i - 1].first + a[i].first);         if (j >= 3) {           if (dp[i][1] > dp[i - 1][j]) {             dp[i][1] = dp[i - 1][j];             pre[i] = j;           }         }       }       if (dp[i][1] > dp[i - 1][6]) {         dp[i][1] = dp[i - 1][6];         pre[i] = 6;       }     }     printf( %d  , dp[n + 1][1]);     int p = n + 1;     while (p >= 1) {       int nxt = p - pre[p];       p = nxt;       cnt++;       ans[p] = cnt;     }     printf( %d n , cnt - 1);     for (int i = 1; i <= n; i++)       if (!ans[i]) ans[i] = ans[i - 1];     for (int i = 1; i <= n; i++) pt[a[i].second] = ans[i];     for (int i = 1; i <= n; i++) printf( %d  , pt[i]);   }   