#include#include #include using namespace std;int main(){ int n, m; cin >> n >> m; int *p = new int[n]; for (int i = 0; i < n; i++) cin >> p[i]; m = m % n; reverse(p, p + n - m); // 算法精髓 reverse(p + n - m, p + n); reverse(p, p + n); for (int i = 0; i < n; i++){ if (i == 0) cout << p[i]; else cout << ' ' << p[i]; } delete[] p; cout << endl; return 0;}