#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
using namespace std;

int T, M[200007], N[200007], f=1;
float korenN, korenM;


int main (){

cin>> T;

for (int i=0; i<T ; i++)
{
    cin>> N[i] >> M[i];

    if (M[i]>N[i])
    {
        cout<< -1;
    }
    else
    for (int l=0; l<N[i] ; l++)
    {
    for (int j=0 ; j<M[i] ; j++)
    {
        if (j<f)
        {
            cout<< 1 << " ";
        }
        if (j>=f)
        {
            cout<< 0 << " ";
        }
    }
    f++;
    }
}

return 0;
}