func_code_string: #include <bits/stdc++.h>   using namespace std;   long long t[45];   int n, i, k, m, kol, ans, ans2, j, l, ans3, ans1, sum;   void summ(int x) {     for (j = 0; j < k; j++) {       l = n - x;       while (ans2 <= m - t[j] and l > 0) {         l--;         ans2 += t[j];         kol++;       }     }   }   int main() {     cin >> n >> k >> m;     for (i = 0; i < k; i++) {       cin >> t[i];       sum += t[i];     }     i = 0;     sort(t, t + k);     for (i = 0; i <= n; i++) {       ans2 = 0;       kol = 0;       ans3 = 0;       if (sum * i > m) {         break;       }       if (sum * i == m) {         ans = max(ans, i * (k + 1));       }       ans2 = sum * i;       ans3 = (k + 1) * i;       summ(i);       ans3 += kol;       ans = max(ans, ans3);     }     cout << ans;     return 0;   }   