#include #define lli long long using namespace std; int main() { int t, n, sum_tc = 0; lli even, odd, odd_prefix_sums, even_prefix_sums, tot_sub_arrays; cin >> t; assert(t >= 1 && t <= 10); while ( t-- ) { cin >> n >> even >> odd; sum_tc += n; assert(sum_tc >= 1 && sum_tc <= 1000000); assert(n >= 1 && n <= 1000000); tot_sub_arrays = ((lli)n*(lli)(n + 1LL))/2; assert(even >= 0 && even <= tot_sub_arrays); assert(odd >= 0 && odd <= tot_sub_arrays); assert(odd + even == tot_sub_arrays); if ( odd == 0 ) { for ( int i = 0; i < n; i++ ) cout << "0 "; cout << endl; continue; } even_prefix_sums = odd_prefix_sums = -1; for ( lli i = 1; i <= (int)sqrt(odd); i++ ) { if ( odd % i == 0 ) { if ( i + odd/i == n + 1 ) { odd_prefix_sums = i; even_prefix_sums = odd/i; } } } if ( even_prefix_sums == -1 ) { puts("-1"); continue; } for ( int i = 1; i < even_prefix_sums; i++ ) cout << "0 "; cout << "1 "; for ( int i = 0; i < odd_prefix_sums - 1; i++ ) cout << "0 "; cout << endl; } return 0; }