There are N barbecue restaurants along a street. The restaurants are numbered 1 through N from west to east, and the distance between restaurant i and restaurant i+1 is A_i.

Joisino has M tickets, numbered 1 through M. Every barbecue restaurant offers barbecue meals in exchange for these tickets. Restaurant i offers a meal of deliciousness B_{i,j} in exchange for ticket j. Each ticket can only be used once, but any number of tickets can be used at a restaurant.

Joisino wants to have M barbecue meals by starting from a restaurant of her choice, then repeatedly traveling to another barbecue restaurant and using unused tickets at the restaurant at her current location. Her eventual happiness is calculated by the following formula: "(The total deliciousness of the meals eaten) - (The total distance traveled)". Find her maximum possible eventual happiness.

Constraints

* All input values are integers.
* 2≤N≤5×10^3
* 1≤M≤200
* 1≤A_i≤10^9
* 1≤B_{i,j}≤10^9

Input

The input is given from Standard Input in the following format:


N M
A_1 A_2 ... A_{N-1}
B_{1,1} B_{1,2} ... B_{1,M}
B_{2,1} B_{2,2} ... B_{2,M}
:
B_{N,1} B_{N,2} ... B_{N,M}


Output

Print Joisino's maximum possible eventual happiness.

Examples

Input

3 4
1 4
2 2 5 1
1 3 3 2
2 2 5 1


Output

11


Input

5 3
1 2 3 4
10 1 1
1 1 1
1 10 1
1 1 1
1 1 10


Output

20
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.util.LinkedList;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Xi Lin
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF {
        static int N = 50000 + 10;
        static long[] mx = new long[N * 4];
        static long[] tag = new long[N * 4];

        void push(int rt) {
            if (tag[rt] != 0) {
                tag[lson(rt)] += tag[rt];
                tag[rson(rt)] += tag[rt];
                mx[lson(rt)] += tag[rt];
                mx[rson(rt)] += tag[rt];
                tag[rt] = 0;
            }
        }

        int lson(int x) {
            return x << 1;
        }

        int rson(int x) {
            return x << 1 | 1;
        }

        void modify(int rt, int l, int r, int L, int R, long v) {
            if (R < l || L > r) return;
            if (L <= l && R >= r) {
                mx[rt] += v;
                tag[rt] += v;
                return;
            }
            push(rt);
            int mid = (l + r) >> 1;
            modify(lson(rt), l, mid, L, R, v);
            modify(rson(rt), mid + 1, r, L, R, v);
            mx[rt] = max(mx[lson(rt)], mx[rson(rt)]);
        }

        long ask(int rt, int l, int r, int L, int R) {
            if (R < l || L > r) return 0;
            if (L <= l && R >= r) return mx[rt];
            push(rt);
            int mid = (l + r) >> 1;
            return max(ask(lson(rt), l, mid, L, R), ask(rson(rt), mid + 1, r, L, R));
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            long A[] = new long[n - 1];
            for (int i = 0; i < n - 1; ++i) {
                A[i] = in.nextInt();
            }
            LinkedList<W>[] queue = new LinkedList[m];
            for (int i = 0; i < m; ++i) {
                queue[i] = new LinkedList<W>();
                queue[i].add(new W((int) (1e9 + 10), -1));
            }
            int B[] = new int[m];
            long ret = 0;
            for (int i = 0; i < n; ++i) {
                long total = 0;
                for (int j = 0; j < m; ++j) {
                    B[j] = in.nextInt();
                    total += B[j];
                }
                ret = max(ret, total);
                for (int j = 0; j < m; ++j) {
                    while (B[j] >= queue[j].getLast().val) {
                        //out.printf("%d ", queue[j].size());
                        W e = queue[j].pollLast();
                        //queue[j].size();
                        //out.printf("%d\n", queue[j].size());
                        modify(1, 0, n - 1, queue[j].getLast().idx + 1, e.idx, -e.val);
                    }
                    modify(1, 0, n - 1, queue[j].getLast().idx + 1, i, B[j]);
                    queue[j].add(new W(B[j], i));
                }
                if (i > 0) {
                    modify(1, 0, n - 1, 0, i - 1, -A[i - 1]);
                }
                ret = max(ret, ask(1, 0, n - 1, 0, i));

            }
            out.println(ret);
        }

        long max(long a, long b) {
            if (a > b) return a;
            else return b;
        }

        class W {
            int val;
            int idx;

            public W(int _v, int _i) {
                val = _v;
                idx = _i;
            }

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

