func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, ans[200055], odd, even, cost, ne, no;   pair<int, int> a[200055];   bool need[200055];   map<int, int> M;   int next_even() {     while (M[ne] && ne > 0) ne -= 2;     if (ne == 0)       return -1;     else       return ne;   }   int next_odd() {     while (M[no] && no > 0) no -= 2;     return no;   }   int main() {     scanf( %d%d , &n, &m);     ne = no = m;     if (ne % 2 != 0) ne--;     if (no % 2 != 1) no--;     for (int i = 0; i < n; i++) scanf( %d , &a[i].first);     for (int i = 0; i < n; i++) ans[i] = a[i].first;     for (int i = 0; i < n; i++) a[i].second = i;     sort(a, a + n);     for (int i = 0; i < n; i++) {       if (i == 0 || a[i].first != a[i - 1].first) {         if (a[i].first % 2)           odd++;         else           even++;       }       if (i > 0 && a[i].first == a[i - 1].first) need[i] = 1;     }     if (even > n / 2) {       for (int i = 0; i < n; i++) {         if (even == n / 2) break;         if (need[i] == 0 && a[i].first % 2 == 0) {           need[i] = 1;           even--;         }       }     }     if (odd > n / 2) {       for (int i = 0; i < n; i++) {         if (odd == n / 2) break;         if (need[i] == 0 && a[i].first % 2 == 1) {           need[i] = 1;           odd--;         }       }     }     for (int i = 0; i < n; i++)       if (!need[i]) M[a[i].first] = 1;     for (int i = 0; i < n; i++)       if (need[i]) {         cost++;         int next = -1;         if (even < n / 2) {           next = next_even();           even++;         } else {           next = next_odd();           odd++;         }         if (next == -1) return 0 * printf( -1 n );         ans[a[i].second] = next;         M[next] = 1;       }     printf( %d n , cost);     for (int i = 0; i < n; i++) printf( %d%c , ans[i], (i == n - 1) ?   n  :    );     return 0;   }   