func_code_string: #include<set>   #include<map>   #include<stack>   #include<cmath>   #include<queue>   #include<cstdio>   #include<vector>   #include<climits>   #include<cstdlib>   #include<cstring>   #include<iostream>   #include<algorithm>   #define LL long long   using namespace std;   LL read(){    bool f=0;LL x=0;char c=getchar();    while(c< 0 || 9 <c){if(c== - )f=1;c=getchar();}    while( 0 <=c&&c<= 9 ) x=(x<<3)+(x<<1)+(c^48),c=getchar();    return !f?x:-x;   }   typedef pair<long double,long double> pii;   #define mp make_pair   #define fi first   #define se second   #define lch (u<<1)   #define rch (u<<1|1)   const long double eps=1e-10;   const int MAXN=200000;   const int INF=0x3f3f3f3f;   LL a[MAXN+5];   vector<pair<int,LL> > Tu[5*MAXN+5];   bool K(pii p,pii a,pii b){if(p.fi==a.fi) return 1;return (p.se-a.se)/(p.fi-a.fi)>=(p.se-b.se)/(p.fi-b.fi);}   void Build(int u,int L,int R){    if(L==R){     Tu[u].push_back(mp(L,a[L]));     return ;    }    int Mid=(L+R)>>1;    Build(lch,L,Mid),Build(rch,Mid+1,R);    Tu[u]=Tu[lch];    int lst=Tu[u].size()-1;    for(int i=0;i<Tu[rch].size();i++){     while(lst&&K(Tu[u][lst-1],Tu[u][lst],Tu[rch][i])) Tu[u].pop_back(),lst--;     Tu[u].push_back(Tu[rch][i]),lst++;    }    return ;   }   pair<long double,int> P[MAXN+5];   int Query(int u,int L,int R,int qL,int qR,int pos){    if(qL<=L&&R<=qR){     int siz=Tu[u].size();     int le=0,ri=siz;     while(le+1<ri){      int mid=(le+ri)>>1;      if(K(mp(pos,a[pos]),Tu[u][mid-1],Tu[u][mid])) le=mid;      else ri=mid;     }     return Tu[u][le].first;    }    int Mid=(L+R)>>1,ret=-1;    if(qL<=Mid)     ret=Query(lch,L,Mid,qL,qR,pos);    if(Mid+1<=qR){     int tmp=Query(rch,Mid+1,R,qL,qR,pos);     if(ret==-1||K(mp(pos,a[pos]),mp(ret,a[ret]),mp(tmp,a[tmp])))      ret=tmp;    }    return ret;   }   int n,m;   void Get(int L,int R,int ad){    if(L>=R) return ;    int p=Query(1,0,n,L,R,L);    P[p]=mp(1.0*(a[p]-a[L])/(p-L)-eps,R-L-1+ad);    //printf( %f %d %d %d n ,(double)P[p].first,p,L,R-L-1+ad);    Get(L,p-1,1),Get(p,R,ad);    return ;   }   int ans[MAXN+5];   long double k[MAXN+5];   int main(){    n=read(),m=read();    for(int i=1;i<=n;i++)     a[i]=a[i-1]+read();    Build(1,0,n);    Get(0,n,0);    sort(P+1,P+n+1);    for(int i=n;i>=1;i--)     ans[i]=max(P[i].second,ans[i+1]);    for(int i=1;i<=m;i++){     k[i]=read();     int t=upper_bound(P+1,P+n+1,mp(k[i],0))-P;     printf( %d ,ans[t]),putchar(i==m?  n :   );    }    return 0;   }