8 std::priority_queue
<int> heap
;
11 int *a
=pool
[0],*b
=pool
[1];
16 std::scanf("%d",&tcase
);
18 std::scanf("%d%d",&m
,&n
);
19 for (--m
,i
=0; i
<n
; ++i
) std::scanf("%d",&a
[i
]);
22 for (i
=0; i
<n
; ++i
) scanf("%d",&b
[i
]);
24 for (i
=0; i
<n
; ++i
) heap
.push(a
[i
]+b
[0]);
27 if (b
[i
]+a
[j
] > heap
.top()) break;
33 while (!heap
.empty()) a
[i
++]=heap
.top(),heap
.pop();
36 for (i
=0; i
<n
; ++i
) printf("%d ",a
[i
]);