{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eTaro\u0027s summer vacation starts tomorrow, and he has decided to make plans for it now.\u003c/p\u003e \n\u003cp\u003eThe vacation consists of \u003cvar\u003eN\u003c/var\u003e days. For each \u003cvar\u003ei\u003c/var\u003e (1\u003c\u003di\u003c\u003dN), Taro will choose one of the following activities and do it on the \u003cvar\u003ei\u003c/var\u003e-th day:\u003c/p\u003e \n\u003cul\u003e \n \u003cli\u003eA: Swim in the sea. Gain \u003cvar\u003ea_i\u003c/var\u003e points of happiness.\u003c/li\u003e \n \u003cli\u003eB: Catch bugs in the mountains. Gain \u003cvar\u003eb_i\u003c/var\u003e points of happiness.\u003c/li\u003e \n \u003cli\u003eC: Do homework at home. Gain \u003cvar\u003ec_i\u003c/var\u003e points of happiness.\u003c/li\u003e \n\u003c/ul\u003e \n\u003cp\u003eAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\u003c/p\u003e \n\u003cp\u003eFind the maximum possible total points of happiness that Taro gains.\u003c/p\u003e\u003cscript defer src\u003d\u0027CDN_BASE_URL/8cfcd2984d69498e59bf783c827b2a76?v\u003d1568979389\u0027\u003e\u003c/script\u003e\u003cscript defer src\u003d\u0027CDN_BASE_URL/13f1d3d8f2dd057f2be3b532be7d1e08?v\u003d1568979389\u0027\u003e\u003c/script\u003e\u003cscript defer src\u003d\u0027CDN_BASE_URL/9adada3b7739c394762887a2d7612564?v\u003d1568979389\u0027\u003e\u003c/script\u003e\u003cscript defer src\u003d\u0027CDN_BASE_URL/3814b31c146721ee901a6fd9ddd5e73f?v\u003d1568979389\u0027\u003e\u003c/script\u003e"}},{"title":"Constraints","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cul\u003e \n \u003cli\u003eAll values in input are integers.\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e1\u003c\u003dN\u003c\u003d 10^5\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e1\u003c\u003d a_i, b_i, c_i \u003c\u003d 10^4\u003c/var\u003e\u003c/li\u003e \n\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e \n\u003cpre\u003e\u003cvar\u003eN\u003c/var\u003e\n\u003cvar\u003ea_1\u003c/var\u003e \u003cvar\u003eb_1\u003c/var\u003e \u003cvar\u003ec_1\u003c/var\u003e\n\u003cvar\u003ea_2\u003c/var\u003e \u003cvar\u003eb_2\u003c/var\u003e \u003cvar\u003ec_2\u003c/var\u003e\n\u003cvar\u003e:\u003c/var\u003e\n\u003cvar\u003ea_N\u003c/var\u003e \u003cvar\u003eb_N\u003c/var\u003e \u003cvar\u003ec_N\u003c/var\u003e\n\u003c/pre\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003ePrint the maximum possible total points of happiness that Taro gains.\u003c/p\u003e"}},{"title":"Sample Input 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e3\n10 40 70\n20 50 80\n30 60 90\n\u003c/pre\u003e"}},{"title":"Sample Output 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e210\n\u003c/pre\u003e \n\u003cp\u003eIf Taro does activities in the order C, B, C, he will gain \u003cvar\u003e70 + 50 + 90 \u003d 210\u003c/var\u003e points of happiness.\u003c/p\u003e"}},{"title":"Sample Input 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e1\n100 10 1\n\u003c/pre\u003e"}},{"title":"Sample Output 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e100\n\u003c/pre\u003e"}},{"title":"Sample Input 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\u003c/pre\u003e"}},{"title":"Sample Output 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e46\n\u003c/pre\u003e \n\u003cp\u003eTaro should do activities in the order C, A, B, A, C, B, A.\u003c/p\u003e"}}]}