Cut

AtCoder
IDabc368_a
Time2000ms
Memory256MB
Difficulty
There is a stack of $N$ cards, and the $i$\-th card from the top has an integer $A_i$ written on it. You take $K$ cards from the bottom of the stack and place them on top of the stack, maintaining their order. Print the integers written on the cards from top to bottom after the operation. ## Constraints * $1 \leq K < N \leq 100$ * $1 \leq A_i \leq 100$ * All input values are integers. ## Input The input is given from Standard Input in the following format: $N$ $K$ $A_1$ $A_2$ $\ldots$ $A_N$ [samples]
Samples
Input #1
5 3
1 2 3 4 5
Output #1
3 4 5 1 2

Initially, the integers written on the cards are $1,2,3,4,5$ from top to bottom.
After taking three cards from the bottom of the stack and placing them on top, the integers written on the cards become $3,4,5,1,2$ from top to bottom.
Input #2
6 2
1 2 1 2 1 2
Output #2
1 2 1 2 1 2

The integers written on the cards are not necessarily distinct.
API Response (JSON)
{
  "problem": {
    "name": "Cut",
    "description": {
      "content": "There is a stack of $N$ cards, and the $i$\\-th card from the top has an integer $A_i$ written on it. You take $K$ cards from the bottom of the stack and place them on top of the stack, maintaining the",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc368_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There is a stack of $N$ cards, and the $i$\\-th card from the top has an integer $A_i$ written on it.\nYou take $K$ cards from the bottom of the stack and place them on top of the stack, maintaining the...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments