Problem: Being stuck at home, Ray became extremely bored. To pass time, he asks Lord Omkar to use his time bending power: Infinity Clock! However, Lord Omkar will only listen to mortals who can solve the following problem:

You are given an array a of n integers. You are also given an integer k. Lord Omkar wants you to do k operations with this array.

Define one operation as the following: 

  1. Set d to be the maximum value of your array. 
  2. For every i from 1 to n, replace a_{i} with d-a_{i}. 



The goal is to predict the contents in the array after k operations. Please help Ray determine what the final sequence will look like!

Input

Each test contains multiple test cases. The first line contains the number of cases t (1 ≤ t ≤ 100). Description of the test cases follows.

The first line of each test case contains two integers n and k (1 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ k ≤ 10^{18}) – the length of your array and the number of operations to perform.

The second line of each test case contains n integers a_{1},a_{2},...,a_{n} (-10^9 ≤ a_{i} ≤ 10^9) – the initial contents of your array.

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

Output

For each case, print the final version of array a after k operations described above.

Example

Input


3
2 1
-199 192
5 19
5 -1 4 2 0
1 2
69


Output


391 0
0 6 1 3 5
0

Note

In the first test case the array changes as follows:

  * Initially, the array is [-199, 192]. d = 192.

  * After the operation, the array becomes [d-(-199), d-192] = [391, 0].

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a > b) {
    a = a + b;
    b = a - b;
    a = a - b;
  }
  if (b % a == 0) return a;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long prime[1000100], pcnt;
long long defac[1000100][2], dcnt;
long long era[1000100];
long long input[1000100];
void defac_precompute(long long maxnum) {
  long long i, j;
  for (i = 2; i <= maxnum; i++) era[i] = i;
  pcnt = 0;
  for (i = 2; i <= maxnum; i++) {
    if (era[i] == 0) continue;
    prime[pcnt++] = i;
    j = i;
    while (j <= maxnum) {
      era[j] = 0;
      j += i;
    }
  }
}
long long prdfac(long long x) {
  long long i, bx = x, p1 = 1, p2 = 1, cnt;
  dcnt = 0;
  for (i = 0; i < pcnt; i++) {
    if (bx % prime[i] == 0) {
      defac[dcnt][0] = prime[i];
      defac[dcnt][1] = 0;
      while (bx % prime[i] == 0) {
        bx /= prime[i];
        defac[dcnt][1]++;
      }
      dcnt++;
    }
    if (bx == 1) break;
  }
  if (bx > 1) {
    defac[dcnt][0] = bx;
    defac[dcnt][1] = 1;
    dcnt++;
  }
  return 1;
}
tuple<long long, long long, long long> extended_euclidean(long long a,
                                                          long long b) {
  if (b == 0) return make_tuple(a, 1, 0);
  long long g, x, y;
  tie(g, x, y) = extended_euclidean(b, a % b);
  return make_tuple(g, y, x - (a / b) * y);
}
long long fac[1000100];
long long invfac[1000100];
void comb_preprocess(long long maxval) {
  invfac[0] = invfac[1] = fac[0] = fac[1] = 1;
  for (long long i = 2; i <= maxval; i++)
    fac[i] = (long long)fac[i - 1] * i % 1000000007;
  for (long long i = 2; i <= maxval; i++)
    invfac[i] = (long long)(1000000007 - (1000000007 / i)) *
                invfac[1000000007 % i] % 1000000007;
  for (long long i = 2; i <= maxval; i++)
    invfac[i] = (long long)invfac[i - 1] *
                ((invfac[i] + 1000000007) % 1000000007) % 1000000007;
}
long long Comb(long long n, long long r) {
  return (long long)fac[n] * invfac[r] % 1000000007 * invfac[n - r] %
         1000000007;
}
vector<long long> getPi(string p) {
  long long m = (long long)p.size(), j = 0;
  vector<long long> pi(m, 0);
  for (long long i = 1; i < m; i++) {
    while (j > 0 && p[i] != p[j]) j = pi[j - 1];
    if (p[i] == p[j]) pi[i] = ++j;
  }
  return pi;
}
string common(const string& word, const string& rev) {
  vector<long long> pi = getPi(rev);
  long long m = word.size();
  long long begin = 0, matched = 0;
  while (begin + matched < m) {
    if (word[begin + matched] == rev[matched]) {
      matched++;
      if (begin + matched == m) {
        break;
      }
    } else {
      if (matched == 0) {
        begin++;
      } else {
        begin += matched - pi[matched - 1];
        matched = pi[matched - 1];
      }
    }
  }
  return word.substr(begin, m - begin);
}
bool isPrime(long long n) {
  long long cl = (long long)sqrt(n);
  for (long long x = 2; x <= cl; x++)
    if (n % x == 0) return false;
  return true;
}
long long arr[200200];
void solve(long long tc) {
  long long n, k, mx, mn;
  cin >> n >> k;
  for (long long i = 0; i < (n); i++) {
    cin >> arr[i];
    if (i == 0)
      mx = mn = arr[0];
    else {
      mx = (((mx) > (arr[i])) ? (mx) : (arr[i]));
      mn = (((mn) < (arr[i])) ? (mn) : (arr[i]));
    }
  }
  if (k == 0) {
    for (long long i = 0; i < (n); i++) cout << arr[i] << " ";
    cout << "\n";
    return;
  } else if (k % 2 == 1) {
    for (long long i = 0; i < (n); i++) cout << mx - arr[i] << " ";
    cout << "\n";
    return;
  } else {
    for (long long i = 0; i < (n); i++) cout << arr[i] - mn << " ";
    cout << "\n";
    return;
  }
}
signed main() {
  long long T = 1, tc;
  cin >> T;
  for (tc = 1; tc <= T; tc++) solve(tc);
}