Untitled

mail@pastecode.io avatar
unknown
plain_text
4 years ago
405 B
4
Indexable
Never
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
using namespace std;
#define int long long
#define vi vector<int>
signed main() {
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		vi a(n);
		for (auto& e : a)
			cin >> e;
		for (int i = 0; i < n; i += 2)
			swap(a[i], a[i + 1]), a[i] *= -1;
		for (auto& e : a)
			cout << e << " ";
		cout << "\n";

	}
}