n = int(input())
a = list(map(int, input().split()))
pref = [0]
for i in range(1, n + 1):
if i % 2 == 1:
pref.append(pref[i - 1] - a[i - 1])
else:
pref.append(pref[i - 1] + a[i - 1])
q = int(input())
for _ in range(q):
l, r = map(int, input().split())
sum = pref[r] - pref[l - 1]
if l % 2 != r % 2:
sum = 0
elif l % 2 == 1:
sum *= -1
print(2 * sum)