{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eGiven a \u003ci\u003en\u003c/i\u003e × \u003ci\u003en\u003c/i\u003e matrix \u003ci\u003eA\u003c/i\u003e and a positive integer \u003ci\u003ek\u003c/i\u003e, find the sum \u003ci\u003eS\u003c/i\u003e \u003d \u003ci\u003eA\u003c/i\u003e + \u003ci\u003eA\u003c/i\u003e\u003csup\u003e2\u003c/sup\u003e + \u003ci\u003eA\u003c/i\u003e\u003csup\u003e3\u003c/sup\u003e + … + \u003ci\u003eA\u003csup\u003ek\u003c/sup\u003e\u003c/i\u003e.\u003c/p\u003e\u003c/span\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eThe input contains exactly one test case. The first line of input contains three positive integers \u003ci\u003en\u003c/i\u003e (\u003ci\u003en\u003c/i\u003e ≤ 30), \u003ci\u003ek\u003c/i\u003e (\u003ci\u003ek\u003c/i\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e) and \u003ci\u003em\u003c/i\u003e (\u003ci\u003em\u003c/i\u003e \u0026lt; 10\u003csup\u003e4\u003c/sup\u003e). Then follow \u003ci\u003en\u003c/i\u003e lines each containing \u003ci\u003en\u003c/i\u003e nonnegative integers below 32,768, giving \u003ci\u003eA\u003c/i\u003e’s elements in row-major order.\u003c/p\u003e\u003c/span\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput the elements of \u003ci\u003eS\u003c/i\u003e modulo \u003ci\u003em\u003c/i\u003e in the same way as \u003ci\u003eA\u003c/i\u003e is given.\u003c/p\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\u003e2 2 4\r\n0 1\r\n1 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2\r\n2 3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}