{"trustable":false,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"给定 $n$ 个三元组 $(x_i,y_i,z_i)$,要求在其中选出若干个三元组并将其排序,使得任意一个三元组都至少有两维小于前一个。"}},{"title":"Input","value":{"format":"HTML","content":"The input file will contain one or more test cases. The first line of each test case contains an integer n,\n\u003cbr\u003e\nrepresenting the number of different blocks in the following data set. The maximum value for n is 30.\n\u003cbr\u003e\nEach of the next n lines contains three integers representing the values xi, yi and zi.\n\u003cbr\u003e\nInput is terminated by a value of zero (0) for n.\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print one line containing the case number (they are numbered sequentially starting from 1) and the height of the tallest possible tower in the format \"Case case: maximum height \u003d height\".\n\u003cbr\u003e"}},{"title":"Sample","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\u003e\u003cpre\u003e1\n10 20 30\n2\n6 8 10\n5 5 5\n7\n1 1 1\n2 2 2\n3 3 3\n4 4 4\n5 5 5\n6 6 6\n7 7 7\n5\n31 41 59\n26 53 58\n97 93 23\n84 62 64\n33 83 27\n0\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003eCase 1: maximum height \u003d 40\nCase 2: maximum height \u003d 21\nCase 3: maximum height \u003d 28\nCase 4: maximum height \u003d 342\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}