{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"On a chessboard with a given shape (which may be irregular), place chess pieces. The chess pieces are indistinguishable. It is required that any two chess pieces cannot be placed in the same row or column on the chessboard. Please write a program to calculate the number of feasible placement schemes C for a given shape and size of the chessboard, with k chess pieces to be placed."}},{"title":"Input","value":{"format":"HTML","content":"The input contains multiple sets of test data.\r\u003cbr\u003eFor each set of data, the first line contains two positive integers, n and k, separated by a space, indicating that a chessboard of size n*n will be described and k chess pieces will be placed. n \u0026lt;\u003d 8, k \u0026lt;\u003d n\r\u003cbr\u003eWhen n and k are both -1, it indicates the end of input.\r\u003cbr\u003eThe following n lines describe the shape of the chessboard: each line contains n characters, where # represents a chessboard area and . represents a blank area (the data ensures there are no extra blank lines or columns)."}},{"title":"Output","value":{"format":"HTML","content":"For each set of data, output a single line containing the number of placement schemes C (it is guaranteed that C \u0026lt; 2^31)."}},{"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 1\r\n#.\r\n.#\r\n4 4\r\n...#\r\n..#.\r\n.#..\r\n#...\r\n-1 -1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}