{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eFarmer John has purchased a lush new rectangular pasture composed of \u003ci\u003eM\u003c/i\u003e by \u003ci\u003eN\u003c/i\u003e (1 ≤ \u003ci\u003eM\u003c/i\u003e ≤ 12; 1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are infertile and can\u0027t be planted. Canny FJ knows that the cows dislike eating close to each other, so when choosing which squares to plant, he avoids choosing squares that are adjacent; no two chosen squares share an edge. He has not yet made the final choice as to which squares to plant.\u003c/p\u003e\u003cp\u003eBeing a very open-minded man, Farmer John wants to consider all possible options for how to choose the squares for planting. He is so open-minded that he considers choosing no squares as a valid option! Please help Farmer John determine the number of ways he can choose the squares to plant.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"Line 1: Two space-separated integers: \u003ci\u003eM\u003c/i\u003e and \u003ci\u003eN\u003c/i\u003e\r\u003cbr\u003eLines 2..\u003ci\u003eM\u003c/i\u003e+1: Line \u003ci\u003ei\u003c/i\u003e+1 describes row \u003ci\u003ei\u003c/i\u003e of the pasture with \u003ci\u003eN\u003c/i\u003e space-separated integers indicating whether a square is fertile (1 for fertile, 0 for infertile)"}},{"title":"Output","value":{"format":"HTML","content":"Line 1: One integer: the number of ways that FJ can choose the squares modulo 100,000,000."}},{"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\u003e2 3\r\n1 1 1\r\n0 1 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e9\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"Number the squares as follows:\u003cbr\u003e\u003cpre\u003e1 2 3\u003cbr\u003e\u0026nbsp; 4 \u0026nbsp;\u003c/pre\u003e\r\u003cbr\u003eThere are four ways to plant only on one squares (1, 2, 3, or 4), three ways to plant on two squares (13, 14, or 34), 1 way to plant on three squares (134), and one way to plant on no squares. 4+3+1+1\u003d9."}}]}