#line 1 "main.cpp" #include #include #include using namespace std; const set ones{0, 2, 3}; bool pali(const string& s) { return s == string(s.rbegin(), s.rend()); } void solve() { int n, k; cin >> n >> k; if (n <= 15) { for (int b = 0; b < (1 << n); ++b) { string s(n, '0'); for (int i = 0; i < n; ++i) { if ((b >> i) & 1) s[i] = '1'; } int f = 0; for (int l = 0; l < n; ++l) { for (int len = 1; l + len <= n; ++len) { if (pali(s.substr(l, len))) f = max(f, len); } } if (f == k) { cout << s << "\n"; return; } } cout << "-1\n"; return; } if (k <= 3) { cout << "-1\n"; return; } string s(n, '0'); for (int i = 0; i + k < n; ++i) { if (ones.count(i % 6)) s[i + k] = '1'; } cout << s << "\n"; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); solve(); return 0; }