#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 600005
#define pb push_back
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define sz(s) (int)s.size()
ll T, n, a[N], t, ans,b[25];
string s;
map <string,int> vis;
int main () {
cin >> T;
for(int op = 1; op <= T; op++){
cin >> n;
bool tr = 0;
for(int i = 1; i <= 45; i++) {
for(int j = 1; j <= 45; j++) {
if(i*j + i + j == n && i + j <= n) {
cout << "-1\n";
for(int k = 1; k <= i; k++) {
cout << '0' << " ";
}
for(int k = 1; k <= j; k++) {
cout << '1' << " ";
}
cout << '\n';
tr = 1;
break;
}
}
if(tr) break;
}
if(!tr) {
cout << "-1\n";
for(int i=1;i<=n;i++) {
cout << '1' << " ";
}
cout << '\n';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |