{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Nash Equilibrium is an important concept in game theory. \n \u003cbr\u003e \n \u003cbr\u003e一个n*m的矩阵,里面有数字1到n*m且每个数字不重复,问想要组成只有一个纳什均衡点(这个点在它所在的行和列都是最大值)的矩阵,它的组成方式有多少种。\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains a single integer t(1 \u003c\u003d t \u003c\u003d 20), the number of the testcases. \nt组样例\n\u003cbr\u003e \n\u003cbr\u003eThe first line of each testcase contains three numbers n,m and K(1 \u003c\u003d n,m \u003c\u003d 80, 1 \u003c\u003d K \u003c\u003d 10^9).输入n,m,k \n\u003cbr\u003e \n\u003cbr\u003eThe input guarantees that there are at most 3 testcases with max(n,m) \u003e 50.保证max(n,m) \u003e 5 的样例数不超过3"}},{"title":"Output","value":{"format":"HTML","content":"For each testcase, output a single line with a single number: the answer modulo K.\n每个样例输出答案模K"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n3 3 100\n5 5 2333\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e64\n1170\u003c/pre\u003e"}}]}