{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"The cows don\u0027t use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling-pin-like triangle like this:\r\u003cbr\u003e\r\u003cbr\u003e\u003cpre\u003e 7\r\u003cbr\u003e\r\u003cbr\u003e 3 8\r\u003cbr\u003e\r\u003cbr\u003e 8 1 0\r\u003cbr\u003e\r\u003cbr\u003e 2 7 4 4\r\u003cbr\u003e\r\u003cbr\u003e 4 5 2 6 5\u003c/pre\u003eThen the other cows traverse the triangle starting from its tip and moving \"down\" to one of the two diagonally adjacent cows until the \"bottom\" row is reached. The cow\u0027s score is the sum of the numbers of the cows visited along the way. The cow with the highest score wins that frame.\r\u003cbr\u003e\r\u003cbr\u003eGiven a triangle with N (1 \u0026lt;\u003d N \u0026lt;\u003d 350) rows, determine the highest possible sum achievable."}},{"title":"Input","value":{"format":"HTML","content":"Line 1: A single integer, N\r\u003cbr\u003e\r\u003cbr\u003eLines 2..N+1: Line i+1 contains i space-separated integers that represent row i of the triangle."}},{"title":"Output","value":{"format":"HTML","content":"Line 1: The largest sum achievable using the traversal rules"}},{"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\u003e5\r\n7\r\n3 8\r\n8 1 0\r\n2 7 4 4\r\n4 5 2 6 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e30\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"Explanation of the sample:\r\u003cbr\u003e\r\u003cbr\u003e\u003cpre\u003e 7\r\u003cbr\u003e *\r\u003cbr\u003e 3 8\r\u003cbr\u003e *\r\u003cbr\u003e 8 1 0\r\u003cbr\u003e *\r\u003cbr\u003e 2 7 4 4\r\u003cbr\u003e *\r\u003cbr\u003e 4 5 2 6 5\u003c/pre\u003eThe highest score is achievable by traversing the cows as shown above."}}]}