func_code_string: #include <bits/stdc++.h>   using namespace std;   long long n, d, m;   long long lin;   long long a[100007], b[100007], la, lb;   long long pa[100007], pb[100007];   long long ans;   void go(long long l, long long r, long long k) {     if (l > r) return;     long long mid = (l + r) / 2;     long long yu = min(n - ((mid - 1) * (d + 1) + 1), la);     long long now = pa[yu] + pb[mid];     if (now > ans) {       ans = now;       go(l, mid - 1, 2);       go(mid + 1, r, 1);     } else {       if (k == 1) {         go(l, mid - 1, 1);       } else {         go(mid + 1, r, 2);       }     }   }   int main() {     la = 0, lb = 0;     scanf( %lld%lld%lld , &n, &d, &m);     for (int i = 1; i <= n; i++) {       scanf( %d , &lin);       if (lin <= m) {         a[++la] = lin;       } else {         b[++lb] = lin;       }     }     sort(a + 1, a + 1 + la, greater<int>());     sort(b + 1, b + 1 + lb, greater<int>());     for (int i = 1; i <= la; i++) {       pa[i] = pa[i - 1] + a[i];     }     for (int i = 1; i <= lb; i++) {       pb[i] = pb[i - 1] + b[i];     }     long long l = 0, r = min((n - 1) / (d + 1) + 1, lb);     ans = 0;     go(l, r, 0);     printf( %lld n , ans);   }   