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.*;
 
public class Main {
    static StringBuilder sb = new StringBuilder();
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        long k = sc.nextLong();
        k--;
        String s = sc.next();
        char[] s2 = s.toCharArray();
        int[][] next = new int[n][26];
        for(int i = 0; i < n; i++){
            Arrays.fill(next[i],-1);
        }
        for (int i = 0; i < n; ++i) {
    		for (int j = 0; j < 26; ++j) {
    			if (i > 0) next[i][j] = next[i - 1][j];
    		}
    		next[i][s2[i] - 'a'] = i;
    	}
        long[][] dp = new long[n+1][n+1];
        for(int i = 0; i < n; i++){
            dp[i][1] = 1;
        }
        long inf = (long)1e12;
        for (int len = 2; len < n; ++len) {
    		for (int i = 1; i < n; ++i) {
    			for (int j = 0; j < 26; ++j) {
    				if (next[i - 1][j] != -1) {
    					dp[i][len] = Math.min(inf, dp[i][len] + dp[next[i - 1][j]][len - 1]);
    				}
    			}
    		}
    	}
	    //pw.println(dp[n-1][n-2]);
	    long ans = 0;
	    for (int len = n - 1; len >= 1; --len) {
    		long cnt = 0;
    		for (int j = 0; j < 26; ++j) {
    			if (next[n - 1][j] != -1) {
    				cnt += dp[next[n - 1][j]][len];
    			}
    		}
    		if (cnt >= k) {
    			ans += k * (n - len);
    			k = 0;
    			break;
    		} else {
    			ans += cnt * (n - len);
    			k -= cnt;
    		}
    	}
    	if (k == 1) {
    		ans += n;
    		--k;
    	}
        pw.println(k <= 0 ? ans : -1);
        pw.flush();
    }
    
    static class GeekInteger {
        public static void save_sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }
        public static int[] shuffle(int[] array) {
            int n = array.length;
            Random random = new Random();
            for (int i = 0, j; i < n; i++) {
                j = i + random.nextInt(n - i);
                int randomElement = array[j];
                array[j] = array[i];
                array[i] = randomElement;
            }
            return array;
        }
 
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

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

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

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

    public double nextDouble() {
         return Double.parseDouble(next());
    }
    
    public String[] nextArray(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = next();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}
