func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007LL;   const int lmt = 1005;   const long long inf = 1LL << 62;   long long dp[lmt][lmt], a[lmt], req[lmt];   int n;   long long solve(int idx, int left) {     if (idx > n) return 0;     if (dp[idx][left] != -1) return dp[idx][left];     long long ans = min(a[idx], solve(idx + 1, left) + a[idx]);     if (left > 0) ans = max(solve(idx + 1, left - 1), ans);     return dp[idx][left] = ans;   }   void process() {     memset(dp, -1, sizeof(dp));     for (int i = 0; i <= n; i++) {       req[i] = solve(1, i);     }   }   int main() {     int q;     scanf( %d%d , &n, &q);     for (int i = 1; i <= n; i++) scanf( %lld , &a[i]);     process();     while (q--) {       long long val;       scanf( %lld , &val);       for (int i = 0; i <= n; i++) {         if ((req[i] + val) >= 0) {           printf( %d n , i);           break;         }       }     }     return 0;   }   