{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003eYou are given a set of \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e axis-aligned rectangles in a 2D\n plane. For this problem, two rectangles are considered to\n intersect if their boundaries contain any common points (in\n particular, two nesting rectangles don’t count as\n intersecting). Determine if some pair of rectangles\n intersect.\u003c/p\u003e\n \u003ccenter\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/383f891531786cd3b5b91512b00eda13?v\u003d1715739607\" alt\u003d\"\\includegraphics[width\u003d1.0\\textwidth ]{rectangles.jpg}\" style\u003d\"width:100.00%\"\u003e\n \u003c/center\u003e\n \u003cp\u003eIn this example, only rectangles \u003cb class\u003d\"bf\"\u003eA\u003c/b\u003e and\n \u003cb class\u003d\"bf\"\u003eB\u003c/b\u003e intersect.\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eEach test case will begin with a line with a single integer\n \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$1\\! \\le \\! n\\! \\le \\! 10^5$\u003c/span\u003e), which\n is the number of rectangles.\u003c/p\u003e\n \u003cp\u003eEach of the next \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e\n lines will contain four space-separated integers:\u003c/p\u003e\n \u003ccenter\u003e\n \u003cspan class\u003d\"tex2jax_process\"\u003e$x_1$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$y_1$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$x_2$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$y_2$\u003c/span\u003e\n \u003c/center\u003e\n \u003cp\u003e(\u003cspan class\u003d\"tex2jax_process\"\u003e$-10^9\\! \\le \\!\n x_1,y_1,x_2,y_2\\! \\le \\! 10^9, x_1\\! \u0026lt;\\! x_2, y_1\\! \u0026lt;\\!\n y_2$\u003c/span\u003e), which describe a rectangle, where \u003cspan class\u003d\"tex2jax_process\"\u003e$(x_1,y_1)$\u003c/span\u003e is the lower left corner\n and \u003cspan class\u003d\"tex2jax_process\"\u003e$(x_2,y_2)$\u003c/span\u003e is the\n upper right corner. All \u003cspan class\u003d\"tex2jax_process\"\u003e$x$\u003c/span\u003e values will be distinct. All\n \u003cspan class\u003d\"tex2jax_process\"\u003e$y$\u003c/span\u003e values will be\n distinct.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eOutput a single integer, which is \u003cspan class\u003d\"tex2jax_process\"\u003e$1$\u003c/span\u003e if some pair of rectangles\n intersect, \u003cspan class\u003d\"tex2jax_process\"\u003e$0$\u003c/span\u003e if no pair\n of rectangles intersect.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\n0 0 2 2\n1 1 3 4\n5 7 6 8\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\n0 0 20 20\n1 1 3 4\n2 10 9 12\n11 3 19 18\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}