{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e作为一款适合孩子和女朋友的刺激益智游戏,火柴棍拼图游戏要求玩家找出恰好有$n~(5\\le n\\le 500)$根火柴棍的可能等式数量。\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/5bdc7280f749182f8094769c645b42e3?v\u003d1705286140\"\u003e\u003c/center\u003e \u003cbr\u003e在这些等式中,$A,B$和$C$均为正整数。等号需要两根火柴棍,减号只需要一根。不允许出现前导零。\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/ffc014fa6248888d2c80b6a2e1bd5cd0?v\u003d1705286140\"\u003e\u003c/center\u003e \u003cbr\u003e请输出答案对给定整数$m~(3\\le m\\le 2\\times 10^9)$取模后的结果。\u003cbr\u003e\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"输入包含多个测试用例。第一行是一个整数$t$,表示测试用例的数量。接下来有$t~(1\\le t\\le 30)$个测试用例。\u003cbr\u003e\u003cbr\u003e每个测试用例包含一行,有两个整数$n~(5\\le n\\le 500)$和$m~(3\\le m\\le 2\\times 10^9)$。"}},{"title":"输出","value":{"format":"HTML","content":"对于每个测试用例,你应该输出答案对$m$取模后的结果。\u003cbr\u003e"}},{"title":"示例","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\u003e4\r\n12 1000000007\r\n17 1000000007\r\n20 1000000007\r\n147 1000000007\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 1\r\nCase #2: 5\r\nCase #3: 38\r\nCase #4: 815630825\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}