#include<cstdio>
main()
{
int a,i;int l=0;
scanf("%d",&a);
while(a--)
{
int s,f;
scanf("%d %d",&s,&f);
int t[f];
for(i=0;i<f;i++)
scanf("%d",&t[i]);
for(int p=0;p<f-1;p++)
{
for(int q =0;q<(f-1-p);q++)
{
if(t[q]>t[q+1])
{ int x1;
x1=t[q];
t[q]=t[q+1];
t[q+1]=x1;
}
}
}
int count=0;
int c=f-1;
while(c>=0)
{
count=t[c]+count;
c--;
}
if(count<s)
{
l++;
printf("Scenario #l:\nimpossible\n");
}
else
{count=0;i=0;
while(count<s)
{
count=count+t[f-1];
i++;f--;
}
l++;
printf("Scenario #l:\n%d\n",i);}
}
}