{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eBob正在玩一个名为“矩阵行走”的游戏。\u003c/p\u003e\u003cp\u003e在这个游戏中,玩家被给定一个$$$n \\times m$$$矩阵$$$A\u003d(a_{i,j})$$$,即第$$$i$$$行第$$$j$$$列的元素是$$$a_{i,j}$$$。最初,玩家位于位置$$$(1,1)$$$,得分为$$$a_{1,1}$$$。\u003c/p\u003e\u003cp\u003e为了到达目标位置$$$(n,m)$$$,玩家可以向右或向下移动,即从$$$(x,y)$$$移动到$$$(x,y+1)$$$或$$$(x+1,y)$$$,只要玩家仍然在矩阵上。\u003c/p\u003e\u003cp\u003e然而,每次移动都会将玩家的得分更改为当前得分与他移动到的位置的值的\u003ca href\u003d\"https://zh.wikipedia.org/wiki/%E4%BD%8D%E6%93%8D%E4%BD%9C\"\u003e按位与\u003c/a\u003e。\u003c/p\u003e\u003cp\u003eBob迫不及待地想要用他最近学到的动态规划工具找出他能获得的最大得分。以下是他解决这个问题的算法。\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/cd841860ab438dc4b413f9204ed72cae?v\u003d1713206089\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e\u003cp\u003e然而,他突然意识到上面的算法无法输出某些矩阵$$$A$$$的最大得分。因此,对于任何给定的非负整数$$$k$$$,他想找到一个$$$n \\times m$$$矩阵$$$A\u003d(a_{i,j})$$$,使得\u003c/p\u003e\u003cul\u003e \u003cli\u003e $$$1 \\le n,m \\le 500$$$(因为Bob不喜欢大矩阵); \u003c/li\u003e\u003cli\u003e $$$0 \\le a_{i,j} \\le 3 \\cdot 10^5$$$对于所有的$$$1 \\le i\\le n,1 \\le j\\le m$$$(因为Bob不喜欢大数); \u003c/li\u003e\u003cli\u003e他能够获得的最大得分与他算法的输出之间的差距是$$$k$$$。\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e可以证明,对于任何给定的整数$$$k$$$,满足上述约束的矩阵是存在的。\u003c/p\u003e\u003cp\u003e请帮助他解决这个问题!\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入的唯一一行包含一个整数$$$k$$$($$$0 \\le k \\le 10^5$$$)。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e输出第一行的两个整数$$$n$$$,$$$m$$$($$$1 \\le n,m \\le 500$$$),表示矩阵的大小。\u003c/p\u003e\u003cp\u003e然后输出$$$n$$$行,每行$$$m$$$个整数,$$$a_{i,j}$$$在第$$$(i+1)$$$行,第$$$j$$$列。\u003c/p\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\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 1\n300000\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\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\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3 4\n7 3 3 1\n4 8 3 6\n7 7 7 3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e在第一个示例中,Bob可以获得的最大得分是$$$300000$$$,而他算法的输出是$$$300000$$$。\u003c/p\u003e\u003cp\u003e在第二个示例中,Bob可以获得的最大得分是$$$7\\\u0026amp;3\\\u0026amp;3\\\u0026amp;3\\\u0026amp;7\\\u0026amp;3\u003d3$$$,而他算法的输出是$$$2$$$。\u003c/p\u003e"}}]}