{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"Section1\"\u003e\r\n\t\u003cdiv align\u003d\"center\" style\u003d\"text-align: auto;\"\u003e\r\n\t\t\u0026nbsp;\u003c/div\u003e\r\n\t\u003cdiv align\u003d\"center\" style\u003d\"text-align: auto;\"\u003e\r\n\t\t\u0026nbsp;\u003c/div\u003e\r\n\t\u003cp\u003e\r\n\t\tSometimes , you have to work with grid of boolean value , that means 0 or 1 . Now,given a grid of size \u003cspan class\u003d\"style101\"\u003e\u003cspan style\u003d\"mso-ansi-font-size:\r\n12.0pt;mso-bidi-font-size:12.0pt;font-family:\u0026quot;Times New Roman\u0026quot;\"\u003eN\u003c/span\u003e\u003c/span\u003e x \u003cspan class\u003d\"style101\"\u003e\u003cspan style\u003d\"mso-ansi-font-size:12.0pt;mso-bidi-font-size:\r\n12.0pt;font-family:\u0026quot;Times New Roman\u0026quot;\"\u003eN\u003c/span\u003e\u003c/span\u003e. Each cell of the grid initially contains a zero(0) or a one(1).\u003cbr /\u003e\r\n\t\tThe \u003cem\u003eparity\u003c/em\u003e of a cell is the number of \u003cspan data-scayt_word\u003d\"1s\" data-scaytid\u003d\"2\"\u003e1s\u003c/span\u003e surrounding that cell. A cell is surrounded by at most 4 cells (top, bottom, left, right).\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify\"\u003e\r\n\t\t\u003cspan style\u003d\"mso-bidi-font-size:\r\n12.0pt\"\u003eSuppose you have a grid of size \u003cspan class\u003d\"style101\"\u003e\u003cspan style\u003d\"mso-ansi-font-size:12.0pt;mso-bidi-font-size:12.0pt;font-family:\u0026quot;Times New Roman\u0026quot;\"\u003e4\u003c/span\u003e\u003c/span\u003e x \u003cspan class\u003d\"style101\"\u003e\u003cspan style\u003d\"mso-ansi-font-size:12.0pt;mso-bidi-font-size:\r\n12.0pt;font-family:\u0026quot;Times New Roman\u0026quot;\"\u003e4\u003c/span\u003e\u003c/span\u003e:\u0026nbsp;\u003co:p\u003e\u003c/o:p\u003e\u003c/span\u003e\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify\"\u003e\r\n\t\t\u003cspan style\u003d\"mso-bidi-font-size:\r\n12.0pt\"\u003e\u003co:p\u003e\u0026nbsp;\u003c/o:p\u003e\u003c/span\u003e\u003c/p\u003e\r\n\t\u003ctable align\u003d\"left\" border\u003d\"1\" cellpadding\u003d\"0\" cellspacing\u003d\"0\" class\u003d\"MsoTableProfessional\" style\u003d\"width:462.95pt;border-collapse:collapse;\r\n border:none;mso-border-alt:solid black .75pt;mso-table-lspace:2.25pt;\r\n mso-table-rspace:2.25pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:\r\n column;mso-table-left:left;mso-table-top:middle;mso-padding-alt:0in 5.4pt 0in 5.4pt;\r\n mso-border-insideh:.75pt solid black;mso-border-insidev:.75pt solid black\" width\u003d\"617\"\u003e\r\n\t\t\u003ctbody\u003e\r\n\t\t\t\u003ctr style\u003d\"mso-yfti-irow:0;mso-yfti-firstrow:yes;height:14.8pt\"\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:23.4pt;border:solid black 1.0pt;\r\n mso-border-alt:solid black .75pt;padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"31\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:22.8pt;border:solid black 1.0pt;\r\n border-left:none;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"30\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:22.2pt;border:solid black 1.0pt;\r\n border-left:none;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"30\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border:solid black 1.0pt;\r\n border-left:none;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd rowspan\u003d\"4\" style\u003d\"width:261.0pt;border:solid black 1.0pt;\r\n border-left:none;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"348\"\u003e\r\n\t\t\t\t\t\u003cp align\u003d\"center\" class\u003d\"MsoNormal\" style\u003d\"text-align:center;mso-element:frame;\r\n mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:\r\n paragraph;mso-element-anchor-horizontal:column;mso-element-top:middle;\r\n mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t\u003cstrong\u003eThe parity of each cell would be\u003c/strong\u003e\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border:solid black 1.0pt;\r\n border-left:none;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border:solid black 1.0pt;\r\n border-left:none;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t3\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border:solid black 1.0pt;\r\n border-left:none;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:25.55pt;border:solid black 1.0pt;\r\n border-left:none;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"34\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t2\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\u003c/tr\u003e\r\n\t\t\t\u003ctr style\u003d\"mso-yfti-irow:1;height:14.8pt\"\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:23.4pt;border:solid black 1.0pt;\r\n border-top:none;mso-border-top-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"31\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:22.8pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"30\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:22.2pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"30\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t2\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t3\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t3\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:25.55pt;border-top:none;border-left:\r\n none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;\r\n mso-border-top-alt:solid black .75pt;mso-border-left-alt:solid black .75pt;\r\n mso-border-alt:solid black .75pt;padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"34\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\u003c/tr\u003e\r\n\t\t\t\u003ctr style\u003d\"mso-yfti-irow:2;height:15.45pt\"\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:23.4pt;border:solid black 1.0pt;\r\n border-top:none;mso-border-top-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:15.45pt\" valign\u003d\"top\" width\u003d\"31\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:22.8pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:15.45pt\" valign\u003d\"top\" width\u003d\"30\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:22.2pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:15.45pt\" valign\u003d\"top\" width\u003d\"30\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:15.45pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:15.45pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t2\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:15.45pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:15.45pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t2\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:25.55pt;border-top:none;border-left:\r\n none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;\r\n mso-border-top-alt:solid black .75pt;mso-border-left-alt:solid black .75pt;\r\n mso-border-alt:solid black .75pt;padding:0in 5.4pt 0in 5.4pt;height:15.45pt\" valign\u003d\"top\" width\u003d\"34\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\u003c/tr\u003e\r\n\t\t\t\u003ctr style\u003d\"mso-yfti-irow:3;mso-yfti-lastrow:yes;height:14.8pt\"\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:23.4pt;border:solid black 1.0pt;\r\n border-top:none;mso-border-top-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"31\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:22.8pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"30\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:22.2pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"30\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t1\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:27.0pt;border-top:none;border-left:none;\r\n border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;mso-border-top-alt:\r\n solid black .75pt;mso-border-left-alt:solid black .75pt;mso-border-alt:solid black .75pt;\r\n padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"36\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\t\u003ctd style\u003d\"width:25.55pt;border-top:none;border-left:\r\n none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;\r\n mso-border-top-alt:solid black .75pt;mso-border-left-alt:solid black .75pt;\r\n mso-border-alt:solid black .75pt;padding:0in 5.4pt 0in 5.4pt;height:14.8pt\" valign\u003d\"top\" width\u003d\"34\"\u003e\r\n\t\t\t\t\t\u003cp class\u003d\"MsoNormal\" style\u003d\"mso-element:frame;mso-element-frame-hspace:2.25pt;\r\n mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:\r\n column;mso-element-top:middle;mso-height-rule:exactly\"\u003e\r\n\t\t\t\t\t\t0\u003c/p\u003e\r\n\t\t\t\t\u003c/td\u003e\r\n\t\t\t\u003c/tr\u003e\r\n\t\t\u003c/tbody\u003e\r\n\t\u003c/table\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify\"\u003e\r\n\t\t\u003co:p\u003e\u0026nbsp;\u003c/o:p\u003e\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify;tab-stops:143.25pt\"\u003e\r\n\t\t\u003co:p\u003e\u0026nbsp;\u003c/o:p\u003e\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify;tab-stops:143.25pt\"\u003e\r\n\t\t\u003co:p\u003e\u0026nbsp;\u003c/o:p\u003e\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify;tab-stops:143.25pt\"\u003e\r\n\t\t\u003co:p\u003e\u0026nbsp;\u003c/o:p\u003e\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify;tab-stops:143.25pt\"\u003e\r\n\t\t\u003co:p\u003e\u0026nbsp;\u003c/o:p\u003e\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify;tab-stops:143.25pt\"\u003e\r\n\t\t\u003co:p\u003e\u0026nbsp;\u003c/o:p\u003e\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify;tab-stops:143.25pt\"\u003e\r\n\t\tFor this problem, you have to change some of the \u003cspan data-scayt_word\u003d\"0s\" data-scaytid\u003d\"4\"\u003e0s\u003c/span\u003e to \u003cspan data-scayt_word\u003d\"1s\" data-scaytid\u003d\"3\"\u003e1s\u003c/span\u003e so that the parity of every cell becomes even. We are interested in the minimum number of transformations of 0 to 1 that is needed to achieve the desired requirement.\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify;tab-stops:143.25pt\"\u003e\r\n\t\t\u0026nbsp;\u003c/p\u003e\r\n\t\u003cp class\u003d\"MsoNormal\" style\u003d\"text-align:justify;tab-stops:143.25pt\"\u003e\r\n\t\t\u003co:p\u003e\u0026nbsp;\u003c/o:p\u003e\u003c/p\u003e\r\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe first line of input is an integer\u0026nbsp;\u003cspan class\u003d\"style31\"\u003e\u003cspan style\u003d\"font-size: 9pt; \"\u003eT\u003c/span\u003e\u003c/span\u003e\u0026nbsp;(\u003cspan class\u003d\"style31\"\u003e\u003cspan style\u003d\"font-size: 9pt; \"\u003eT\u0026lt;30\u003c/span\u003e\u003c/span\u003e) that indicates the number of test cases. Each case starts with a positive integer\u0026nbsp;\u003cspan class\u003d\"style31\"\u003e\u003cspan style\u003d\"font-size: 9pt; \"\u003eN\u003c/span\u003e\u003c/span\u003e(\u003cspan class\u003d\"style31\"\u003e\u003cspan style\u003d\"font-size: 9pt; \"\u003e\u003cspan data-scayt_word\u003d\"1≤N≤15\" data-scaytid\u003d\"1\"\u003e1\u0026le;N\u0026le;15\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e). Each of the next\u0026nbsp;\u003cspan class\u003d\"style101\"\u003e\u003cspan style\u003d\"font-size: 8pt; \"\u003eN\u003c/span\u003e\u003c/span\u003e\u0026nbsp;lines contain\u0026nbsp;\u003cspan class\u003d\"style101\"\u003e\u003cspan style\u003d\"font-size: 8pt; \"\u003eN\u003c/span\u003e\u003c/span\u003e\u0026nbsp;integers (\u003cspan class\u003d\"style101\"\u003e\u003cspan style\u003d\"font-size: 8pt; \"\u003e0/1\u003c/span\u003e\u003c/span\u003e) each. The integers are separated by a single space character.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tFor each case, output the case number followed by the minimum number of transformations required. If it\u0026#39;s impossible to achieve the desired result, then output -1 instead.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\t3\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cdiv\u003e\r\n\t3\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t0 0 0\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t0 0 0\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t0 0 0\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t3\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t0 0 0\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t1 0 0\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t0 0 0\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t3\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t1 1 1\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t1 1 1\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\t0 0 0\u003c/div\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cdiv\u003e\r\n\tCase 1: 0\u0026nbsp;\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\tCase 2: 3\u0026nbsp;\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\tCase 3: -1\u003c/div\u003e"}}]}