{"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\u003eOmit sir\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\u003e\\(N\\)\u003c/var\u003e days. For each \u003cvar\u003e\\(i\\)\u003c/var\u003e (\u003cvar\u003e\\(1 \\leq i \\leq N\\)\u003c/var\u003e), Omit sir will choose one of the following activities and do it on the \u003cvar\u003e\\(i\\)\u003c/var\u003e-th day:\u003c/p\u003e \n\u003cul\u003e \n \u003cli\u003eA: Swim in the sea. Gain \u003cvar\u003e\\(a_i\\)\u003c/var\u003e points of happiness.\u003c/li\u003e \n \u003cli\u003eB: Catch bugs in the mountains. Gain \u003cvar\u003e\\(b_i\\)\u003c/var\u003e points of happiness.\u003c/li\u003e \n \u003cli\u003eC: Do homework at home. Gain \u003cvar\u003e\\(c_i\\)\u003c/var\u003e points of happiness.\u003c/li\u003e \n\u003c/ul\u003e \n\u003cp\u003eAs Omit sir 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 Omit sir gains.\u003c/p\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\u003e\\(1 \\leq N \\leq 10^5\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1 \\leq a_i, b_i, c_i \\leq 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\u003e\\(N\\)\u003c/var\u003e\n\u003cvar\u003e\\(a_1\\)\u003c/var\u003e \u003cvar\u003e\\(b_1\\)\u003c/var\u003e \u003cvar\u003e\\(c_1\\)\u003c/var\u003e\n\u003cvar\u003e\\(a_2\\)\u003c/var\u003e \u003cvar\u003e\\(b_2\\)\u003c/var\u003e \u003cvar\u003e\\(c_2\\)\u003c/var\u003e\n\u003cvar\u003e\\(:\\)\u003c/var\u003e\n\u003cvar\u003e\\(a_N\\)\u003c/var\u003e \u003cvar\u003e\\(b_N\\)\u003c/var\u003e \u003cvar\u003e\\(c_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 Omit sir 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 Omit sir does activities in the order C, B, C, he will gain \u003cvar\u003e\\(70 + 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\u003eOmit sir should do activities in the order C, A, B, A, C, B, A.\u003c/p\u003e"}}]}