#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;
int mn = INT_MAX, r = 0, l = 0;
for(int i = 1; i <= 1000; i++) {
for(int j = 0; j <= 1000; j++) {
if(i*j + i + j == n && i + j <= n) {
if(mn > i + j) {
mn = i + j;
l = i;
r = j;
}
}
}
}
cout << "-1\n";
for(int i =1;i<=l;i++) {
cout << '1' << " ";
}
for(int i=1;i<=r;i++) {
cout << '0' << " ";
}
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... |