3 2 1 2 3
2 3 1 You have two ways to divide $P$: $(1, 2),(3)$ and $(1), (2, 3)$. In the former case, Maroon will rearrange them in the order $(3), (1, 2)$ to get $Q = (3, 1, 2)$. In the latter case, Maroon will rearrange them in the order $(2, 3), (1)$ to get $Q = (2, 3, 1)$. Thus, you should choose the latter.
4 3 4 3 1 2
4 3 1 2
20 7 10 5 8 2 1 9 12 20 15 3 7 6 19 4 11 17 13 14 16 18
10 5 8 2 7 6 19 4 11 17 13 14 16 18 3 1 9 12 20 15
{
"problem": {
"name": "Permutation Division",
"description": {
"content": "You are given a permutation $P$ of $1, 2, \\cdots, N$. You can divide $P$ into exactly $K$ non-empty contiguous subsequences as you like. Maroon will rearrange those subsequences you make and concatena",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc114_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a permutation $P$ of $1, 2, \\cdots, N$.\nYou can divide $P$ into exactly $K$ non-empty contiguous subsequences as you like.\nMaroon will rearrange those subsequences you make and concatena...",
"is_translate": false,
"language": "English"
}
]
}