J=lambda:map(int,input().split()) N,Q=J() C=[0] for a in J():C+=[C[-1]+a] for q in[0]*Q: x,*_=J();l,r=0,N+1 while l>1 if C[m]>x:r=m else:l=m print(l)