using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 200005
int n, q, a[maxN];
ll d[maxN];
int main () {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE
scanf("%d%d", &n, &q);
fto(i, 1, n) scanf("%d", &a[i]);
fto(i, 1, n)
if (i%2 == 1) d[i] = d[i-1]+a[i];
else d[i] = d[i-1]-a[i];
fto(i, 1, q) {
int l, r;
scanf("%d%d", &l, &r);
printf("%I64d\n", (l%2 == 1) ? d[r]-d[l-1] : d[l-1]-d[r]);
}
return 0;
}
dXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbWFwaWkgbWFwPGludCwgaW50PgojZGVmaW5lIGRlYnVnKGEpIGNvdXQgPDwgI2EgPDwgIjogIiA8PCBhIDw8IGVuZGwKI2RlZmluZSBmZHRvKGksIHIsIGwpIGZvcihpbnQgaSA9IHI7IGkgPj0gbDsgLS1pKQojZGVmaW5lIGZ0byhpLCBsLCByKSBmb3IoaW50IGkgPSBsOyBpIDw9IHI7ICsraSkKI2RlZmluZSBmb3JpdChpdCwgdHlwZSwgdmFyKSBmb3IodHlwZTo6aXRlcmF0b3IgaXQgPSB2YXIuYmVnaW4oKTsgaXQgIT0gdmFyLmVuZCgpOyBpdCsrKQojZGVmaW5lIGlpIHBhaXI8aW50LCBpbnQ+CiNkZWZpbmUgaWlpIHBhaXI8aW50LCBpaT4KI2RlZmluZSBmaSBmaXJzdAojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIG1wIG1ha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