func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize(2)   #pragma GCC optimize(3)   #pragma GCC optimize(4)   using namespace std;   const int N = 9;   const int C = 840;   int n;   long long dp[C * N];   long long cnt[N], M;   int main() {     scanf( %lld , &M);     for (int i = 1; i < N; ++i) scanf( %lld , &cnt[i]);     memset(dp, -1, sizeof(dp));     dp[0] = 0;     for (int i = 1; i < N; ++i) {       for (int j = C * N - 1; j >= 0; --j) {         int c = C / i;         if (cnt[i] < c) c = cnt[i];         for (int k = 1; k <= c; ++k) {           if (j - k * i >= 0) {             if (~dp[j - k * i])               dp[j] = max(dp[j], dp[j - k * i] + (cnt[i] - k) / (C / i));           }         }       }     }     long long ans = 0;     for (int i = 0; i < (N - 1) * C; ++i) {       if (~dp[i]) {         if (M >= i) ans = max(ans, i + min(dp[i], (M - i) / C) * C);       }     }     printf( %lld n , ans);     return 0;   }   