func_code_string: #include <bits/stdc++.h>   const int N = 2e5 + 10;   const int MOD = 1e9 + 7;   const int INF = 2e9;   using namespace std;   vector<int> a;   int f[N], d[N];   int c, n;   int main() {     ios::sync_with_stdio(false);     cin >> c >> n;     for (int i = 0; i < n; i++) {       int x;       cin >> x;       a.push_back(x);     }     sort(a.begin(), a.end());     for (int i = 1; i <= N; i++) d[i] = -1;     for (int i = 0; i < n; i++)       if (d[a[i]] == -1) d[a[i]] = i;     vector<int>::iterator it;     for (int i = 1; i <= c; i++) {       it = lower_bound(a.begin(), a.end(), i);       if (*it == i)         f[i] = it - a.begin();       else if (it > a.begin())         f[i] = it - a.begin() - 1;       else         f[i] = -1;     }     for (int i = 1; i < c; i++) {       int tmp = c, prev = n + 1;       bool ok = true;       while (1) {         int y = f[tmp];         if (y >= prev) y = prev - 1;         if (y < 0) {           cout << i;           return 0;         }         if (y == -1) {           cout << i;           return 0;         } else if (ok && a[y] <= i && i <= tmp) {           tmp -= i;           ok = false;         } else {           int x = a[y];           int pos = d[x];           int t1 = y - pos + 1;           int t2 = tmp / x;           if (t1 > t2) {             tmp -= t2 * x;             prev = y - t2 + 1;           } else {             tmp -= t1 * x;             prev = pos;           }         }         if (tmp == 0) break;       }     }     cout <<  Greed is good ;     return 0;   }   