{"trustable":true,"sections":[{"title":"Background","value":{"format":"MD","content":"NOIP 2000 提高组 T4"}},{"title":"Description","value":{"format":"MD","content":"设有 $N \\times N$ 的方格图 $(N \\le 9)$,我们将其中的某些方格中填入正整数,而其他的方格中则放入数字 $0$。如下图所示(见样例):\n\n![](CDN_BASE_URL/fc9a9d043eafaadc79d93516eb80f6d1?v\u003d1726292756)\n\n某人从图的左上角的 $A$ 点出发,可以向下行走,也可以向右走,直到到达右下角的 $B$ 点。在走过的路上,他可以取走方格中的数(取走后的方格中将变为数字 $0$)。 \n此人从 $A$ 点到 $B$ 点共走两次,试找出 $2$ 条这样的路径,使得取得的数之和为最大。\n"}},{"title":"Input","value":{"format":"MD","content":"输入的第一行为一个整数 $N$(表示 $N \\times N$ 的方格图),接下来的每行有三个整数,前两个表示位置,第三个数为该位置上所放的数。一行单独的 $0$ 表示输入结束。\n"}},{"title":"Output","value":{"format":"MD","content":"只需输出一个整数,表示 $2$ 条路径上取得的最大的和。\n"}},{"title":"Sample 1","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\u003e8\n2 3 13\n2 6 6\n3 5 7\n4 4 14\n5 2 21\n5 6 4\n6 3 15\n7 2 14\n0 0 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e67\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"MD","content":"数据范围:$1\\le N\\le 9$。"}}]}