{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eA point with coordinates (\u003cstrong\u003ex1\u003c/strong\u003e, \u003cstrong\u003ex2\u003c/strong\u003e, …, \u003cstrong\u003exn\u003c/strong\u003e) is called dominated in Pareto’s sense by a point with coordinates (\u003cstrong\u003ey1\u003c/strong\u003e, \u003cstrong\u003ey2\u003c/strong\u003e, …, \u003cstrong\u003eyn\u003c/strong\u003e), if for each \u003cstrong\u003ei\u003c/strong\u003e (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003ei\u003c/strong\u003e ≤ \u003cstrong\u003en\u003c/strong\u003e) the inequality \u003cstrong\u003exi\u003c/strong\u003e ≤ \u003cstrong\u003eyi \u003c/strong\u003eholds. A set of some points is given. Your task is to find the number of points in this set, that are not dominated in Pareto’s sense by any other point in the given set.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eFirst line of input contains the quantity of tests \u003cstrong\u003eT\u003c/strong\u003e (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eT\u003c/strong\u003e ≤ \u003cstrong\u003e10\u003c/strong\u003e). First line of each test case contains two numbers: \u003cstrong\u003eN\u003c/strong\u003e (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eN\u003c/strong\u003e ≤ \u003cstrong\u003e50000\u003c/strong\u003e) -- the number of points in the set and \u003cstrong\u003eM\u003c/strong\u003e (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eM\u003c/strong\u003e ≤ \u003cstrong\u003e4\u003c/strong\u003e) -- the space dimension. Then there are \u003cstrong\u003eN\u003c/strong\u003e lines, each of which contains \u003cstrong\u003eM\u003c/strong\u003e integers -- coordinates of a point, separated by spaces (each coordinate is less than \u003cstrong\u003e10^9\u003c/strong\u003e by its absolute value). All points in the set are different.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eOutput \u003cstrong\u003eT\u003c/strong\u003e lines of the form \"\u003cstrong\u003eCase\u003c/strong\u003e #\u003cstrong\u003eA\u003c/strong\u003e: \u003cstrong\u003eB\u003c/strong\u003e\", where \u003cstrong\u003eA\u003c/strong\u003e is the number of test (beginning from 1), \u003cstrong\u003eB\u003c/strong\u003e is the quantity of non-dominated points.\u003c/p\u003e\n\n"}},{"title":"Example","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\u003e2\n4 1\n1\n2\n3\n4\n4 2\n0 0\n1 1\n2 0\n0 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 1\nCase #2: 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}