The only difference between the easy and the hard versions is constraints.

A subsequence is a string that can be derived from another string by deleting some or no symbols without changing the order of the remaining symbols. Characters to be deleted are not required to go successively, there can be any gaps between them. For example, for the string "abaca" the following strings are subsequences: "abaca", "aba", "aaa", "a" and "" (empty string). But the following strings are not subsequences: "aabaca", "cb" and "bcaa".

You are given a string s consisting of n lowercase Latin letters.

In one move you can take any subsequence t of the given string and add it to the set S. The set S can't contain duplicates. This move costs n - |t|, where |t| is the length of the added subsequence (i.e. the price equals to the number of the deleted characters).

Your task is to find out the minimum possible total cost to obtain a set S of size k or report that it is impossible to do so.

Input

The first line of the input contains two integers n and k (1 ≤ n ≤ 100, 1 ≤ k ≤ 10^{12}) — the length of the string and the size of the set, correspondingly.

The second line of the input contains a string s consisting of n lowercase Latin letters.

Output

Print one integer — if it is impossible to obtain the set S of size k, print -1. Otherwise, print the minimum possible total cost to do it.

Examples

Input


4 5
asdf


Output


4


Input


5 6
aaaaa


Output


15


Input


5 7
aaaaa


Output


-1


Input


10 100
ajihiushda


Output


233

Note

In the first example we can generate S = { "asdf", "asd", "adf", "asf", "sdf" }. The cost of the first element in S is 0 and the cost of the others is 1. So the total cost of S is 4.
import java.util.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;

public class r570p5{

    private static InputReader sc;
    private static PrintWriter pw;

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        InputReader(InputStream stream) {
            this.stream = stream;
        }

        int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
            boolean isSpaceChar(int ch);
        }
    }

    public static void main(String args[]) {
        sc = new InputReader(System.in);
        pw = new PrintWriter(System.out);

        int t = 1;
        while(t-->0)
            solve();

        pw.flush();
        pw.close();
    }

    private static void solve(){
        int n = sc.nextInt();
        long k = sc.nextLong();

        String str = sc.readString();

        long arr[][] = new long[n][n+1], sum[] = new long[n+1];

        ArrayList<ArrayList<Integer>> list = new ArrayList<>();

        for(int i=0; i<26; i++)
            list.add(new ArrayList<>());

        for(int i=0; i<n; i++){
            int p = str.charAt(i) - 'a';

            if(list.get(p).isEmpty())
                arr[i][1] = 1;

            for(int j=2; j<=n; j++){
                arr[i][j] = sum[j-1];

                for(int prev: list.get(p))
                    arr[i][j] -= arr[prev][j];
            }

            for(int j=1; j<=n; j++)
                sum[j] += arr[i][j];

            list.get(p).add(i);
        }

//        for(int i=0; i<n; i++){
//            for(int j=1; j<=n; j++) {
//                System.out.print(+arr[i][j] + "\t");
//            }
//            System.out.println();
//        }
//
//        for(int j=1; j<=n; j++)
//            System.out.print(+sum[j]+"\t");

        long ans = 0;
        int col = n;
        while(k>0 && col>0){

            if(k > sum[col]){
                ans += sum[col]*(n-col);
                k -= sum[col];
            }
            else{
                ans += k*(n-col);
                k = 0;
                break;
            }
//
//            for(int row=col-1; row<n; row++){
//                if(k > arr[row][col]){
//                    ans += arr[row][col]*(n-col);
//                    k -= arr[row][col];
//                }
//                else{
//                    ans += k*(n-col);
//                    k = 0;
//                    break;
//                }
//            }
            col--;
        }

        if(k == 1) {
            ans += n;
            k--;
        }

        if(k == 0)
            pw.println(+ans);
        else
            pw.println(-1);
    }
}