#include #include #include using namespace std; int a[45]; int main() { int t,m,n,i; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); for(i=0;i