5 3 6
5 1 2 3 4 Consider the sequence of pairs of integers such that $1 \leq x \lt y \leq N$ sorted in the increasing lexicographical order. Its $3$\-rd, $4$\-th, $5$\-th, and $6$\-th elements are $(1, 4), (1, 5), (2, 3), (2, 4)$, respectively. Corresponding to these pairs, $A$ transitions as follows. $(1, 2, 3, 4, 5) \rightarrow (4, 2, 3, 1, 5) \rightarrow (5, 2, 3, 1, 4) \rightarrow (5, 3, 2, 1, 4) \rightarrow (5, 1, 2, 3, 4)$
10 12 36
1 10 9 8 7 4 3 2 5 6
{
"problem": {
"name": "Swap Many Times",
"description": {
"content": "For an integer $N$ greater than or equal to $2$, there are $\\frac{N(N - 1)}{2}$ pairs of integers $(x, y)$ such that $1 \\leq x \\lt y \\leq N$. Consider the sequence of these pairs sorted in the increas",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc253_g"
},
"statements": [
{
"statement_type": "Markdown",
"content": "For an integer $N$ greater than or equal to $2$, there are $\\frac{N(N - 1)}{2}$ pairs of integers $(x, y)$ such that $1 \\leq x \\lt y \\leq N$.\nConsider the sequence of these pairs sorted in the increas...",
"is_translate": false,
"language": "English"
}
]
}