1008

#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <cstdio>
#include <algorithm>

using namespace std;

int vv[10000];
int N, M;


void print()
{
  bool t = 1;
  for(int i= 0 ; i < N; i++)
  {
    if(t)
    cout << vv[i];
    else
    cout << " " << vv[i];

    t = 0;
  }
  cout << endl;
  return;
}

int main(){
  cin >> N >> M;
  for(int i= 0 ; i < N ; i++){
    cin >> vv[i];
  }

  M %= N;
  reverse(vv,vv+N-M);
  reverse(vv+N-M,vv+N);
  reverse(vv,vv+N);

  print();

  return 0;
}

posted @ 2018-03-21 21:39  pprp  阅读(337)  评论(0编辑  收藏  举报