/* -*- coding: utf-8 -*- * * 1376.cc: No.1376 Simple LPS Problem - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100; const char pad[] = "010011"; /* typedef */ /* global variables */ int ds[8]; /* subroutines */ inline bool palindrome(int i, int j) { for (; i < j; i++, j--) if (ds[i] != ds[j]) return false; return true; } /* main */ int main() { int n, k; scanf("%d%d", &n, &k); if (n <= 8) { int nbits = 1 << n; for (int bits = 0; bits < nbits; bits++) { for (int i = 0; i < n; i++) ds[i] = ((bits >> i) & 1); int maxl = 0; for (int i = 0; i < n; i++) for (int j = i; j < n; j++) if (palindrome(i, j)) { int l = j - i + 1; if (maxl < l) maxl = l; } if (maxl == k) { for (int i = 0; i < n; i++) putchar('0' + ds[i]); putchar('\n'); return 0; } } puts("-1"); return 0; } else { if (k <= 3) { puts("-1"); return 0; } int m = n - k; for (int i = 0; i < k; i++) putchar('1'); for (int i = 0; i < m; i++) putchar(pad[i % 6]); putchar('\n'); } return 0; }