{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003cp\u003eOn a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (ai, bi), and the coordinates of the i-th blue point are (c_i, d_i).\u003c/p\u003e \n\u003cp\u003eA red point and a blue point can form a \u003cem\u003efriendly pair\u003c/em\u003e when, the x-coordinate of the red point is smaller than that of the blue point, and the y-coordinate of the red point is also smaller than that of the blue point.\u003c/p\u003e \n\u003cp\u003eAt most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs.\u003c/p\u003e\n\n平面上有n个红点和n个蓝点,红点和蓝点间配对。如果点a和点b,a是红点,b是蓝点,a在b的左下角,即a的x及y坐标都比b的小,那么这两点就可以配对,已经配对的两点不能再和其它点配对,求最多可以配多少对"}},{"title":"Constraints","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cul\u003e \n \u003cli\u003eAll input values are integers.\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e1 \u003c\u003d N \u003c\u003d 100\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e0 \u003c\u003d ai, bi, ci, di \u003c 2N\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003ea1, a2, ..., aN, c1, c2, ..., cN\u003c/var\u003e are all different.\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003eb1, b2, ..., bN, d1, d2, ..., dN\u003c/var\u003e are all different.\u003c/li\u003e \n\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e \n\u003cpre\u003eN\u003c/var\u003e\n\u003cvar\u003ea1\u003c/var\u003e \u003cvar\u003eb1\u003c/var\u003e\n\u003cvar\u003ea2\u003c/var\u003e \u003cvar\u003eb2\u003c/var\u003e\n\u003cvar\u003e:\u003c/var\u003e\n\u003cvar\u003eaN\u003c/var\u003e \u003cvar\u003ebN\u003c/var\u003e\n\u003cvar\u003ec1\u003c/var\u003e \u003cvar\u003ed1\u003c/var\u003e\n\u003cvar\u003ec2\u003c/var\u003e \u003cvar\u003ed2\u003c/var\u003e\n\u003cvar\u003e:\u003c/var\u003e\n\u003cvar\u003ecN\u003c/var\u003e \u003cvar\u003edN\u003c/var\u003e\n\u003c/pre\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003ePrint the maximum number of friendly pairs.\u003c/p\u003e"}},{"title":"Sample Input 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n\u003c/pre\u003e"}},{"title":"Sample Output 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e2\n\u003c/pre\u003e \n\u003cp\u003eFor example, you can pair \u003cvar\u003e(2, 0)\u003c/var\u003e and \u003cvar\u003e(4, 2)\u003c/var\u003e, then \u003cvar\u003e(3, 1)\u003c/var\u003e and \u003cvar\u003e(5, 5)\u003c/var\u003e.\u003c/p\u003e"}},{"title":"Sample Input 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e3\n0 0\n1 1\n5 2\n2 3\n3 4\n4 5\n\u003c/pre\u003e"}},{"title":"Sample Output 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e2\n\u003c/pre\u003e \n\u003cp\u003eFor example, you can pair \u003cvar\u003e(0, 0)\u003c/var\u003e and \u003cvar\u003e(2, 3)\u003c/var\u003e, then \u003cvar\u003e(1, 1)\u003c/var\u003e and \u003cvar\u003e(3, 4)\u003c/var\u003e.\u003c/p\u003e"}},{"title":"Sample Input 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e2\n2 2\n3 3\n0 0\n1 1\n\u003c/pre\u003e"}},{"title":"Sample Output 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e0\n\u003c/pre\u003e \n\u003cp\u003eIt is possible that no pair can be formed.\u003c/p\u003e"}},{"title":"Sample Input 4","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e5\n0 0\n7 3\n2 2\n4 8\n1 6\n8 5\n6 9\n5 4\n9 1\n3 7\n\u003c/pre\u003e"}},{"title":"Sample Output 4","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e5\n\u003c/pre\u003e"}},{"title":"Sample Input 5","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e5\n0 0\n1 1\n5 5\n6 6\n7 7\n2 2\n3 3\n4 4\n8 8\n9 9\n\u003c/pre\u003e"}},{"title":"Sample Output 5","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e4\n\u003c/pre\u003e"}}]}