{"trustable":true,"sections":[{"title":"Description","value":{"format":"MD","content":"Shuaishuai often plays a matrix picking game with his classmates: for a given matrix $n \\times m$, each element $a_{i,j}$ in the matrix is a non-negative integer. The rules of the game are as follows:\n\n1. Each time, $n$ elements need to be picked from each row, and this process is repeated $m$ times until all elements in the matrix are picked;\n2. The picked elements from each row can only be the first or the last element of the row;\n3. Each picking round has a score, which is the sum of the scores of picking from each row. The score for picking from each row is the value of the picked element $\\times 2^i$, where $i$ represents the $i$th picking round (starting from $1$);\n4. The total score at the end of the game is the sum of scores from all picking rounds.\n\nShuaishuai would like you to help write a program to calculate the maximum score after picking elements from any given matrix."}},{"title":"Input","value":{"format":"MD","content":"The input file consists of $n+1$ lines:\n\nThe first line contains two integers $n$ and $m$, separated by a space.\n\nThe $2\\sim n+1$th line contains the $n \\times m$ matrix, with each row containing $m$ non-negative integers separated by a single space."}},{"title":"Output","value":{"format":"MD","content":"The output file contains only $1$ line, which is an integer representing the maximum score after picking elements from the input matrix."}},{"title":"Sample 1","value":{"format":"MD","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\u003e2 3\n1 2 3\n3 4 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e82\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Hint","value":{"format":"MD","content":"**【Data Limits】**\n\nFor $60\\%$ data, it holds that $1\\le n,m\\le 30$, and the answer does not exceed $10^{16}$.\nFor $100\\%$ data, it holds that $1\\le n,m\\le 80$, $0\\le a_{i,j}\\le1000$.\n\n**【Problem Source】**\n\nNOIP 2007 Advanced Third Question."}}]}