func_code_string: #include <bits/stdc++.h>   template <class T>   inline bool chmax(T& a, T b) {     if (a < b) {       a = b;       return 1;     }     return 0;   }   template <class T>   inline bool chmin(T& a, T b) {     if (a > b) {       a = b;       return 1;     }     return 0;   }   const long long MAX = 5100000;   const long long INF = 1LL << 60;   const long long mod = 1000000007LL;   using namespace std;   long long t[200500];   long long tmp[200500];   int main() {     long long n;     scanf( %lld , &n);     long long a[3];     scanf( %lld %lld %lld , &a[0], &a[1], &a[2]);     sort(a, a + 3);     multiset<long long> ms;     for (long long i = 0; i < n; i++) {       scanf( %lld , &t[i]);       ms.emplace(t[i]);     }     if (*ms.rbegin() > a[0] + a[1] + a[2]) {       puts( -1 );       return 0;     }     long long res = 0;     while (!ms.empty() && *ms.rbegin() > a[1] + a[2]) {       res++;       ms.erase(--ms.end());     }     while (!ms.empty() && *ms.rbegin() > a[0] + a[2]) {       res++;       ms.erase(--ms.end());       auto itr = ms.upper_bound(a[0]);       if (itr == ms.begin()) continue;       itr--;       ms.erase(itr);     }     while (!ms.empty() && *ms.rbegin() > a[2] && *ms.rbegin() > a[0] + a[1]) {       res++;       ms.erase(--ms.end());       if (ms.empty()) break;       auto itr = ms.upper_bound(a[1]);       if (itr == ms.begin()) continue;       itr--;       ms.erase(itr);     }     while (!ms.empty()) {       res++;       if (a[0] + a[1] <= a[2]) {         ms.erase(--ms.end());         if (ms.empty()) break;         if (*ms.begin() <= a[0]) {           ms.erase(ms.begin());           if (ms.empty()) break;           auto itr = ms.upper_bound(a[1]);           if (itr == ms.begin()) continue;           itr--;           ms.erase(itr);         } else if (*ms.begin() <= a[0] + a[1]) {           auto itr = ms.upper_bound(a[1] + a[0]);           itr--;           ms.erase(itr);         }       } else {         if (*ms.rbegin() <= a[2]) {           auto itr = ms.upper_bound(a[1]);           if (!(*ms.begin() > a[0] || itr == ms.begin() || itr == ++ms.begin())) {             ms.erase(--ms.end());             if (ms.empty()) break;             ms.erase(ms.begin());             if (ms.empty()) break;             auto itr = ms.upper_bound(a[1]);             itr--;             ms.erase(itr);             continue;           }         }         ms.erase(--ms.end());         auto itr = ms.upper_bound(a[2]);         if (itr != ms.begin()) {           itr--;           ms.erase(itr);         }       }     }     printf( %lld n , res);     return 0;   }   