func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, q, step[1000000];   long long a[2 * 1000000], pref[2 * 1000000 + 1];   int calcLen(int strt) {     int curr = strt, res = 0;     while (curr < strt + n) curr += step[curr % n], res++;     return res;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cin >> n >> q;     for (int i = 0; i < (n); i++) cin >> a[i];     for (int i = 0; i < (n); i++) a[n + i] = a[i];     for (int i = 0; i < (2 * n); i++) pref[i + 1] = pref[i] + a[i];     for (int query = 0; query < (q); query++) {       long long b;       cin >> b;       int lo = 0, hi = 0;       while (lo < n) {         while (lo < n && (hi == lo + n + 1 || pref[hi] > pref[lo] + b)) {           step[lo] = hi - lo - 1;           lo++;         }         hi++;       }       int res = INT_MAX;       pair<int, int> mn = make_pair(INT_MAX, -1);       for (int i = 0; i < (n); i++)         if (step[(i + n - 1) % n] <= step[i]) mn = min(mn, make_pair(step[i], i));       for (int i = 0; i < (mn.first); i++)         res = min(res, calcLen((mn.second + i) % n));       cout << res <<   n ;     }   }   