{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eBetinho, the mayor of Soteropolis, striked (the public coffers) again! Now he bought a \u003cspan class\u003d\"tex-font-style-it\"\u003eSorting Machine\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eA \u003cspan class\u003d\"tex-font-style-it\"\u003eSorting Machine\u003c/span\u003e is a dedicated processor with 1000 cores and a shared memory capable of storing an array of integers. In one operation, one can select up to 1000 \u003cspan class\u003d\"tex-font-style-bf\"\u003edisjoint\u003c/span\u003e intervals of this array and sort them concurrently. The cost of such operation is the maximum between the costs of sorting each of these intervals independently.\u003c/p\u003e\u003cp\u003eThe cost of sorting a single interval is $$$L \\lceil \\log_2(K + 1) \\rceil$$$, where $$$L$$$ is the size of the interval and $$$K$$$ is the number of \u003cspan class\u003d\"tex-font-style-it\"\u003eadjacent inversions\u003c/span\u003e it has. An adjacent inversion is a valid index $$$i$$$ such that $$$a_i \u0026gt; a_{i+1}$$$.\u003c/p\u003e\u003cp\u003eNetinho wants to use his machine to sort the sequence $$$n, n-1, n-2, \\dots, 2, 1$$$. He wants to do at most 10 operations to sort this sequence, and he wants the total cost to be no more than $$$7n$$$. Find him a valid sequence of operations.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$n$$$ ($$$4 \\leq n \\leq 10^5$$$).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eThe first line should contain the number of operations $$$O$$$ to be executed.\u003c/p\u003e\u003cp\u003eThen there should be $$$O$$$ blocks describing each operation.\u003c/p\u003e\u003cp\u003eA operation block should contain in its first line an integer $$$K$$$ ($$$1 \\leq K \\leq min(n, 1000)$$$) – the number of disjoint intervals used in this operation.\u003c/p\u003e\u003cp\u003eThe next $$$K$$$ lines of the block should contain two integers $$$L, R$$$ ($$$1 \\leq L \\leq R \\leq n$$$) – the boundaries of the interval to be sorted.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n2\n1 2\n3 4\n1\n1 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n3\n1 2\n3 4\n5 5\n2\n1 4\n5 5\n1\n1 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}