// Author: Adrian Kuegel
// Date: November 4th, 2010
// Algorithm: Greedy
// Complexity: O(n^2)

import java.io.*;
import java.util.*;

public class adrian {
	public static void main(String [] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int tc = Integer.parseInt(in.readLine());
		while(tc-- > 0) {
			StringTokenizer strtok = new StringTokenizer(in.readLine());
			int p = Integer.parseInt(strtok.nextToken());

			int n = Integer.parseInt(strtok.nextToken());
			int sum = 0;
			strtok = new StringTokenizer(in.readLine());
			int [] a = new int[n];
			for (int i=0; i<n; ++i) {
				a[i] = Integer.parseInt(strtok.nextToken());
				sum += a[i];
			}
			if (sum < p)
				System.out.println("IMPOSSIBLE");
			else {
				int [] pay = new int[n];
				for (int i=0; i<n; ++i) {
					int minval = 1000000000;
					int ind = 0;
					for (int j=0; j<n; ++j) {
						if (a[j] >= 0 && a[j] < minval) {
							minval = a[j];
							ind = j;
						}
					}
					if (minval > p/(n-i)) {
						int maxval = -1;
						for (int j=0; j<n; ++j)
							if (a[j] > maxval) {
								maxval = a[j];
								ind = j;
							}
						pay[ind] = (p+n-i-1)/(n-i);
						p -= pay[ind];
						a[ind] = -1;
					}
					else {
						pay[ind] = Math.min(minval, p/(n-i));
						p -= pay[ind];
						a[ind] = -1;
					}
				}
				for (int i=0; i<n; ++i)
					System.out.print(pay[i]+(i<n-1?" ":"\n"));
			}
		}
	}
}
