1 #include <stdio.h>
2 #include <ctype.h>
3
4 int main(){
5 int T;
6 int number[200];
7 int n;
8 int i;
9 int j;
10 int temp;
11 int amount;
12
13 scanf("%d",&T);
14
15 while(T--){
16 scanf("%d",&n);
17
18 for(i=0;i<n;i++){
19 scanf("%d",&number[i]);
20 }
21
22 for(i=0;i<n-1;i++){
23 for(j=i+1;j<n;j++){
24 if(number[i]>number[j]){
25 temp=number[i];
26 number[i]=number[j];
27 number[j]=temp;
28 }
29 }
30 }
31
32 amount=0;
33 for(i=0;i<n;i++){
34 if(i==0){
35 amount++;
36 continue;
37 }
38
39 if(number[i]!=number[i-1]){
40 amount++;
41 }
42 }
43 printf("%d\n",amount);
44
45 for(i=0;i<n;i++){
46 if(i==0){
47 printf("%d",number[0]);
48 continue;
49 }
50
51 if(number[i]!=number[i-1]){
52 printf(" %d",number[i]);
53 }
54 }
55 printf("\n");
56 }
57 return 0;
58 }