Polycarp is practicing his problem solving skill. He has a list of n problems with difficulties a_1, a_2, ..., a_n, respectively. His plan is to practice for exactly k days. Each day he has to solve at least one problem from his list. Polycarp solves the problems in the order they are given in his list, he cannot skip any problem from his list. He has to solve all n problems in exactly k days.

Thus, each day Polycarp solves a contiguous sequence of (consecutive) problems from the start of the list. He can't skip problems or solve them multiple times. As a result, in k days he will solve all the n problems.

The profit of the j-th day of Polycarp's practice is the maximum among all the difficulties of problems Polycarp solves during the j-th day (i.e. if he solves problems with indices from l to r during a day, then the profit of the day is max_{l ≤ i ≤ r}a_i). The total profit of his practice is the sum of the profits over all k days of his practice.

You want to help Polycarp to get the maximum possible total profit over all valid ways to solve problems. Your task is to distribute all n problems between k days satisfying the conditions above in such a way, that the total profit is maximum.

For example, if n = 8, k = 3 and a = [5, 4, 2, 6, 5, 1, 9, 2], one of the possible distributions with maximum total profit is: [5, 4, 2], [6, 5], [1, 9, 2]. Here the total profit equals 5 + 6 + 9 = 20.

Input

The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 2000) — the number of problems and the number of days, respectively.

The second line of the input contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 2000) — difficulties of problems in Polycarp's list, in the order they are placed in the list (i.e. in the order Polycarp will solve them).

Output

In the first line of the output print the maximum possible total profit.

In the second line print exactly k positive integers t_1, t_2, ..., t_k (t_1 + t_2 + ... + t_k must equal n), where t_j means the number of problems Polycarp will solve during the j-th day in order to achieve the maximum possible total profit of his practice.

If there are many possible answers, you may print any of them.

Examples

Input

8 3
5 4 2 6 5 1 9 2


Output

20
3 2 3

Input

5 1
1 1 1 1 1


Output

1
5


Input

4 2
1 2000 2000 2


Output

4000
2 2

Note

The first example is described in the problem statement.

In the second example there is only one possible distribution.

In the third example the best answer is to distribute problems in the following way: [1, 2000], [2000, 2]. The total profit of this distribution is 2000 + 2000 = 4000.
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Stack2 {

    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }
            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }

    static Reader sc = new Reader();
    static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        /*
         * For integer input: int n=inputInt();
         * For long input: long n=inputLong();
         * For double input: double n=inputDouble();
         * For String input: String s=inputString();
         * Logic goes here
         * For printing without space: print(a+""); where a is a variable of any datatype
         * For printing with space: printSp(a+""); where a is a variable of any datatype
         * For printing with new line: println(a+""); where a is a variable of any datatype
         */
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] ar = new int[n];
        Map<Integer, List<Integer>> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
            map.putIfAbsent(ar[i], new ArrayList<>());
            List<Integer> list = map.get(ar[i]);
            list.add(i);
            map.put(ar[i], list);
        }
        List<Integer> list = new ArrayList<>(map.keySet());
        Collections.sort(list);
        List<Integer> answers = new ArrayList<>();
        int count = k;
        long sum=0;
        process:
        for (int j = list.size() - 1; j >= 0; j--) {
            for (Integer integer : map.get(list.get(j))) {
                answers.add(integer);
                count--;
                sum+=list.get(j);
                if (count <= 0) {
                    break process;
                }
            }
        }
        Collections.sort(answers);
        List<Integer> answ1=new ArrayList<>();
        answ1.add((answers.get(0)+1));
        int prev=answers.get(0);
       // System.out.println(answers);
        long s2=answers.get(0)+1;
        for(int j=1;j<answers.size()-1;j++){
            int num=answers.get(j);
            answ1.add((num-prev));
            s2+=(num-prev);
            prev=num;

        }
       // System.out.println(s2);
        if(answers.size()>1){
            answ1.add((int) (n-s2));
        }else {
            answ1.set(0,n);
        }


        System.out.println(sum);
        for(Integer integer:answ1){
            System.out.print(integer+" ");
        }
        System.out.println();



        bw.flush();
        bw.close();


    }

    public static long getAns(int v1, int v2, int t, int d, int prev1, int prev2) {
        if (t <= 0) {
            return 0;
        }
        if (t == 1) {
            int max = Math.max(v1, v2);
            int min = Math.min(v1, v2);
            if (Math.abs(prev1 - max) <= d && Math.abs(prev2 - max) <= d) {
                return max;
            } else {
                return min;
            }
        }
        if (Math.abs(v1 - v2) <= d) {
            return (v1 + v2) + getAns(v1 + d, v2 + d, t - 2, d, v1, v2);
        } else {
            return (v1 + v2) + getAns(v1 + d, v2 - d, t - 2, d, v1, v2);
        }


    }


    public static void bfs(int r, int c, Queue<int[]> queue, long[][] dis, char[][] map, boolean[][] visited) {
        while (!queue.isEmpty()) {
            int[] ar = queue.poll();
            int x = ar[0];
            int y = ar[1];
            if (x + 1 < r) {
                if (map[x + 1][y] != 'T' && dis[x + 1][y] > (dis[x][y] + 1)) {
                    dis[x + 1][y] = Math.min(dis[x + 1][y], (dis[x][y] + 1));
                    queue.add(new int[]{x + 1, y});
                } /*else if (map[x][y] != map[x + 1][y] && dis[x + 1][y] > (dis[x][y] + 1)) {
                    dis[x + 1][y] = Math.min(dis[x + 1][y], dis[x][y] + 1);
                    queue.add(new int[]{x + 1, y});
                }*/
              /*  if(!visited[x+1][y] ){
                    queue.add(new int[]{x + 1, y});
                    visited[x+1][y]=true;
                }*/


            }
            if (y + 1 < c) {
                if (map[x][y + 1] != 'T' && dis[x][y + 1] > (dis[x][y] + 1)) {
                    dis[x][y + 1] = Math.min(dis[x][y + 1], dis[x][y] + 1);
                    queue.add(new int[]{x, y + 1});
                } /*else if (map[x][y] != map[x][y + 1] && dis[x][y + 1] > (dis[x][y] + 1)) {
                    dis[x][y + 1] = Math.min(dis[x][y + 1], dis[x][y] + 1);
                    queue.add(new int[]{x, y + 1});
                }*/
               /* if( !visited[x][y+1]){
                    queue.add(new int[]{x, y+1});
                    visited[x][y+1]=true;
                }*/


            }
            if (x - 1 >= 0) {
                if (map[x - 1][y] != 'T' && dis[x - 1][y] > (dis[x][y] + 1)) {
                    dis[x - 1][y] = Math.min(dis[x - 1][y], (dis[x][y] + 1));
                    queue.add(new int[]{x - 1, y});
                } /*else if (map[x][y] != map[x - 1][y] && dis[x - 1][y] > (dis[x][y] + 1)) {
                    dis[x - 1][y] = Math.min(dis[x - 1][y], dis[x][y] + 1);
                    queue.add(new int[]{x - 1, y});
                }*/
               /* if(!visited[x-1][y]){
                    queue.add(new int[]{x - 1, y});
                    visited[x-1][y]=true;
                }*/


            }
            if (y - 1 >= 0) {
                if (map[x][y - 1] != 'T' && dis[x][y - 1] > (dis[x][y] + 1)) {
                    dis[x][y - 1] = Math.min(dis[x][y - 1], (dis[x][y] + 1));
                    queue.add(new int[]{x, y - 1});
                } /*else if (map[x][y] != map[x][y - 1] && dis[x][y - 1] > (dis[x][y] + 1)) {
                    dis[x][y - 1] = Math.min(dis[x][y - 1], dis[x][y] + 1);
                    queue.add(new int[]{x, y - 1});
                }*/
               /* if(!visited[x][y-1]){
                    queue.add(new int[]{x , y-1});
                    visited[x][y-1]=true;
                }*/


            }
        }
    }


    public static void dfs1(List<List<Integer>> g, boolean[] visited, Stack<Integer> stack, int num) {
        visited[num] = true;
        for (Integer integer : g.get(num)) {
            if (!visited[integer]) {
                dfs1(g, visited, stack, integer);
            }
        }
        stack.push(num);
    }

    public static void dfs2(List<List<Integer>> g, boolean[] visited, List<Integer> list, int num, int c, int[] raj) {
        visited[num] = true;

        for (Integer integer : g.get(num)) {
            if (!visited[integer]) {
                dfs2(g, visited, list, integer, c, raj);
            }
        }
        raj[num] = c;
        list.add(num);

    }

    public static int inputInt() throws IOException {
        return sc.nextInt();
    }

    public static long inputLong() throws IOException {
        return sc.nextLong();
    }

    public static double inputDouble() throws IOException {
        return sc.nextDouble();
    }

    public static String inputString() throws IOException {
        return sc.readLine();
    }

    public static void print(String a) throws IOException {
        bw.write(a);
    }

    public static void printSp(String a) throws IOException {
        bw.write(a + " ");
    }

    public static void println(String a) throws IOException {
        bw.write(a + "\n");
    }


    public static long getAns(int[] ar, int c, long[][] dp, int i, int sign) {
        if (i < 0) {
            return 1;
        }

        if (c <= 0) {
            return 1;
        }

        dp[i][c] = Math.max(dp[i][c], Math.max(ar[i] * getAns(ar, c - 1, dp, i - 1, sign), getAns(ar, c, dp, i - 1, 1)));
        return dp[i][c];
    }


    public static long power(long a, long b, long c) {
        long ans = 1;
        while (b != 0) {
            if (b % 2 == 1) {
                ans = ans * a;
                ans %= c;
            }
            a = a * a;
            a %= c;
            b /= 2;
        }
        return ans;
    }

    public static long power1(long a, long b, long c) {
        long ans = 1;
        while (b != 0) {
            if (b % 2 == 1) {
                ans = multiply(ans, a, c);
            }
            a = multiply(a, a, c);
            b /= 2;

        }
        return ans;

    }

    public static long multiply(long a, long b, long c) {
        long res = 0;
        a %= c;
        while (b > 0) {
            if (b % 2 == 1) {
                res = (res + a) % c;
            }
            a = (a + a) % c;
            b /= 2;
        }

        return res % c;

    }

    public static long totient(long n) {
        long result = n;
        for (long i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                //sum=sum+2*i;
                while (n % i == 0) {
                    n /= i;
                    // sum=sum+n;
                }
                result -= result / i;

            }
        }
        if (n > 1) {
            result -= result / n;

        }
        return result;
    }


    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

    public static boolean[] primes(int n) {
        boolean[] p = new boolean[n + 1];
        p[0] = false;
        p[1] = false;
        for (int i = 2; i <= n; i++) {
            p[i] = true;
        }

        for (int i = 2; i * i <= n; i++) {
            if (p[i]) {
                for (int j = i * i; j <= n; j += i) {
                    p[j] = false;
                }
            }

        }
        return p;
    }

    static void bogoSort(int[] a, int c) {
        // if array is not sorted then shuffle the
        // array again
        while (isSorted(a) == false) {
            c++;
            shuffle(a);
        }

    }

    // To generate permuatation of the array
    static void shuffle(int[] a) {
        // Math.random() returns a double positive
        // value, greater than or equal to 0.0 and
        // less than 1.0.
        for (int i = 1; i <= a.length; i++)
            swap(a, i, (int) (Math.random() * i));
    }

    // Swapping 2 elements
    static void swap(int[] a, int i, int j) {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    }

    // To check if array is sorted or not
    static boolean isSorted(int[] a) {
        for (int i = 1; i < a.length; i++)
            if (a[i] < a[i - 1])
                return false;
        return true;
    }

}