#include<bits/stdc++.h>
using namespace std;
const int MX = (1<<20);
int main(){
    int n , K , T;
    cin>>T;
    while(T--){
        cin>>n>>K;
        if(n == 1){
            cout<<K<<endl;
            continue;
        }
        if(K == 1){
            cout<<1;
            for(int j = 1 ; j < n ; j++) cout<<" 1";
            puts("");
            continue;
        }
        if(K == 2){
            cout<<2;
            for(int j = 1 ; j < n ; j++) cout<<" 1";
            puts("");
            continue;
        }
        if(K == 3){
            if(n % 2)
                cout<<3;
            else cout<<2;
            for(int j = 1 ; j < n ; j++)
                cout<<" 1";
            puts("");
            continue;
        }
        vector < int > sol;
        int po = 1;
        while(po <= K)
            po *= 2;
        po/=2;
        sol.push_back(po);
        if(n % 2 == 0)
            sol.push_back(po - 1);
        else sol.push_back(po - 2);
        for(int j = 2 ; j < n ; j++) sol.push_back(1);
        cout<<sol[0];
        for(int j = 1 ; j < sol.size() ; j++) cout<<' '<<sol[j];
        cout<<endl;
    }

}