#include <bits/stdc++.h>   const int MAXN = 1e9 + 7;   const int INF = 1e9 + 7;   const signed long long MOD = 1e9 + 7;   using namespace std;   bool comp1(signed long long a, signed long long b) { return (sin(a) < sin(b)); }   signed long long binpow(signed long long a, signed long long b) {     signed long long res = 1;     while (b) {       if (b & 1) res = (res * a);       a = (a * a);       b >>= 1;     }     return res;   }   signed long long phi(signed long long n) {     signed long long result = n;     for (signed long long i = 2; i * i <= n; ++i)       if (n % i == 0) {         while (n % i == 0) n /= i;         result -= result / i;       }     if (n > 1) result -= result / n;     return result;   }   signed long long gcd(signed long long a, signed long long b) {     if (a == 0) return b;     return gcd(b % a, a);   }   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int t;     cin >> t;     for (size_t jj = 0; jj < t; jj++) {       signed long long n, k;       cin >> n >> k;       vector<signed long long> mas(n);       signed long long mx = -1e9 - 47;       for (size_t i = 0; i < n; i++) {         cin >> mas[i];         mx = max(mx, mas[i]);       }       signed long long mx1 = -1e9 - 47;       for (size_t i = 0; i < n; i++) {         mas[i] = mx - mas[i];         mx1 = max(mx1, mas[i]);       }       k--;       if (k % 2) {         for (size_t i = 0; i < n; i++) {           mas[i] = mx1 - mas[i];         }       }       for (size_t i = 0; i < n; i++) {         cout << mas[i] <<    ;       }       cout <<   n ;     }     return 0;   }   