{"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":"Cho $n$ đoạn thẳng trên trục $Ox$ $[l_1,r_1], [l_2,r_2],\\ldots,[l_n,r_n]$.\n\nHợp của 1 tập các đoạn thẳng được định nghĩa là tập các đoạn thẳng không giao nhau và tập các điểm bị phủ của 2 tập này là bằng nhau. Ví dụ:\n- $[3,6],[100,100],[5,8]$ có hợp là $[3,8],[100,100]$.\n- $[1,2],[2,3]$ có hợp là $[1,3]$.\n\nXét tập đoạn thẳng đã cho, bạn được quyền xóa 1 đoạn thẳng trong đó. Hãy tìm cách xóa sao cho hợp của phần còn lại có nhiều đoạn thẳng nhất."}},{"title":"Input","value":{"format":"MD","content":"Dòng đầu tiên chứa số nguyên $t$ ($t\\le 10^4$) - số test.\n\nDòng đầu tiên của mỗi test chứa số nguyên $n$ - số đoạn thẳng. Theo sau đó là $n$ dòng, dòng thứ $i$ chứa 2 số nguyên $l_i,r_i$ ($|l_i|,|r_i|\\le 10^9$).\n\nDữ liệu đảm bảo rằng tổng $n$ qua các test không vượt quá $2\\times 10^5$."}},{"title":"Output","value":{"format":"MD","content":"In ra $t$ dòng, mỗi dòng chứa kết quả của test tương ứng."}},{"title":"Sample 1","value":{"format":"MD","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\u003e3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1\n5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}