{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eThe game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.\u003c/p\u003e\u003cp\u003eThere are 16 handles on the refrigerator door. Every handle can be in one of two states: open or closed. The refrigerator is open only when all handles are open. The handles are represented as a matrix 4х4. You can change the state of a handle in any location \u003cb\u003e[i, j]\u003c/b\u003e (1 ≤ i, j ≤ 4). However, this also changes states of all handles in row \u003cb\u003ei\u003c/b\u003e and all handles in column \u003cb\u003ej\u003c/b\u003e.\u003c/p\u003e\u003cp\u003eThe task is to determine the minimum number of handle switching necessary to open the refrigerator.\u003c/p\u003e\n\u003cp\u003e\n大体题意:一个冰箱上有4*4共16个开关,改变任意一个开关的状态(即开变成关,关变成开)时,此开关的同一行、同一列所有的开关都会自动改变状态。要想打开冰箱,要所有开关全部打开才行。\n输入:一个4×4的矩阵,+表示关闭,-表示打开;\n输出:使冰箱打开所需要执行的最少操作次数,以及所操作的开关坐标。\u003c/p\u003e\u003c/span\u003e\n \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eThe input contains four lines. Each of the four lines contains four characters describing the initial state of appropriate handles. A symbol “+” means that the handle is in closed state, whereas the symbol “−” means “open”. At least one of the handles is initially closed.\u003c/p\u003e\u003c/span\u003e\n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eThe first line of the input contains N – the minimum number of switching. The rest N lines describe switching sequence. Each of the lines contains a row number and a column number of the matrix separated by one or more spaces. If there are several solutions, you may give any one of them.\u003c/p\u003e\u003c/span\u003e\n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e-+--\n----\n----\n-+--\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e6\n1 1\n1 3\n1 4\n4 1\n4 3\n4 4\u003c/pre\u003e"}}]}