{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\nThere are \u003ci\u003en\u003c/i\u003e cities(\u003ci\u003e1\u003c/i\u003e, \u003ci\u003e2\u003c/i\u003e, ... ,\u003ci\u003en\u003c/i\u003e) forming a line on the wonderland. city \u003ci\u003ei\u003c/i\u003e and city \u003ci\u003ei+1\u003c/i\u003e are adjacent and their distance is 1. Each city has many gold coins.\r\nNow, Alice and her friend Bob make a team to go treasure hunting. They starts at city \u003ci\u003ep\u003c/i\u003e, and they want to get as many gold coins as possible in \u003ci\u003eT\u003c/i\u003e days.\r\nEach day Alice and Bob can move to adjacent city or just stay at the place, and their action is independent. While as a team, their max distance can\u0027t exceed \u003ci\u003eM\u003c/i\u003e.\r\n\u003c/p\u003e\r\n\r\n\u003ch4\u003eInput\u003c/h4\u003e\r\n\u003cp\u003e\r\nThe input contains multiple cases.\u003cbr\u003e\r\nThe first line of each case are two integers \u003ci\u003en\u003c/i\u003e, \u003ci\u003ep\u003c/i\u003e as above.\u003cbr\u003e\r\nThe following line contain n interger,\"\u003ci\u003ev\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e \u003ci\u003ev\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e ... \u003ci\u003ev\u003csub\u003en\u003c/sub\u003e\u003c/i\u003e\" indicate the gold coins in city \u003ci\u003ei\u003c/i\u003e.\u003cbr\u003e\r\nThe next line is M, T.\u003cbr\u003e\r\n(\u003ci\u003e1\u0026lt;\u003dn\u0026lt;\u003d100000\u003c/i\u003e, \u003ci\u003e1\u0026lt;\u003dp\u0026lt;\u003dn\u003c/i\u003e, \u003ci\u003e0\u0026lt;\u003dv\u003csub\u003ei\u003c/sub\u003e\u0026lt;\u003d100000\u003c/i\u003e, \u003ci\u003e0\u0026lt;\u003dM\u0026lt;\u003d100000\u003c/i\u003e, \u003ci\u003e0\u0026lt;\u003dT\u0026lt;\u003d100000\u003c/i\u003e)\r\n\u003c/p\u003e\r\n\r\n\u003ch4\u003eOutput\u003c/h4\u003e\r\n\u003cp\u003e\r\nOutput the how many gold coins they can collect at most.\r\n\u003c/p\u003e\r\n\r\n\u003ch4\u003eSample\u003c/h4\u003e\n\u003ctable class\u003d\"vjudge_sample\"\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\u003e\r\n6 3\r\n1 2 3 3 5 4\r\n2 1\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\r\n8\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\r\n\u003ch4\u003eHint\u003c/h4\u003e\r\n\u003cp\u003e\r\nAt day 1: Alice move to city 2, Bob move to city 4.\u003cbr\u003e\u003cbr\u003e\r\nThey can always get the gold coins of the starting city, even if \u003ci\u003eT\u003d0\u003c/i\u003e\r\n\u003c/p\u003e\r\n"}}]}