#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n;
    cin >> n;
    vector<long long> v(n);
    for (long long i = 0; i < n; i++) cin >> v[i];
    vector<long long> ans(n);
    for (long long i = 0; i < n / 2; i++) {
      ans[i] = -v[i + v.size() / 2];
      ans[i + v.size() / 2] = v[i];
    }
    for (long long i : ans) cout << i << ' ';
    cout << '\n';
  }
}
