#include <bits/stdc++.h>

using ll = long long;

using namespace std;

void solve() {
    ll n, m;
    cin >> n >> m;
    A.assign(m, 0);
    for (ll i = 0; i < m; i++) {
        cin >> A[i];
    }
    if (n % 2 == 1) {
        p = 1;
    } else {
        p = -1;
    }
    ll sum = 0;
    for (ll j = 0; j < m; j++) {
        sum += A[j] * p;
            if (p == 1) {
                p = -1;
            } else {
                p = 1;
            }
    }
    cout << sum;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll t = 1;
    cin >> t;
    for (ll i = 0; i < t; i++) {
        solve();
    }
    return 0;
}