// Author: Adrian Kuegel
// Date: September 8th, 2010
// Algorithm: Greedy
// Complexity: O(n log n)

#include <stdio.h>
#include <assert.h>
#include <algorithm>
using namespace std;

#define MAXN 100

int a[MAXN], ind[MAXN], sol[MAXN];

bool comp(int i, int j) {
	if (a[i] == a[j])
		return i > j;
	return a[i] < a[j];
}

int main() {
	int tc;
	scanf("%d", &tc);
	assert(tc >= 1 && tc <= 100);
	while(tc--) {
		int p, n;
		scanf("%d %d", &p, &n);
		assert(p >= 1 && p <= 1000000);
		assert(n >= 2 && n <= MAXN);
		int sum = 0;
		for (int i=0; i<n; ++i) {
			scanf("%d", &a[i]);
			assert(a[i] >= 1 && a[i] <= 1000000);
			sum += a[i];
			ind[i] = i;
		}
		if (sum < p)
			puts("IMPOSSIBLE");
		else {
			sort(ind, ind + n, comp);
			for (int i=0; i<n; ++i) {
				sol[ind[i]] = min(a[ind[i]], p/(n-i));
				p -= sol[ind[i]];
			}
			for (int i=0; i<n; ++i) {
				if (i) printf(" ");
				printf("%d", sol[i]);
			}
			puts("");
		}
	}
	return 0;
}
