Problem: This is the easy version of the problem. The difference between the versions is that the easy version has no swap operations. You can make hacks only if all versions of the problem are solved.

Pikachu is a cute and friendly pokémon living in the wild pikachu herd.

But it has become known recently that infamous team R wanted to steal all these pokémon! Pokémon trainer Andrew decided to help Pikachu to build a pokémon army to resist.

First, Andrew counted all the pokémon — there were exactly n pikachu. The strength of the i-th pokémon is equal to a_i, and all these numbers are distinct.

As an army, Andrew can choose any non-empty subsequence of pokemons. In other words, Andrew chooses some array b from k indices such that 1 ≤ b_1 < b_2 < ... < b_k ≤ n, and his army will consist of pokémons with forces a_{b_1}, a_{b_2}, ..., a_{b_k}.

The strength of the army is equal to the alternating sum of elements of the subsequence; that is, a_{b_1} - a_{b_2} + a_{b_3} - a_{b_4} + ....

Andrew is experimenting with pokémon order. He performs q operations. In i-th operation Andrew swaps l_i-th and r_i-th pokémon.

Note: q=0 in this version of the task.

Andrew wants to know the maximal stregth of the army he can achieve with the initial pokémon placement. He also needs to know the maximal strength after each operation.

Help Andrew and the pokémon, or team R will realize their tricky plan!

Input

Each test contains multiple test cases.

The first line contains one positive integer t (1 ≤ t ≤ 10^3) denoting the number of test cases. Description of the test cases follows.

The first line of each test case contains two integers n and q (1 ≤ n ≤ 3 ⋅ 10^5, q = 0) denoting the number of pokémon and number of operations respectively.

The second line contains n distinct positive integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ n) denoting the strengths of the pokémon.

i-th of the last q lines contains two positive integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ n) denoting the indices of pokémon that were swapped in the i-th operation.

It is guaranteed that the sum of n over all test cases does not exceed 3 ⋅ 10^5, and the sum of q over all test cases does not exceed 3 ⋅ 10^5. 

Output

For each test case, print q+1 integers: the maximal strength of army before the swaps and after each swap.

Example

Input


3
3 0
1 3 2
2 0
1 2
7 0
1 2 5 4 3 6 7


Output


3
2
9

Note

In third test case we can build an army in such way: [1 2 5 4 3 6 7], its strength will be 5−3+7=9.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000000 + 7;
const long long int MOD1 = 998244353;
const long long int Val9 = 1000000000;
const long long int Val6 = 1000000;
vector<long long int> vd;
void no_of_divisors(long long int n) {
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        vd.push_back(i);
      } else {
        vd.push_back(i);
        vd.push_back(n / i);
      }
    }
  }
}
long long int pwr(long long int x, long long int y) {
  long long int r = 1;
  while (y > 0) {
    if (y & 1) r = r * x;
    x *= x;
    y >>= 1;
  }
  return r;
}
long long int pwrm(long long int x, long long int y, long long int m) {
  x %= m;
  long long int r = 1;
  while (y > 0) {
    if (y & 1) r = r * x % m;
    x = x * x % m;
    y >>= 1;
  }
  return r;
}
int isPrime(long long int n) {
  if (n <= 1) return 0;
  if (n <= 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return 0;
  return 1;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<long long int> vprime;
vector<long long int> vsqr;
void SieveOfEratosthenes(long long int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long int p = 2; p <= n; p++) {
    if (prime[p]) {
      vprime.push_back(p);
      vsqr.push_back(p * p);
    }
  }
}
bool vis[Val6] = {false};
vector<long long int> v[Val6];
vector<long long int> ans1;
long long int dfs(long long int s) {
  long long int p = v[s].size();
  ans1.push_back(s);
  vis[s] = true;
  for (long long int i = (long long int)0; i < (long long int)v[s].size();
       i++) {
    if (vis[v[s][i]] == false) {
      dfs(v[s][i]);
    }
  }
  return 1;
}
void bfs(vector<long long int> v[], long long int n) {
  queue<long long int> q;
  q.push(n);
  vis[n] = true;
  long long int dist = 0;
  while (!q.empty()) {
    long long int p = q.front();
    q.pop();
    dist++;
    for (long long int i = (long long int)0; i < (long long int)v[p].size();
         i++) {
      if (vis[v[p][i]] == false) {
        q.push(v[p][i]);
        vis[v[p][i]] = true;
      }
    }
  }
}
long long int nCr(long long int n, long long int r) {
  long long int ans = 1;
  for (long long int i = (long long int)0; i < (long long int)r; i++) {
    ans *= n - i;
    ans /= i + 1;
  }
  return ans;
}
long long int n;
long long int a[Val6], b[Val6];
long long int dp[3 * 100000 + 1][2];
long long int fun(long long int s, long long int c) {
  if (s == n) return 0;
  if (dp[s][c] != -1) return dp[s][c];
  if (c == 0) {
    return dp[s][c] = max(a[s] + fun(s + 1, 1), fun(s + 1, 0));
  } else {
    return dp[s][c] = max(fun(s + 1, 0) - a[s], fun(s + 1, 1));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int T;
  cin >> T;
  while (T--) {
    cin >> n;
    long long int q;
    cin >> q;
    for (long long int i = (long long int)0; i < (long long int)n; i++)
      cin >> a[i];
    for (long long int i = (long long int)0; i < (long long int)n + 1; i++) {
      dp[i][0] = -1;
      dp[i][1] = -1;
    }
    cout << fun(0, 0) << "\n";
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}