{"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\"\u003eNow there is a game called the new man down 100th floor. The rules of this game is:\u003cbr\u003e \u003cstrong\u003e1.\u003c/strong\u003e\u0026nbsp;\u0026nbsp;At first you are at the 1st floor. And the floor moves up. Of course you can choose which part you will stay in the first time.\u003cbr\u003e \u003cstrong\u003e2.\u003c/strong\u003e\u0026nbsp;\u0026nbsp;Every floor is divided into M parts. You can only walk in a direction (left or right). And you can jump to the next floor in any part, however if you are now in part “y”, you can only jump to part “y” in the next floor! (1\u0026lt;\u003dy\u0026lt;\u003dM)\u003cbr\u003e \u003cstrong\u003e3.\u003c/strong\u003e\u0026nbsp;\u0026nbsp;There are jags on the ceils, so you can only move at most T parts each floor.\u003cbr\u003e \u003cstrong\u003e4.\u003c/strong\u003e\u0026nbsp;\u0026nbsp;Each part has a score. And the score is the sum of the parts’ score sum you passed by.\u003cbr\u003eNow we want to know after you get the 100th floor, what’s the highest score you can get. \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of each case has four integer N, M, X, T(1\u0026lt;\u003dN\u0026lt;\u003d100, 1\u0026lt;\u003dM\u0026lt;\u003d10000, 1\u0026lt;\u003dX, T\u0026lt;\u003dM). N indicates the number of layers; M indicates the number of parts. At first you are in the X-th part. You can move at most \u003cstrong\u003eT parts\u003c/strong\u003e in every floor in only one direction.\u003cbr\u003eFollowed N lines, each line has M integers indicating the score. (-500\u0026lt;\u003dscore\u0026lt;\u003d500)"}},{"title":"Output","value":{"format":"HTML","content":"Output the highest score you can get."}},{"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\u003e3 3 2 1\r\n7 8 1 \r\n4 5 6 \r\n1 2 3 \u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e29\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}