Read problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.

There is a secret sequence $A_{1}, A_{2}, \ldots, A_{N}$. We do not know the elements of this sequence, but we know another sequence $B_{1}, B_{2}, \ldots, B_{N-1}$ such that $B_{i} = A_{i} + A_{i+1}$ for each valid $i$.

You should process $Q$ queries. In each query, you are given two indices $p$ and $q$; your task is to compute $A_{p} + A_{q}$ or determine that there is not enough information to uniquely determine this sum.

------  Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
The first line of each test case contains two space-separated integers $N$ and $Q$.
The second line contains $N-1$ space-separated integers $B_{1}, B_{2}, \ldots, B_{N-1}$.
Each of the following $Q$ lines contains two space-separated integers $p$ and $q$ describing a query.

------  Output ------
For each query, if it is impossible to determine the required sum, print a single line containing the string "UNKNOWN". Otherwise, print a single line containing one integer — the required sum.

------  Constraints ------
$1 ≤ T ≤ 100$
$2 ≤ N ≤ 10^{5}$
$1 ≤ Q ≤ 10^{5}$
$1 ≤ p, q ≤ N$
$1 ≤ B_{i} ≤ 10^{9}$ for each valid $i$
the sum of $N$ over all test cases does not exceed $5 \cdot 10^{5}$
the sum of $Q$ over all test cases does not exceed $5 \cdot 10^{5}$

------  Subtasks ------
Subtask #1 (50 points):
$2 ≤ N ≤ 1,000$
$1 ≤ Q ≤ 1,000$
the sum of $N$ over all test cases does not exceed $5,000$
the sum of $Q$ over all test cases does not exceed $5,000$

Subtask #2 (50 points): original constraints

----- Sample Input 1 ------ 
1
5 3
4 5 6 7
1 2
1 3
4 1
----- Sample Output 1 ------ 
4
UNKNOWN
5

Difficulty: MEDIUM_HARD
Tags: Constructive algorithms

Data structures

Ad-hoc
Skill types: Data structures

Starter code:

Solutions:
t = int(input())
for i in range(t):
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	d = [0] * n
	for j in range(n - 1):
		d[j + 1] = l[j] - d[j]
	for k in range(q):
		(x, y) = map(int, input().split())
		if abs(x - y) % 2 == 0:
			print('UNKNOWN')
		else:
			print(d[x - 1] + d[y - 1])


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	ans = [0]
	a = 0
	for i in range(len(l)):
		p = l[i] - ans[i]
		ans.append(p)
	for i in range(q):
		(x, y) = map(int, input().split())
		gap = abs(x - y)
		if gap % 2 == 0:
			print('UNKNOWN')
		else:
			ans1 = ans[x - 1] + ans[y - 1]
			print(ans1)


test = int(input())
for u in range(test):
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	d = [0] * n
	for i in range(n - 1):
		d[i + 1] = l[i] - d[i]
	for i in range(q):
		(x, y) = map(int, input().split())
		if abs(x - y) % 2 == 0:
			print('UNKNOWN')
		else:
			print(d[x - 1] + d[y - 1])


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	a = list(map(int, input().split()))
	l = [a[0], a[1]]
	for i in range(2, n - 1):
		l.append(l[-2] + a[i])
	l = [0] + l
	for __ in range(q):
		(p, q) = sorted(map(int, input().split()))
		p -= 1
		q -= 1
		if not (p - q) % 2:
			print('UNKNOWN')
		else:
			print(l[q] - l[q - 1] + l[p] - (l[p - 1] if p - 1 >= 0 else 0))


from collections import defaultdict
for _ in range(int(input())):
	(n, q) = map(int, input().split())
	b = list(map(int, input().split()))
	a1 = [0] * n
	a2 = [0] * n
	a1[0] = -1
	a2[0] = -2
	for i in range(1, n):
		a1[i] = b[i - 1] - a1[i - 1]
		a2[i] = b[i - 1] - a2[i - 1]
	for i in range(q):
		(a, b) = map(int, input().split())
		if a1[a - 1] + a1[b - 1] == a2[a - 1] + a2[b - 1]:
			print(a1[a - 1] + a1[b - 1])
		else:
			print('UNKNOWN')


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	arr = [0] + [int(x) for x in input().split()]
	for i in range(1, len(arr)):
		if i % 2 == 1:
			arr[i] += arr[i - 1]
		else:
			arr[i] = arr[i - 1] - arr[i]
	for i in range(q):
		(a, b) = [int(x) for x in input().split()]
		if a > b:
			(a, b) = (a, b)
		else:
			(a, b) = (b, a)
		if (a - b) % 2 == 0:
			print('UNKNOWN')
		else:
			ans = arr[b - 1] - arr[a - 1]
			if a % 2 == 0:
				ans *= -1
			print(ans)


try:
	for _ in range(int(input())):
		(n, q) = map(int, input().split())
		list1 = list(map(int, input().split()))
		list2 = []
		list3 = []
		for i in range(n - 1):
			if i % 2 == 0:
				list2.append(list1[i])
			else:
				list2.append(-list1[i])
		for i in range(n - 1):
			if i % 2 != 0:
				list3.append(list1[i])
			else:
				list3.append(-list1[i])
		for i in range(1, n - 1):
			list2[i] += list2[i - 1]
			list3[i] += list3[i - 1]
		for j in range(q):
			(a1, b1) = map(int, input().split())
			a = min(a1, b1)
			b = max(a1, b1)
			if a == b:
				print('UNKNOWN')
			elif a % 2 != 0:
				if b % 2 != 0:
					print('UNKNOWN')
				elif a != 1:
					print(list2[b - 2] - list2[a - 2])
				else:
					print(list2[b - 2])
			elif a % 2 == 0:
				if b % 2 == 0:
					print('UNKNOWN')
				else:
					print(list3[b - 2] - list3[a - 2])
except:
	pass


from math import *
for _ in range(int(input())):
	(n, Q) = map(int, input().split())
	b = list(map(int, input().split()))
	new = [0] * n
	for i in range(0, n - 1):
		new[i + 1] = b[i] - new[i]
	for j in range(Q):
		(p, q) = map(int, input().split())
		if abs(p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			print(new[p - 1] + new[q - 1])


from math import *
from collections import *
from itertools import *
from bisect import *
from heapq import *
from operator import *
from sys import *
setrecursionlimit(1000000)
d = defaultdict(lambda : 0, {})

def io():
	return map(int, input().split())

def op():
	return list(map(int, input().split()))

def o():
	return int(input())

def r(x):
	if type(x) == int:
		return range(x)
	else:
		return range(len(x))

def kl(con, x=0):
	if x == 0:
		print('Yes') if con else print('No')
	elif x == 1:
		print('yes') if con else print('no')
	elif x == 2:
		print('YES') if con else print('NO')
MOD = 1000000007
MAX = float('inf')
MIN = -float('inf')
p = input
for _ in r(o()):
	(n, q) = io()
	a = op()
	l = [a[0], a[1]]
	for i in range(2, n - 1):
		l.append(l[-2] + a[i])
	l = [0] + l
	for i in r(q):
		(a, b) = sorted(io())
		a -= 1
		b -= 1
		if not b - a & 1:
			print('UNKNOWN')
		else:
			ans = l[b] - l[b - 1] + l[a] - (l[a - 1] if a > 0 else 0)
			print(ans)


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	b = list(map(int, input().split()))
	a = [0]
	for i in range(len(b)):
		a.append(b[i] - a[-1])
	for i in range(q):
		(x, y) = map(int, input().split())
		if (x - y) % 2 == 0:
			print('UNKNOWN')
		else:
			print(a[x - 1] + a[y - 1])


for i in range(int(input())):
	(n, q) = map(int, input().split())
	x = list(map(int, input().split()))
	y = [1]
	for j in range(len(x)):
		y.append(x[j] - y[-1])
	for j in range(q):
		(p, q) = map(int, input().split())
		if (p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			print(y[p - 1] + y[q - 1])


def sum(idx):
	result = 0
	while idx:
		result += bit_array[idx]
		idx -= idx & -idx
	return result

def add(idx, value):
	while idx < len(bit_array):
		bit_array[idx] += value
		idx += idx & -idx
for _ in range(int(input())):
	(N, Q) = map(int, input().split())
	B = list(map(int, input().split()))
	bit_array = [0] * N
	for i in range(N - 1):
		if i % 2 == 0:
			add(i + 1, B[i])
		else:
			add(i + 1, B[i] * -1)
	array = []
	for i in range(N):
		array.append(sum(i))
	for i in range(Q):
		(p, q) = map(int, input().split())
		if p % 2 + q % 2 != 1:
			print('UNKNOWN')
		else:
			a = array[q - 1] - array[p - 1]
			if p % 2 == 0:
				print(-a)
			else:
				print(a)


t = int(input())
while t > 0:
	(n, quer) = map(int, input().split())
	b = list(map(int, input().split()))
	a = []
	a.append(1)
	for i in range(0, n - 1):
		a.append(b[i] - a[-1])
	while quer > 0:
		(p, q) = map(int, input().split())
		if abs(p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			print(a[p - 1] + a[q - 1])
		quer = quer - 1
	t = t - 1


T = int(input())

def left(index):
	return index

def right(index):
	return index - 1

def flip_sum(index1, index2, BPrefix, B):
	flip = False
	total = 0
	lft = left(index1)
	rit = right(index2)
	if lft == rit:
		return B[lft - 1]
	if lft == 1:
		if rit % 2 == 1:
			return BPrefix[rit - 1]
		else:
			return 0 - BPrefix[rit - 1]
	elif rit % 2 == 1:
		return BPrefix[rit - 1] - BPrefix[lft - 2]
	else:
		return 0 - (BPrefix[rit - 1] - BPrefix[lft - 2])
	return total
for _ in range(T):
	(n, q) = (int(i) for i in input().split())
	B = [int(i) for i in input().split()]
	BPrefix = [0 for i in range(len(B))]
	BPrefix[0] = B[0]
	flip = False
	for i in range(1, len(B)):
		if flip:
			BPrefix[i] = BPrefix[i - 1] + B[i]
		else:
			BPrefix[i] = BPrefix[i - 1] - B[i]
		flip = not flip
	for i in range(q):
		(index1, index2) = (int(i) for i in input().split())
		(index1, index2) = (min(index1, index2), max(index1, index2))
		if index1 % 2 == 1 and index2 % 2 == 0:
			print(flip_sum(index1, index2, BPrefix, B))
		elif index1 % 2 == 0 and index2 % 2 == 1:
			print(flip_sum(index1, index2, BPrefix, B))
		else:
			print('UNKNOWN')


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	best = [int(i) for i in input().split()]
	answer = []
	answer.append(0)
	for i in range(1, n):
		answer.append(best[i - 1] - answer[i - 1])
	for i in range(q):
		(x, y) = map(int, input().split())
		if (x - y) % 2 == 0:
			print('UNKNOWN')
		else:
			print(answer[x - 1] + answer[y - 1])


def compute_sum(B, size):
	answer = [B[0], B[1]]
	for i in range(2, size):
		answer.append(B[i] + answer[i - 2])
	return answer

def find_sum(S, p, q):
	if q == 1:
		return S[0]
	answer = S[q - 1] - S[q - 2]
	if p == 0:
		return answer
	if p == 1:
		answer += S[0]
		return answer
	answer += S[p - 1] - S[p - 2]
	return answer
t = int(input())
for i in range(t):
	(n, Q) = [int(x) for x in input().split()]
	B = [int(x) for x in input().split()]
	S = compute_sum(B, n - 1)
	for j in range(Q):
		(p, q) = [int(x) for x in input().split()]
		if p > q:
			(p, q) = (q, p)
		diff = q - p
		if diff % 2 == 0:
			print('UNKNOWN')
		else:
			answer = find_sum(S, p - 1, q - 1)
			print(answer)


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	b = list(map(int, input().split()))
	ans = [0 for x in range(n)]
	for i in range(1, n):
		ans[i] = b[i - 1] - ans[i - 1]
	for i in range(q):
		(f, g) = map(int, input().split())
		if f + g & 1 != 1:
			print('UNKNOWN')
		else:
			print(ans[f - 1] + ans[g - 1])


t = int(input())
for i in range(t):
	(n, q) = map(int, input().split())
	b = list(map(int, input().split()))
	a = [0] * n
	for i in range(len(b)):
		a[i + 1] = b[i] - a[i]
	for i in range(q):
		(l, r) = map(int, input().split())
		if l > r:
			(l, r) = (r, l)
		if (r - l) % 2:
			print(a[r - 1] + a[l - 1])
		else:
			print('UNKNOWN')


import sys
test_cases = int(sys.stdin.readline().split(' ')[0])
while test_cases > 0:
	test_cases = test_cases - 1
	(n, count_q) = map(int, sys.stdin.readline().split(' '))
	b_array = list(map(int, sys.stdin.readline().split(' ')))
	odd_number_sum = [0]
	even_number_sum = [0]
	for pos in range(0, len(b_array)):
		if pos % 2 == 0:
			even_number_sum.append(b_array[pos] + even_number_sum[pos])
			odd_number_sum.append(odd_number_sum[pos])
		else:
			odd_number_sum.append(b_array[pos] + odd_number_sum[pos])
			even_number_sum.append(even_number_sum[pos])
	no_q = 0
	while no_q < count_q:
		no_q = no_q + 1
		(p, q) = map(int, sys.stdin.readline().split(' '))
		diff_pq = abs(p - q)
		if diff_pq == 1:
			print(b_array[min(p, q) - 1])
			continue
		if diff_pq % 2 == 0:
			print('UNKNOWN')
			continue
		min_n = min(p, q) - 1
		max_pos = min_n + diff_pq
		is_start_odd = min_n % 2
		if is_start_odd:
			total_odd_sum = odd_number_sum[max_pos] - odd_number_sum[min_n]
			total_even = even_number_sum[max_pos] - even_number_sum[min_n]
			diff = total_odd_sum - total_even
		else:
			total_odd_sum = odd_number_sum[max_pos] - odd_number_sum[min_n]
			total_even = even_number_sum[max_pos] - even_number_sum[min_n]
			diff = total_even - total_odd_sum
		print(diff)


for _ in range(int(input())):
	(n, q) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	b = [0] * n
	b[1] = arr[0]
	for i in range(1, n - 1):
		if i % 2:
			b[i + 1] = b[i] - arr[i]
		else:
			b[i + 1] = b[i] + arr[i]
	for i in range(q):
		(p, q) = sorted([int(x) for x in input().split()])
		if (q - p) % 2 != 0:
			if p % 2:
				ans = b[p - 1] - b[q - 1]
			else:
				ans = b[q - 1] - b[p - 1]
			print(-ans)
		else:
			print('UNKNOWN')


t = int(input())
while t > 0:
	(n, q) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	even = []
	odd = []
	even.append(0)
	odd.append(0)
	for i in range(1, n):
		if i % 2 == 0:
			even.append(even[i - 1] + a[i - 1])
			odd.append(odd[i - 1] - a[i - 1])
			continue
		even.append(even[i - 1] - a[i - 1])
		odd.append(odd[i - 1] + a[i - 1])
	while q > 0:
		(l, r) = [int(i) for i in input().split()]
		if l > r:
			temp = l
			l = r
			r = temp
		if (l + r) % 2 == 0:
			print('UNKNOWN')
		elif l % 2:
			r -= 1
			print(odd[r] - odd[l - 1])
		else:
			r -= 1
			print(even[r] - even[l - 1])
		q -= 1
	t -= 1


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	b = list(map(int, input().split()))
	a = [0 for x in range(n)]
	for i in range(1, n):
		a[i] = b[i - 1] - a[i - 1]
	for i in range(q):
		(c, b) = map(int, input().split())
		if c + b & 1 != 1:
			print('UNKNOWN')
		else:
			print(a[c - 1] + a[b - 1])


t = int(input())
for i in range(t):
	(n, q) = map(int, input().split())
	ar = list(map(int, input().split()))
	a = [0] * n
	for j in range(1, n):
		a[j] = ar[j - 1] - a[j - 1]
	for query in range(q):
		(i1, i2) = map(int, input().split())
		if (i1 + i2) % 2 == 1:
			print(a[i1 - 1] + a[i2 - 1])
		else:
			print('UNKNOWN')


for _ in range(int(input())):
	(N, Q) = [int(x) for x in input().split()]
	bs = [int(x) for x in input().split()]
	b = [0]
	sign = 1
	for val in bs:
		b.append(b[-1] + sign * val)
		sign *= -1
	for _ in range(Q):
		(a_1, a_2) = [int(x) for x in input().split()]
		if (a_2 - a_1) % 2 == 0:
			print('UNKNOWN')
		else:
			start = min(a_1, a_2) - 1
			finish = max(a_1, a_2) - 1
			sign = 1 if start % 2 == 0 else -1
			print(sign * b[finish] - sign * b[start])


t = int(input())
for _ in range(t):
	s = input().split(' ')
	(n, q) = (int(s[0]), int(s[1]))
	s = input().split(' ')
	b = [int(i) for i in s]
	a = [0] * (len(b) + 1)
	for i in range(len(b)):
		a[i + 1] = b[i] - a[i]
	for _ in range(q):
		s = input().split(' ')
		(p, q) = (int(s[0]), int(s[1]))
		if p % 2 == 0 and q % 2 == 0 or (p % 2 != 0 and q % 2 != 0):
			print('UNKNOWN')
		else:
			print(a[p - 1] + a[q - 1])


R = lambda : map(int, input().split())
t = int(input())
for _ in range(t):
	(n, q) = R()
	a = [None, 0]
	i = 1
	for x in R():
		a.append(a[-1] + x * i)
		i = -i
	for _ in range(q):
		(p, q) = R()
		print((a[q] - a[p]) * (1 - q % 2 * 2) if (p ^ q) & 1 else 'UNKNOWN')


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	arr = list(map(int, input().split()))
	pre = []
	pre.append(0)
	sign = True
	sums = 0
	for item in arr:
		if sign:
			sign = False
			sums = sums + item
			pre.append(sums)
		else:
			sign = True
			sums = sums - item
			pre.append(sums)
	for _ in range(q):
		(a, b) = map(int, input().split())
		if (b - a) % 2 != 0:
			if a > b:
				(a, b) = (b, a)
			if a % 2:
				print(pre[b - 1] - pre[a - 1])
			else:
				print(pre[a - 1] - pre[b - 1])
		else:
			print('UNKNOWN')


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	lst = list(map(int, input().split()))
	ar = [0]
	for i in range(n - 1):
		if i % 2 == 0:
			ar.append(ar[i] + lst[i])
		else:
			ar.append(ar[i] - lst[i])
	for _ in range(q):
		(a, b) = map(int, input().split())
		(a, b) = (a - 1, b - 1)
		(a, b) = (min(a, b), max(a, b))
		diff = b - a
		if diff % 2 == 0:
			print('UNKNOWN')
		elif diff == 1:
			print(lst[a])
		elif a == 0:
			print(ar[diff])
		elif a % 2 != 0:
			print(ar[a] - ar[b])
		else:
			print(ar[b] - ar[a])


for t in range(int(input())):
	(n, m) = map(int, input().split())
	b = list(map(int, input().split()))
	s = [0] * n
	c = 1
	for i in range(1, n):
		s[i] = s[i - 1] + c * b[i - 1]
		c *= -1
	s1 = 0
	for i in range(m):
		(p, q) = map(int, input().split())
		if abs(p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			y = min(p, q)
			z = max(p, q)
			if z % 2 == 0:
				print(s[z - 1] - s[y - 1])
			else:
				print(s[y - 1] - s[z - 1])


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	l1 = [int(x) for x in input().split()]
	l = [0, l1[0]]
	for i in range(2, n):
		l.append(l1[i - 1] - l[i - 1])
	for _ in range(q):
		(a, b) = map(int, input().split())
		if abs(a - b) % 2 == 0:
			print('UNKNOWN')
		else:
			print(l[a - 1] + l[b - 1])


t = input()
t = int(t)
while t > 0:
	s = input().split(' ')
	n = int(s[0])
	q = int(s[1])
	aux = list()
	sum = 0
	sign = 1
	s = input().split(' ')
	aux.append(0)
	for i in range(0, n - 1):
		sum += sign * int(s[i])
		sign *= -1
		aux.append(sum)
	for i in range(q):
		queries = input().split(' ')
		x = int(queries[0])
		y = int(queries[1])
		diff = abs(x - y)
		if diff % 2 == 0:
			print('UNKNOWN')
		else:
			qmax = max(x, y)
			qmin = min(x, y)
			ans = aux[qmax - 1] - aux[qmin - 1] if qmax % 2 == 0 else aux[qmin - 1] - aux[qmax - 1]
			print(ans)
	t = t - 1


t = int(input())
for _ in range(t):
	(n, q1) = map(int, input().split(' '))
	b = [int(y1) for y1 in input().split()]
	(psum, qsum) = ([0], [0])
	(pl, ql) = (0, 0)
	for idx in range(1, n - 1):
		if idx % 2 == 1:
			psum.append(b[idx] - b[idx - 1] + psum[pl])
			pl += 1
		else:
			qsum.append(b[idx] - b[idx - 1] + qsum[ql])
			ql += 1
	for i1 in range(q1):
		(pi, qi) = map(int, input().split(' '))
		x2 = (pi + qi) % 2
		if x2 == 0:
			ans = 'UNKNOWN'
		else:
			if pi % 2 == 0:
				(p, q) = (qi, pi)
			else:
				(p, q) = (pi, qi)
			c = (p - 1) // 2
			d = (q - 2) // 2
			ans = psum[c] + qsum[d] + b[0]
		print(ans)


for t in range(int(input())):
	(n, q) = map(int, input().split())
	a = list(map(int, input().split()))
	diff = []
	for i in range(len(a) + 1):
		if i < 2:
			diff.append(0)
		else:
			diff.append(diff[i - 2] + (a[i - 1] - a[i - 2]))
	for i in range(q):
		(ind1, ind2) = map(int, input().split())
		if ind1 % 2 == ind2 % 2:
			print('UNKNOWN')
		else:
			print(a[0] + diff[ind1 - 1] + diff[ind2 - 1])


t = int(input())
for _ in range(t):
	(n, Q) = map(int, input().split())
	a = list(map(int, input().split()))
	for i in range(1, len(a), 2):
		a[i] *= -1
	psum = [0 for i in range(len(a))]
	psum[0] = a[0]
	for i in range(1, len(a)):
		psum[i] = psum[i - 1] + a[i]
	psum = [0] + psum
	for qq in range(Q):
		(p, q) = map(int, input().split())
		(p, q) = (min(p, q), max(p, q))
		diff = q - p
		if not diff % 2:
			print('UNKNOWN')
			continue
		if p % 2 == 0:
			print(-1 * (psum[q - 1] - psum[p - 1]))
		else:
			print(psum[q - 1] - psum[p - 1])


def main():
	t = int(input())
	for _ in range(t):
		(n, hq) = map(int, input().split())
		b = list(map(int, input().split()))
		bps = [0] * (n - 1)
		bs = bps[0] = b[0]
		for i in range(1, n - 1):
			if i % 2 == 1:
				bps[i] = bs - b[i]
				bs -= b[i]
			else:
				bps[i] = b[i] + bs
				bs += b[i]
		bps = [0] + bps
		for iq in range(hq):
			(p, q) = map(int, input().split())
			mi = min(p, q)
			ma = max(p, q)
			if (ma - mi) % 2 == 0:
				print('UNKNOWN')
			elif mi % 2 == 0:
				print(bps[mi - 1] - bps[ma - 1])
			elif mi % 2 == 1:
				print(bps[ma - 1] - bps[mi - 1])
main()


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	xval = [1 for i in range(n)]
	cons = [0 for i in range(n)]
	for i in range(n - 1):
		cons[i + 1] = l[i] - cons[i]
		xval[i + 1] = -xval[i]
	for zz in range(q):
		(p, q) = map(int, input().split())
		val = cons[p - 1] + cons[q - 1]
		if xval[p - 1] + xval[q - 1] == 0:
			print(val)
		else:
			print('UNKNOWN')


while True:
	try:
		for _ in range(int(input())):
			(n, q) = map(int, input().split())
			B = list(map(int, input().split()))
			queries = []
			for i in range(q):
				queries.append(list(map(int, input().split())))
			B = [(-1) ** i * B[i] for i in range(n - 1)]
			C = []
			C.append(B[0])
			for i in range(1, n - 1):
				C.append(C[-1] + B[i])
			for (p, q) in queries:
				(p, q) = (min(p, q), max(p, q))
				if (q - p) % 2 == 0:
					print('UNKNOWN')
					continue
				if p == 1:
					print(C[q - 2])
					continue
				elif p % 2 == 1:
					print(C[q - 2] - C[p - 2])
				else:
					print(C[p - 2] - C[q - 2])
	except:
		break


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	bs = list(map(int, input().split()))
	flag = 0
	for i in range(1, n - 1):
		if flag == 0:
			bs[i] = bs[i - 1] - bs[i]
			flag = 1
		else:
			bs[i] += bs[i - 1]
			flag = 0
	bs.insert(0, 0)
	for _ in range(q):
		(p, r) = map(int, input().split())
		if r < p:
			(r, p) = (p, r)
		if (r - p) % 2 == 0:
			print('UNKNOWN')
		elif p % 2 == 1:
			print(bs[r - 1] - bs[p - 1])
		else:
			print(bs[p - 1] - bs[r - 1])


t = int(input())
while t:
	(N, Q) = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	n = [b[0]]
	c = -1
	for i in range(1, N - 1):
		n.append(n[i - 1] + c * b[i])
		c *= -1
	while Q:
		(p, q) = [int(x) for x in input().split()]
		if abs(p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			min_ = min(p, q)
			max_ = max(p, q)
			if min_ == 1:
				print(n[max_ - 2])
			elif min_ % 2 == 0:
				print(n[min_ - 2] - n[max_ - 2])
			else:
				print(n[max_ - 2] - n[min_ - 2])
		Q -= 1
	t -= 1


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	pre = [l[0], l[1]]
	for i in range(2, n - 1):
		pre.append(pre[-2] + l[i])
	pre = [0] + [0] + pre
	for i in range(q):
		(p, q) = map(int, input().split())
		mi = p + 2
		ma = q + 2
		if p > q:
			mi = q + 2
			ma = p + 2
		if (ma - mi) % 2 == 0:
			print('UNKNOWN')
		elif ma - mi == 1:
			print(l[mi - 3])
		else:
			print(pre[ma - 2] - pre[mi - 3] - (pre[ma - 3] - pre[mi - 2]))


T = int(input())
for testcase in range(T):
	(N, Q) = map(int, input().split())
	B = [0] + list(map(int, input().split()))
	odd = [0, B[1]]
	for i in range(3, N, 2):
		odd.append(odd[-1] + B[i])
	even = [0, B[2]]
	for i in range(4, N, 2):
		even.append(even[-1] + B[i])
	for query in range(Q):
		(p, q) = map(int, input().split())
		if abs(p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			if p > q:
				(p, q) = (q, p)
			if q % 2 == 0:
				oddsum = odd[1 + (q - 2) // 2] - odd[1 + (p - 3) // 2]
				evensum = even[1 + (q - 4) // 2] - even[1 + (p - 2) // 2]
				ans = oddsum - evensum
			else:
				evensum = even[1 + (q - 3) // 2] - even[1 + (p - 4) // 2]
				oddsum = odd[1 + (q - 3) // 2] - odd[1 + (p - 2) // 2]
				ans = evensum - oddsum
			print(ans)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(n, q) = map(int, sys.stdin.readline().split())
	B = list(map(int, sys.stdin.readline().split()))
	c = 1
	S = [0] * n
	for j in range(1, n):
		S[j] = c * B[j - 1] + S[j - 1]
		c *= -1
	for i in range(q):
		(a, b) = map(int, sys.stdin.readline().split())
		if a > b:
			(a, b) = (b, a)
		if (b - a) % 2 == 0:
			print('UNKNOWN')
			continue
		print(S[b - 1] - S[a - 1] if a % 2 else S[a - 1] - S[b - 1])


for ii in range(int(input())):
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	ll = [0 for i in range(n - 1)]
	ll[0] = l[0]
	t = 1
	for j in range(1, n - 1):
		if t & 1:
			ll[j] = ll[j - 1] - l[j]
		else:
			ll[j] = ll[j - 1] + l[j]
		t = t ^ 1
	while q:
		q = q - 1
		(a, b) = map(int, input().split())
		t = max(a, b) - min(a, b)
		if t & 1:
			(x, y) = (min(a, b) - 1, max(a, b) - 1)
			if x == 0:
				print(ll[y - 1])
			else:
				x = x - 1
				y = y - 1
				if x & 1:
					print(ll[y] - ll[x])
				else:
					print(ll[x] - ll[y])
		else:
			print('UNKNOWN')


import sys

def get_answer(final, s, r):
	myarray = []
	for p in final:
		ans = p[s - 1] + p[r - 1]
		if ans not in myarray and len(myarray) > 0:
			return 'UNKNOWN'
		myarray.append(ans)
	return myarray[0]
testcase = int(sys.stdin.readline())
while testcase > 0:
	input1 = sys.stdin.readline().strip('\n').split(' ')
	n = int(input1[0])
	q = int(input1[1])
	array = []
	for num in sys.stdin.readline().strip('\n').split(' '):
		array.append(int(num))
	subarray = []
	final = []
	for i in range(2):
		subarray = []
		diff = i
		subarray.append(diff)
		for j in array:
			diff = j - diff
			subarray.append(diff)
		final.append(subarray)
	for k in range(q):
		input1 = sys.stdin.readline().strip('\n').split(' ')
		s = int(input1[0])
		e = int(input1[1])
		print(get_answer(final, s, e))
	testcase = testcase - 1


t = int(input().strip())
for _ in range(t):
	(n, q) = map(int, input().strip().split())
	b = list(map(int, input().strip().split()))
	a = [0] * n
	for i in range(n - 2, -1, -1):
		a[i] = b[i] - a[i + 1]
	for _ in range(q):
		(st, en) = map(int, input().strip().split())
		if (st + en) % 2 == 0:
			print('UNKNOWN')
		else:
			print(a[st - 1] + a[en - 1])


from itertools import accumulate
for _ in range(int(input())):
	(n, q) = map(int, input().split())
	b = list(map(int, input().split()))
	res1 = []
	res2 = []
	for i in range(n - 1):
		if i % 2 == 0:
			res1.append(b[i])
		else:
			res1.append(b[i] * -1)
	for i in range(n - 1):
		if i % 2 == 0:
			res2.append(b[i] * -1)
		else:
			res2.append(b[i])
	res1 = [0] + list(accumulate(res1))
	res2 = [0] + list(accumulate(res2))
	for i in range(q):
		(p, q) = map(int, input().split())
		if (p + q) % 2 == 0:
			print('UNKNOWN')
		elif p % 2 != 0:
			print(res1[q - 1] - res1[p - 1])
		else:
			print(res2[q - 1] - res2[p - 1])


t = int(input())
for i in range(t):
	(n, q) = map(int, input().split())
	sum_arr = list(map(int, input().split()))
	original = [0]
	for i in range(1, n):
		original.append(sum_arr[i - 1] - original[i - 1])
	for i in range(q):
		(l, r) = map(int, input().split())
		l -= 1
		r -= 1
		if abs(l - r) % 2 == 1:
			print(original[l] + original[r])
		else:
			print('UNKNOWN')


N = int(input())
for _ in range(N):
	(n, q) = map(int, input().split())
	B = list(map(int, input().split()))
	A = [0] * n
	for i in range(n - 1):
		A[i + 1] = B[i] - A[i]
	for i in range(q):
		(L, R) = map(int, input().split())
		if (R - L) % 2 == 0:
			print('UNKNOWN')
		else:
			print(A[L - 1] + A[R - 1])


try:
	for _ in range(int(input())):
		(n, q) = [int(i) for i in input().split()]
		b = [int(i) for i in input().split()]
		a = [5]
		for i in range(n - 1):
			a.append(b[i] - a[i])
		for x in range(q):
			(p, q) = [int(i) for i in input().split()]
			p -= 1
			q -= 1
			if p % 2 == 0 and q % 2 == 0:
				print('UNKNOWN')
			elif p % 2 != 0 and q % 2 != 0:
				print('UNKNOWN')
			else:
				print(a[p] + a[q])
except:
	EOFError


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	b = list(map(int, input().split()))
	a = [0]
	for i in range(len(b)):
		a.append(b[i] - a[i])
	for bcd in range(q):
		(p, q) = map(int, input().split())
		d = abs(p - q) - 1
		if d % 2 != 0:
			print('UNKNOWN')
		else:
			p -= 1
			q -= 1
			print(a[p] + a[q])


for case in range(int(input())):
	(N, Q) = list(map(int, input().split()))
	B = list(map(int, input().split()))
	A = [0] * N
	for i in range(N - 2, -1, -1):
		A[i] = B[i] - A[i + 1]
	for quer in range(Q):
		(a, b) = list(map(int, input().split()))
		if abs(a - b) % 2 == 1:
			print(A[a - 1] + A[b - 1])
		else:
			print('UNKNOWN')


t = int(input())
for _ in range(t):
	(n, qu) = map(int, input().split())
	b = [0] + list(map(int, input().split()))
	a = [0, -1]
	for i in range(1, n):
		a.append(b[i] - a[-1])
	for h in range(qu):
		(a1, a2) = map(int, input().split())
		p = min(a1, a2)
		q = max(a1, a2)
		if abs(p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			print(a[p] + a[q])


def findsum(a):
	b = [0] * len(a)
	even = 0
	odd = 0
	for i in range(len(a)):
		if i % 2 == 0:
			even += a[i]
			b[i] = even
		else:
			odd += a[i]
			b[i] = odd
	return b

def cal(a, b, c, d):
	ans = d[b - 1] + c[a] - d[a]
	ans -= d[b - 2] + c[a + 1] - d[a + 1]
	print(ans)
t = int(input())
while t:
	t -= 1
	(z, u) = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	temp = findsum(b)
	while u:
		u -= 1
		(p, q) = [int(x) for x in input().split()]
		m = min(p, q)
		n = max(p, q)
		if (m - n) % 2 == 0:
			print('UNKNOWN')
		elif m + 1 == n:
			print(b[m - 1])
		else:
			cal(m - 1, n - 1, b, temp)


R = lambda : map(int, input().split())
for _ in range(int(input())):
	(n, q) = R()
	L = [0] + list(R())
	for i in range(2, n, 2):
		L[i] += L[i - 2]
	for i in range(3, n, 2):
		L[i] += L[i - 2]
	for _ in range(q):
		(a, b) = R()
		(a, b) = (max(a, b), min(a, b))
		if (a - b) % 2:
			print(L[a - 1] - L[max(0, b - 2)] - (L[a - 2] - L[max(0, b - 1)]))
		else:
			print('UNKNOWN')


for _ in range(int(input())):
	(n, q) = input().split()
	n = int(n)
	q = int(q)
	b = input().split()
	b = [int(i) for i in b]
	odd = [0] * (n + 1)
	even = [0] * (n + 1)
	for i in range(1, len(b) + 1):
		if i % 2 == 1:
			odd[i] = odd[i - 1] + b[i - 1]
		else:
			odd[i] = odd[i] + odd[i - 1]
	for i in range(1, len(b) + 1):
		if i % 2 == 0:
			even[i] = even[i - 1] + b[i - 1]
		else:
			even[i] = even[i] + even[i - 1]
	for i in range(q):
		sum = 0
		index = 0
		(p, q) = input().split()
		p = int(p)
		q = int(q)
		if p > q:
			temp = p
			p = q
			q = temp
		if (q - p) % 2 == 0:
			print('UNKNOWN')
		else:
			if q % 2 == 0:
				temp1 = odd[q - 1] - odd[p - 1]
				temp2 = even[q - 2] - even[p]
				sum = temp1 - temp2
			else:
				temp1 = even[q - 1] - even[p - 1]
				temp2 = odd[q - 2] - odd[p]
				sum = temp1 - temp2
			print(sum)


for _ in range(int(input())):
	(n, qu) = input().split(' ')
	arr = input().split(' ')
	arr1 = []
	k = 1
	for i in range(0, int(n) - 1):
		arr[i] = int(arr[i])
	for i in range(0, int(n) - 1):
		arr1.append(k * 1)
		k = k * -1
	for i in range(1, int(n) - 1):
		arr[i] = arr[i - 1] + arr[i] * arr1[i]
	r = 0
	for u in range(int(qu)):
		(p1, q1) = input().split(' ')
		p = int(p1)
		q = int(q1)
		if abs(p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			if min(p, q) - 2 < 0:
				r = 0
			else:
				r = arr[int(max(0, min(p, q) - 2))]
			print(arr1[int(max(p, q) - 2)] * (arr[int(max(p, q) - 2)] - r))


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	B = list(map(int, input().split()))
	pre = [0, B[0]]
	for i in range(n - 1):
		if i % 2 == 0:
			pre += [pre[-1] + B[i]]
		else:
			pre += [pre[-1] - B[i]]
	for i in range(q):
		(x, y) = map(int, input().split())
		if (y - x) % 2 == 0:
			print('UNKNOWN')
		elif y % 2 == 1:
			print(-(pre[y] - pre[x]))
		else:
			print(pre[y] - pre[x])


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0, a[0]]
	for i in range(1, n - 1):
		temp = b[i] + pow(-1, i) * a[i]
		b.append(temp)
	for i in range(q):
		(t, r) = map(int, input().split())
		if t > r:
			(t, r) = (r, t)
		if (t - r) % 2 == 1:
			if t % 2 == 1:
				print(b[r - 2] + a[r - 2] - b[t - 1])
			if t % 2 == 0:
				print(b[t - 1] - b[r - 2] + a[r - 2])
		else:
			print('UNKNOWN')


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	b = list(map(int, input().split()))
	b1 = [b[0]]
	b2 = [b[1]]
	for i in range(2, len(b), 2):
		b1.append(b1[len(b1) - 1] + b[i])
	for i in range(3, len(b), 2):
		b2.append(b2[len(b2) - 1] + b[i])
	for _ in range(q):
		(x, y) = map(int, input().split())
		temp = x
		x = min(x, y)
		y = max(temp, y)
		if (y - x) % 2 == 0:
			print('UNKNOWN')
		elif y - x == 1:
			print(b[x - 1])
		elif x % 2 == 0:
			if x == 2:
				ans1 = b2[(y - 1) // 2 - 1]
				ans2 = b1[(y - 1) // 2 - 1] - b1[0]
			else:
				ans1 = b2[(y - 1) // 2 - 1] - b2[x // 2 - 2]
				ans2 = b1[(y - 1) // 2 - 1] - b1[x // 2 - 1]
			print(ans1 - ans2)
		else:
			if x == 1:
				ans1 = b1[y // 2 - 1]
				ans2 = b2[(y - 2) // 2 - 1]
			else:
				ans1 = b1[y // 2 - 1] - b1[x // 2 - 1]
				ans2 = b2[(y - 2) // 2 - 1] - b2[(x - 1) // 2 - 1]
			print(ans1 - ans2)


from abc import ABC, abstractmethod

def get_int(source):
	return int(source())

def get_ints(source):
	return [int(x) for x in source().split(' ')]

def getline_from_std():
	return input()

class IOProcessing(ABC):

	@abstractmethod
	def read_test_case(self, source):
		pass

	@abstractmethod
	def process_test_case(self, tcase):
		pass

	def solve(self, input_type='from_std', output_type='to_std', input_path='', output_path='output.txt', tcase_handling='all'):
		ans = []
		if input_type == 'from_file':
			with open(input_path, 'r') as in_file:
				t = int(in_file.readline())
				for _ in range(t):
					tcase = self.read_test_case(in_file.readline)
					ans.append(self.process_test_case(tcase))
					if tcase_handling == 'single' and output_type == 'to_std':
						print(ans[-1])
		elif input_type == 'from_std':
			t = int(getline_from_std())
			for _ in range(t):
				tcase = self.read_test_case(getline_from_std)
				ans.append(self.process_test_case(tcase))
				if tcase_handling == 'single' and output_type == 'to_std':
					print(ans[-1])
		if output_type == 'to_file':
			with open(output_path, 'w') as output:
				for a in ans:
					output.write(a)
		elif output_type == 'to_std' and tcase_handling == 'all':
			for a in ans:
				print(a)

class Ex_1_io(IOProcessing):

	def read_test_case(self, source):
		(n, q) = get_ints(source)
		b = get_ints(source)
		queries = []
		for _ in range(q):
			queries.append(get_ints(source))
		return (n, q, b, queries)

class Ex_1_io(IOProcessing):

	def read_test_case(self, source):
		(n, q) = get_ints(source)
		b = get_ints(source)
		queries = []
		for _ in range(q):
			queries.append(get_ints(source))
		return (n, q, b, queries)

	def process_test_case(self, tcase):
		n = tcase[0]
		q = tcase[1]
		b = tcase[2]
		queries = tcase[3]
		a = [(0, 1)]
		for i in range(1, n):
			a.append((b[i - 1] - a[-1][0], -1 * a[-1][1]))
		ans = []
		for (l, r) in queries:
			if a[l - 1][1] + a[r - 1][1] != 0:
				ans.append('UNKNOWN')
			else:
				ans.append(str(a[l - 1][0] + a[r - 1][0]))
		return '\n'.join((x for x in ans))
solution = Ex_1_io()
solution.solve(input_type='from_std', output_type='to_std', input_path='input.txt', output_path='output.txt', tcase_handling='all')


for _ in range(int(input())):
	(n, Q) = map(int, input().split())
	b = list(map(int, input().split()))
	a = [0]
	for i in range(1, n):
		a.append(b[i - 1] - a[i - 1])
	for i in range(Q):
		(p, q) = map(int, input().split())
		if (p + q) % 2 == 0:
			print('UNKNOWN')
		else:
			print(a[p - 1] + a[q - 1])


t = int(input())
for cse in range(t):
	(n, Q) = map(int, input().split())
	b = list(map(int, input().split()))
	sumN = [0]
	sumN.append(b[0])
	sumN.append(b[1])
	for i in range(3, n):
		sumN.append(sumN[i - 2] + b[i - 1])
	for i in range(Q):
		(p, q) = map(int, input().split())
		if (p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			a = min(p, q)
			b = max(p, q)
			if a != 1:
				add = sumN[b - 1] - sumN[a - 2]
			else:
				add = sumN[b - 1]
			sub = sumN[b - 2] - sumN[a - 1]
			print(add - sub)


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	k1 = [0, l[0]]
	for i in range(2, n - 1, 2):
		k1.append(k1[-1] + l[i])
	k2 = [0, l[1]]
	for i in range(3, n - 1, 2):
		k2.append(k2[-1] + l[i])
	for i in range(q):
		(a, b) = map(int, input().split())
		if (b - a) % 2 == 0:
			print('UNKNOWN')
		else:
			b1 = max(a, b)
			a1 = min(a, b)
			b = b1
			a = a1
			b -= 2
			a -= 1
			if b - a == 0:
				print(l[b])
				continue
			if b % 2 == 0:
				ans = k1[b // 2 + 1] - k1[a // 2]
				x = b - 1
				y = a + 1
				ans -= k2[(x + 1) // 2] - k2[y // 2]
			else:
				ans = k2[(b + 1) // 2] - k2[a // 2]
				x = b - 1
				y = a + 1
				ans -= k1[x // 2 + 1] - k1[y // 2]
			print(ans)


T = int(input())
for i in range(T):
	(N, Q) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	ans = [0]
	for j in range(N - 1):
		ans.append(l[j] - ans[j])
	for i in range(Q):
		(p, q) = list(map(int, input().split()))
		if abs(p - q) % 2 == 0:
			print('UNKNOWN')
		else:
			print(ans[p - 1] + ans[q - 1])


for _ in range(int(input())):
	(N, Q) = map(int, input().split())
	li = list(map(int, input().split()))
	l = 0
	s = []
	s.append(0)
	li2 = []
	li2.append(0)
	li2 = li2 + li
	for i in range(1, N):
		if i % 2 != 0:
			l = l + li2[i]
			s.append(l)
		else:
			l = l - li2[i]
			s.append(l)
	for i in range(Q):
		(p, q) = map(int, input().split())
		if p < q:
			c = p
			p = q
			q = c
		if p == q:
			print('UNKNOWN')
		elif abs(p - q) % 2 == 0:
			print('UNKNOWN')
		elif p % 2 != 0:
			print(s[q - 1] - s[p - 1])
		else:
			print(-1 * (s[q - 1] - s[p - 1]))


import sys
import os
from io import IOBase, BytesIO
for i in range(int(input())):
	(n, q) = map(int, sys.stdin.readline().split())
	arr = list(map(int, sys.stdin.readline().split()))
	b = [0] * n
	for i in range(1, n):
		b[i] = arr[i - 1]
		if i % 2 == 1:
			b[i] = b[i] + b[i - 1]
		else:
			b[i] = b[i - 1] - b[i]
	for i in range(q):
		(x, y) = map(int, sys.stdin.readline().split())
		if x > y:
			(x, y) = (y, x)
		if (x + y) % 2 == 0:
			print('UNKNOWN')
			continue
		temp = b[y - 1] - b[x - 1]
		if x % 2 == 0:
			temp = -1 * temp
		print(temp)


for xxx in range(int(input())):
	(n, Q) = map(int, input().split())
	b = list(map(int, input().split()))
	l2 = [0] * n
	x = 1
	l2[0] = 1
	for j in range(1, len(l2)):
		l2[j] = b[j - 1] - x
		x = l2[j]
	for i in range(Q):
		(p, q) = map(int, input().split())
		if (p + q) % 2 == 0:
			print('UNKNOWN')
		else:
			print(l2[p - 1] + l2[q - 1])


for tc in range(int(input())):
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	c = 0
	i = 2
	j = 1
	x = []
	z = []
	x.append(1)
	z.append(1)
	x.append(l[0] - 1)
	while i < (n - 1) * 2:
		if i % 2 == 0:
			y = x[i - 1]
			x.append(y)
			i = i + 1
			z.append(y)
		else:
			x.append(l[j] - y)
			j = j + 1
			i = i + 1
	z.append(x[(n - 1) * 2 - 1])
	for i in range(q):
		(a, b) = map(int, input().split())
		if (a + b) % 2 == 0:
			print('UNKNOWN')
		else:
			print(z[a - 1] + z[b - 1])


__author__ = 'Ronald Kaiser'
__email__ = 'raios dot catodicos at gmail dot com'
for _ in range(int(input())):
	(N, Q) = map(int, input().split())
	B = list(map(int, input().split()))
	se = [0 for _ in range(N)]
	so = [0 for _ in range(N)]
	(se[0], so[1]) = (B[0], B[1])
	for i in range(2, N - 1, 2):
		se[i] += se[i - 2] + B[i]
	for j in range(3, N - 1, 2):
		so[j] += so[j - 2] + B[j]
	for _ in range(Q):
		(p, q) = map(int, input().split())
		(p, q) = (max(p, q), min(p, q))
		if p - q == 1:
			print(B[min(p, q) - 1])
			continue
		if (p - q) % 2 == 1 and p - q >= 3:
			(a, b) = (se, so) if p % 2 == 0 else (so, se)
			s = a[p - 2] - (a[q - 3] if q - 3 >= 0 else 0)
			s -= b[p - 3] - (b[q - 2] if q - 2 >= 0 else 0)
			print(s)
		else:
			print('UNKNOWN')


t = int(input())
while t > 0:
	(n, q) = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a = [0] * n
	a[0] = 0
	for i in range(1, n):
		if i % 2 == 0:
			a[i] = a[i - 1] + b[i - 1]
		else:
			a[i] = a[i - 1] - b[i - 1]
	while q > 0:
		(x, y) = list(map(int, input().split()))
		if x > y:
			(x, y) = (y, x)
		if (y - x) % 2 == 0:
			print('UNKNOWN')
		else:
			if x % 2 == 0:
				su = a[y - 1] - a[x - 1]
			else:
				su = -(a[y - 1] - a[x - 1])
			print(su)
		q -= 1
	t -= 1


t = int(input())
for i in range(t):
	inp = input()
	inp = inp.split(' ')
	n = int(inp[0])
	q = int(inp[1])
	inp_b = input()
	inp_b = inp_b.split(' ')
	inp_arr = [int(k) for k in inp_b]
	if n == 2:
		for i in range(q):
			inp_p_q = input()
			inp_p_q = inp_p_q.split(' ')
			p = int(inp_p_q[0])
			q = int(inp_p_q[1])
			low = min(p, q)
			up = max(p, q)
			if (up - low) % 2 == 0:
				print('UNKNOWN')
			else:
				print(inp_arr[0])
	else:
		b_odd = [inp_arr[0]]
		b_even = [inp_arr[1]]
		for i in range(2, n - 1, 2):
			b_odd.append(b_odd[-1] + inp_arr[i])
		for i in range(3, n - 1, 2):
			b_even.append(b_even[-1] + inp_arr[i])
		for i in range(q):
			inp_p_q = input()
			inp_p_q = inp_p_q.split(' ')
			p = int(inp_p_q[0])
			q = int(inp_p_q[1])
			low = min(p, q)
			up = max(p, q)
			if (up - low) % 2 == 0:
				print('UNKNOWN')
			elif up % 2 == 0:
				if up - low == 1:
					print(inp_arr[low - 1])
				else:
					if low != 1:
						pos = b_odd[(up - 2) // 2] - b_odd[(low - 3) // 2]
						neg = b_even[(up - 4) // 2] - b_even[(low - 3) // 2]
					else:
						pos = b_odd[(up - 2) // 2]
						neg = b_even[(up - 4) // 2]
					print(pos - neg)
			elif up - low == 1:
				print(inp_arr[low - 1])
			else:
				if low != 2:
					pos = b_even[(up - 3) // 2] - b_even[(low - 4) // 2]
					neg = b_odd[(up - 3) // 2] - b_odd[(low - 2) // 2]
				else:
					pos = b_even[(up - 3) // 2]
					neg = b_odd[(up - 3) // 2] - b_odd[0]
				print(pos - neg)


tcase = int(input())
while tcase > 0:
	tcase -= 1
	(n, q) = map(int, input().split())
	l = list(map(int, input().split()))
	if n == 1:
		while q > 0:
			q -= 1
			(l, r) = map(int, input().split())
			print('UNKNOWN')
	else:
		var = dict()
		var[1] = 0
		var[2] = l[0]
		for i in range(3, n + 1):
			var[i] = l[i - 2] - l[i - 3] + var[i - 2]
		while q > 0:
			q -= 1
			(l, r) = map(int, input().split())
			if l % 2 + r % 2 == 1:
				print(var[l] + var[r])
			else:
				print('UNKNOWN')


from collections import defaultdict as dc
import sys
import math

def inp():
	p = sys.stdin.readline()
	return p
for _ in range(int(inp())):
	(n, q) = list(map(int, inp().split()))
	bl = list(map(int, inp().split()))
	bo = []
	be = []
	l = 0
	z = 0
	for i in range(n - 1):
		if (i + 1) % 2 == 0:
			z = z + bl[i]
			be.append(z)
		else:
			l = l + bl[i]
			bo.append(l)
	for t in range(q):
		(a, b) = list(map(int, inp().split()))
		if abs(b - a) % 2 == 0:
			print('UNKNOWN')
		else:
			x = min(a, b)
			y = max(a, b)
			ans1 = 0
			ans2 = 0
			if x % 2 == 0:
				if (y - 2) // 2 < 0:
					x1 = 0
				else:
					x1 = bo[(y - 2) // 2]
				if x // 2 - 1 < 0:
					x2 = 0
				else:
					x2 = bo[x // 2 - 1]
				if (y - 1) // 2 - 1 < 0:
					x3 = 0
				else:
					x3 = be[(y - 1) // 2 - 1]
				if (x - 2) // 2 - 1 < 0:
					x4 = 0
				else:
					x4 = be[(x - 2) // 2 - 1]
				ans1 = x1 - x2
				ans2 = x3 - x4
				print(ans2 - ans1)
			else:
				if (y - 2) // 2 < 0:
					x1 = 0
				else:
					x1 = bo[(y - 2) // 2]
				if x // 2 - 1 < 0:
					x2 = 0
				else:
					x2 = bo[x // 2 - 1]
				if (y - 2) // 2 - 1 < 0:
					x3 = 0
				else:
					x3 = be[(y - 2) // 2 - 1]
				if (x - 1) // 2 - 1 < 0:
					x4 = 0
				else:
					x4 = be[(x - 1) // 2 - 1]
				ans1 = x1 - x2
				ans2 = x3 - x4
				print(ans1 - ans2)


for _ in range(int(input())):
	(N, Q) = map(int, input().split())
	B = list(map(int, input().split()))
	B.insert(0, 0)
	arr1 = [0] * N
	arr1[0] = 0
	for i in range(1, N):
		if i % 2 == 0:
			arr1[i] = arr1[i - 1] + B[i]
		else:
			arr1[i] = arr1[i - 1] - B[i]
	for i in range(Q):
		(p, q) = map(int, input().split())
		if abs(q - p) % 2 == 0:
			print('UNKNOWN')
		else:
			(p, q) = sorted((p, q))
			if p % 2 == 0:
				print(arr1[q - 1] - arr1[p - 1])
			else:
				print(arr1[p - 1] - arr1[q - 1])


t = int(input())
for i in range(t):
	(n, q) = map(int, input().split())
	B = [int(x) for x in input().split()]
	C = [0] * n
	neg = False
	for j in range(len(B)):
		if not neg:
			C[j + 1] = C[j] + B[j]
		else:
			C[j + 1] = C[j] - B[j]
		neg = not neg
	for j in range(q):
		(a, b) = map(int, input().split())
		if a > b:
			temp = a
			a = b
			b = temp
		if a % 2 == 0:
			condition = True
		else:
			condition = False
		if (a + b) % 2 == 0:
			print('UNKNOWN')
			continue
		pos = True
		s = C[b - 1] - C[a - 1]
		if condition:
			s = -s
		print(s)