{"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":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it\u0027s so nice, isn\u0027t it? To celebrate this meaningful day, the ACM team of HDU hold some fuuny games. Especially, there will be a game named \"crashing color balloons\". \n \u003cbr\u003e \n \u003cbr\u003eThere will be a n*n matrix board on the ground, and each grid will have a color balloon in it.And the color of the ballon will be in the range of [1, 50].After the referee shouts \"go!\",you can begin to crash the balloons.Every time you can only choose one kind of balloon to crash, we define that the two balloons with the same color belong to the same kind.What\u0027s more, each time you can only choose a single row or column of balloon, and crash the balloons that with the color you had chosen. Of course, a lot of students are waiting to play this game, so we just give every student k times to crash the balloons. \n \u003cbr\u003e \n \u003cbr\u003eHere comes the problem: which kind of balloon is impossible to be all crashed by a student in k times. \n \u003cbr\u003e \n \u003cbr\u003e \n \u003ccenter\u003e \n \u003cimg style\u003d\"max-width:100%;\" SRC\u003d\"CDN_BASE_URL/2082572f4c54473ff6ea6908f5e6f111?v\u003d1533629121\"\u003e \n \u003c/center\u003e \n \u003cbr\u003e \n\u003c/div\u003e\n\u003cbr\u003e撞气球游戏,一个n*n的矩阵中,有不同颜色的气球,气球的颜色最多50种(从1到50)。\n\u003cbr\u003e游戏开始前,先选择一种颜色。游戏开始后,每次选择一行或者一列包含该种颜色的气球进行撞击。如果选择行,那么这一行的气球都会炸裂。如果选择列,这一列的气球都炸裂。 \n\u003cbr\u003e请你求出,有多少种颜色的气球,无论怎么玩,都不能在K次之内,把所有同色的气球都撞裂。\n"}},{"title":"Input","value":{"format":"HTML","content":"There will be multiple input cases.Each test case begins with two integers n, k. n is the number of rows and columns of the balloons (1 \u0026lt;\u003d n \u0026lt;\u003d 100), and k is the times that ginving to each student(0 \u0026lt; k \u0026lt;\u003d n).Follow a matrix A of n*n, where Aij denote the color of the ballon in the i row, j column.Input ends with n \u003d k \u003d 0. \n\u003cbr\u003e\n\u003cbr\u003e有多组数据\n\u003cbr\u003e每组测试数据,第一行两个整数n和k\n\u003cbr\u003e接下来n行,每行n个整数,表示该行的气球颜色。\n\u003cbr\u003en\u003dk\u003d0时读入结束。\n\n"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print in ascending order all the colors of which are impossible to be crashed by a student in k times. If there is no choice, print \"-1\". \n\u003cbr\u003e\n\u003cbr\u003e按照升序输出哪些颜色的气球无论怎么玩,都不能在K次之内,把所有同色的气球都撞裂,如果没有,输出-1"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e1 1\n1\n2 1\n1 1\n1 2\n2 1\n1 2\n2 2\n5 4\n1 2 3 4 5\n2 3 4 5 1\n3 4 5 1 2\n4 5 1 2 3\n5 1 2 3 4\n3 3\n50 50 50\n50 50 50\n50 50 50\n0 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e-1\n1\n2\n1 2 3 4 5\n-1\u003c/pre\u003e"}}]}