#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> a(n + 1);
vector<long long> pref(n + 1);
for(int i = 1; i <= n; i++)
{
cin >> a[i];
if(i % 2 == 0)
pref[i] = pref[i - 1] + a[i];
else
pref[i] = pref[i - 1] - a[i];
}
int q;
cin >> q;
for(int i = 1; i <= q; i++)
{
int l, r;
cin >> l >> r;
if(l % 2 != r % 2)
{
cout << 0 << "\n";
}
else
{
long long sum = pref[r] - pref[l - 1];
if (l % 2 == 1)
sum *= -1;
cout << 2 * sum << "\n";
}
}
return 0;
}