/*
	[NWERC'10] FAIR DIVISION
	by: Jan Kuipers
*/

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main () {

	int runs;
	cin >> runs;

	while (runs--) {

		int X, N;
		cin >> X >> N;
		
		vector<pair<int,int> > x(N);
		
		for (int i=0; i<N; i++) {
			cin >> x[i].first;
			x[i].second = -i;
		}
		
		sort(x.begin(),x.end());

		vector<int> y(N);
		
		for (int i=0; i<N; i++)
			X -= y[-x[i].second] = min(x[i].first, X/(N-i));

		if (X > 0) 
			cout << "IMPOSSIBLE" << endl;
		else {
			for (int i=0; i<N; i++) {
				if (i>0) cout << " ";
				cout << y[i];
			}
			cout << endl;
		}
	}
	
	return 0;
}
