{"problem":{"name":"Reverse Grid","description":{"content":"Snuke has a grid with $H$ rows and $W$ columns. The square at the $i$\\-th row and $j$\\-th column contains a character $S_{i,j}$. He can perform the following two kinds of operation on the grid: *   R","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"codefestival_2016_final_i"},"statements":[{"statement_type":"Markdown","content":"Snuke has a grid with $H$ rows and $W$ columns. The square at the $i$\\-th row and $j$\\-th column contains a character $S_{i,j}$.\nHe can perform the following two kinds of operation on the grid:\n\n*   Row-reverse: Reverse the order of the squares in a selected row.\n*   Column-reverse: Reverse the order of the squares in a selected column.\n\nFor example, reversing the $2$\\-nd row followed by reversing the $4$\\-th column will result as follows:\n![image](https://atcoder.jp/img/code-festival-2016-final/31458935865e5db21bfbcd2eab9511da.png)\nBy performing these operations any number of times in any order, how many placements of characters on the grid can be obtained?\n\n## Constraints\n\n*   $1≦H,W≦200$\n*   $S_{i,j}$ is a lowercase English letter (`a`\\-`z`).\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$H$ $W$\n$S_{1,1}$$S_{1,2}$$...$$S_{1,W}$\n$S_{2,1}$$S_{2,2}$$...$$S_{2,W}$\n$:$\n$S_{H,1}$$S_{H,2}$$...$$S_{H,W}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"codefestival_2016_final_i","tags":[],"sample_group":[["2 2\ncf\ncf","6\n\nThe following $6$ placements of characters can be obtained:\n![image](https://atcoder.jp/img/code-festival-2016-final/ddf2925467af2c9734194a886f819a2b.png)"],["1 12\ncodefestival","2"]],"created_at":"2026-03-03 11:01:13"}}