\\
include [HTML_REMOVED]
using namespace std;
const int N=100010;
int q[N],s[N];
int main()
{
int m,n,l,r;
cin>>n>>m;
s[0]=0;
for (int i=1;i<=n;i)
{
scanf(“%d”,&q[i]);
}
for (int i=1;i<=n;i)
{
s[i]=s[i-1]+q[i];
}
while (m--)
{
int l,r;
scanf("%d%d",&l,&r);
printf("%d\n",s[r]-s[l-1]);
}
return 0;
}
\\