/*************************************************************************
File Name: uva729.cpp
Author: yubo
Mail: yuzibode@126.com
Created Time: 2014年06月08日 星期日 04時43分43秒
學習重點:與uva10098非常相似,沒有別的了
meanings:
next_permutation();
Sample Input
1
4 2
Sample Output
0011
0101
0110
1001
1010
1100
************************************************************************/
#include
#include
#include
#include
using namespace std;
int haming[20];
int main()
{
// freopen("in.txt","r",stdin);
int T;
scanf("%d",&T);
while(T--){
int N,H;
scanf("%d%d",&N,&H);
int i,j;
for(i=0;i