{"trustable":false,"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\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"描述","value":{"format":"MD","content":"微笑国度里有一条街道,沿街密密麻麻的种满了仙树。有一天仙人给这些仙树浇水,仙人每次浇水都会覆盖一段区间的仙树,浇完若干次水后,仙人想知道有哪些仙树浇了足够的水。"}},{"title":"输入","value":{"format":"MD","content":"第一行输入两个整数A和B (1\u003c\u003dA\u003c\u003dB\u003c\u003d10^6),表示仙人共浇了A次水,以及每棵仙树至少被浇B次水才足够多。接下来A行每行两个整数P,Q(-10^9\u003c\u003dP\u003c\u003dQ\u003c\u003d10^9),表示某一次仙人浇了闭区间[P, Q]的树。"}},{"title":"输出","value":{"format":"MD","content":"简单起见,仙人想对于哪些树浇足了足够的水尽可能简洁的表示,即用最少的区间个数来表示。例如区间[-4, -3], [-3, -2],[7, 7],[8, 9]的仙树浇足了足够的水,那么只要通过[-4, -2], [7, 7], [8, 9]来表示(注意[7, 8]之间的仙树没浇足水,所以不能统一表示为[7, 9])。\n\n第一行输出这个最少的区间个数C,之后C行每行输出两个整数P,Q,表示[P, Q]闭区间的树浇足了水。"}},{"title":"样例输入","value":{"format":"MD","content":"4 2\n-1 2\n-2 3\n3 9\n7 11"}},{"title":"样例输出","value":{"format":"MD","content":"3\n-1 2\n3 3\n7 9"}}]}