#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include "bits/stdc++.h" #define REP(i,a,b) for(int i=a;i> c[i]; for (int i = K - 1; i > X; i--) { swap(c[a[i]], c[b[i]]); } rep(i, N) d[i] = i + 1; rep(i, X) swap(d[a[i]], d[b[i]]); if (test) { rep(i, N) { cout << d[i] << " "; } cout << endl; } vector ans; rep(i, N) { if (c[i] != d[i]) ans.push_back(i); } rep(i, ans.size() - 1) cout << ans[i] + 1 << " "; cout << ans.back() + 1 << endl; return 0; }