P11773 Ultra dexterity

Background

"It's you to do the housework today my lil sis!" Longya therefore voluntarily tried Aling's tailor-made game for him, pushing his destiny onto the gambling table...

Description

Aling gives Longya $n$ cards, which have been put on the table neatly in a row. The $i$-th card on the table from the left has a number $a_i$ written on it. Longya needs to make the written numbers arranged in a **non-descending order** with any number of operations decribed below: - draw out the $k$-th card from the left and put it on either the leftmost or the rightmost side of the cards, where $k$ is a given constant. Longya wants to know if he can reach the goal and also a simple plan if possible.

Input Format

N/A

Output Format

N/A

Explanation/Hint

### Sample Explanation For test case 1: Put the second card ($2$) to the leftmost side, making the sequence $2,3,1$. Put the second card ($3$) to the rightmost side, making the sequence $2,1,3$. Put the second card ($1$) to the leftmost side, making the sequence $1,2,3$. The sequence is now non-descending, thus the operations end. ### Score Calculation The score of a test data is the minimum score of the test cases. In a test case, if you successfully determined if Longya can reach the goal, you will gain $20\%$ of the maximum point. And if your plan is also right, you can gain a certain ratio of score where the ratio is described below: | Number of Rows | Ratio | | :-----------: | :-----------: | | $>7n$ | $40\%$ | | $\le7n$ | $60\%$ | | $\le5n$ | $80\%$ | | $\le3n$ | $100\%$ | ### Note To make the your debug easier, we attached a checker file for calculating your score locally. The usage is described below in the next part. If your output format is wrong, you will gain $0$ point. Therefore if you know whether it is possible to reach the goal but you can't construct a plan, please still output an `o` after your `Yes` to represent the end of your plan. To avoid meaningless repeatition, you should guarantee $1\leq c\leq n$ for every line of your plan. ### Usage of the checker Download files `checker.cpp` and `testlib.h` **from the buttom of the Chinese statement**. Put them in the same folder and run command `g++ checker.cpp -o checker -std=c++14` in the directory to get the executable file `checker.exe` (Windows) / `checker` (Linux). Assume your custom input is in `in.txt` and you program output is `out.txt`. Since the checker can't determine whether it is possible to reach the goal, you should create an answer file (Assume it is `ans.txt`), and input the possibility one per line. For example, the answer file of the sample input should be: ```plain Yes No No Yes Yes ``` Put the input, output and answer file in the same folder with the excutable checker file. - run `.\checker.exe in.txt out.txt ans.txt` if you are in Windows Powershell. - run `./checker in.txt out.txt ans.txt` if you are in Linux Terminal. There are three possible kinds output of the checker: `wrong answer` / `ok` / `points x`, which means you can gain score at a ratio of $0\%$ / $100\%$ / `x`. ### Constraints **There exist subtasks and subtask dependency.** Your score in a subtask is the minimum score of the datas in the subtask and the depended subtasks. A subtask will be depended on all of which is a subset of it. | Subtask ID | $T$ | $n$ | $k$ | Score | | :----------: | :----------: | :----------: | :----------: | :----------: | | $1$ | $\le10^5$ | $=5$ | $\in[1,n]$ | $10$ | | $2$ | $\le100$ | $\le500$ | $\in[1,n]$ | $40$ | | $3$ | $\le10^5$ | $\le2\times10^5$ | $=2$ | $20$ | | $4$ | $\le10^5$ | $\le2\times10^5$ | $\in[1,n]$ | $30$ | For all tests, it is guaranteed that $1\le T\le10^5$,$1\le k\le n\le 2\times10^5$,$\sum n\le5\times10^{5}$,$1\le a_i\le 10^9$.