Problem: You have a playlist consisting of n songs. The i-th song is characterized by two numbers t_i and b_i — its length and beauty respectively. The pleasure of listening to set of songs is equal to the total length of the songs in the set multiplied by the minimum beauty among them. For example, the pleasure of listening to a set of 3 songs having lengths [5, 7, 4] and beauty values [11, 14, 6] is equal to (5 + 7 + 4) ⋅ 6 = 96.

You need to choose at most k songs from your playlist, so the pleasure of listening to the set of these songs them is maximum possible.

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 3 ⋅ 10^5) – the number of songs in the playlist and the maximum number of songs you can choose, respectively.

Each of the next n lines contains two integers t_i and b_i (1 ≤ t_i, b_i ≤ 10^6) — the length and beauty of i-th song.

Output

Print one integer — the maximum pleasure you can get.

Examples

Input


4 3
4 7
15 1
3 6
6 8


Output


78


Input


5 3
12 31
112 4
100 100
13 55
55 50


Output


10000

Note

In the first test case we can choose songs {1, 3, 4}, so the total pleasure is (4 + 3 + 6) ⋅ 6 = 78.

In the second test case we can choose song 3. The total pleasure will be equal to 100 ⋅ 100 = 10000.

Solution (in JAVA):

Solution:

import javafx.scene.CacheHint;

import java.io.*;
import java.util.*;

public class Q3 {


    public static void main(String[] args) {

        InputReader in = new InputReader();
        int N = in.nextInt(), K = in.nextInt();

        int input[][] = new int[N][2];

        for (int i = 0; i < N; i++) {
            input[i ][0] = in.nextInt();
            input[i ][1] = in.nextInt();
        }

        Arrays.sort(input, new Comparator<int[]>() {
            public int compare(int[] a, int[] b) {
                 return Integer.compare(b[1], a[1]);
            }
        });

        PriorityQueue<Integer> pq=new PriorityQueue();
        long add=0,max=Integer.MIN_VALUE;
        for (int i = 0; i < N; i++) {

            add+=input[i][0];
            pq.add(input[i][0]);

            if(pq.size()>K)
                add-=pq.poll();

            max=Math.max(add*input[i][1],max);

        }

        System.out.println(max);
    }


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

            public int[] shuffle(int[] arr) {
                Random r = new Random();
                for (int i = 1, j; i < arr.length; i++) {
                    j = r.nextInt(i);
                    arr[i] = arr[i] ^ arr[j];
                    arr[j] = arr[i] ^ arr[j];
                    arr[i] = arr[i] ^ arr[j];
                }
                return arr;
            }

            public InputReader() {
                reader = new BufferedReader(new InputStreamReader(System.in), 32768);
                tokenizer = null;
            }

            public InputReader(InputStream stream) {
                reader = new BufferedReader(new InputStreamReader(System.in), 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 char nextChar() {
                return next().charAt(0);
            }

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

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

            public double nextDouble() {
                return Double.parseDouble(next());
            }

            public int[] nextIntArr(int n) {
                int[] arr = new int[n];
                for (int i = 0; i < n; i++) {
                    arr[i] = this.nextInt();
                }
                return arr;
            }

            public Integer[] nextIntegerArr(int n) {
                Integer[] arr = new Integer[n];
                for (int i = 0; i < n; i++)
                    arr[i] = new Integer(this.nextInt());

                return arr;
            }

            public int[][] next2DIntArr(int n, int m) {
                int[][] arr = new int[n][m];
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < m; j++) {
                        arr[i][j] = this.nextInt();
                    }
                }
                return arr;
            }

            public int[] nextSortedIntArr(int n) {
                int[] arr = new int[n];
                for (int i = 0; i < n; i++) {
                    arr[i] = this.nextInt();
                }
                Arrays.sort(arr);
                return arr;
            }

            public long[] nextLongArr(int n) {
                long[] arr = new long[n];
                for (int i = 0; i < n; i++) {
                    arr[i] = this.nextLong();
                }
                return arr;
            }

            public char[] nextCharArr(int n) {
                char[] arr = new char[n];
                for (int i = 0; i < n; i++) {
                    arr[i] = this.nextChar();
                }
                return arr;
            }


            public static int gcd(int a, int b) {
                return b == 0 ? a : gcd(b, a % b);
            }

            public static int[] uwiSieve(int n) {
                if (n <= 32) {
                    int[] primes = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
                    for (int i = 0; i < primes.length; i++) {
                        if (n < primes[i]) {
                            return Arrays.copyOf(primes, i);
                        }
                    }
                    return primes;
                }

                int u = n + 32;
                double lu = Math.log(u);
                int[] ret = new int[(int) (u / lu + u / lu / lu * 1.5)];
                ret[0] = 2;
                int pos = 1;

                int[] isp = new int[(n + 1) / 32 / 2 + 1];
                int sup = (n + 1) / 32 / 2 + 1;

                int[] tprimes = {3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
                for (int tp : tprimes) {
                    ret[pos++] = tp;
                    int[] ptn = new int[tp];
                    for (int i = (tp - 3) / 2; i < tp << 5; i += tp)
                        ptn[i >> 5] |= 1 << (i & 31);
                    for (int i = 0; i < tp; i++) {
                        for (int j = i; j < sup; j += tp)
                            isp[j] |= ptn[i];
                    }
                }

                // 3,5,7
                // 2x+3=n
                int[] magic = {0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13, 31, 22, 28, 18, 26, 10, 7, 12, 21, 17,
                        9, 6, 16, 5, 15, 14};
                int h = n / 2;
                for (int i = 0; i < sup; i++) {
                    for (int j = ~isp[i]; j != 0; j &= j - 1) {
                        int pp = i << 5 | magic[(j & -j) * 0x076be629 >>> 27];
                        int p = 2 * pp + 3;
                        if (p > n)
                            break;
                        ret[pos++] = p;
                        for (int q = pp; q <= h; q += p)
                            isp[q >> 5] |= 1 << (q & 31);
                    }
                }

                return Arrays.copyOf(ret, pos);
            }

            public static int[] radixSort(int[] f) {
                return radixSort(f, f.length);
            }

            public static int[] radixSort(int[] f, int n) {
                int[] to = new int[n];
                {
                    int[] b = new int[65537];
                    for (int i = 0; i < n; i++) b[1 + (f[i] & 0xffff)]++;
                    for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                    for (int i = 0; i < n; i++) to[b[f[i] & 0xffff]++] = f[i];
                    int[] d = f;
                    f = to;
                    to = d;
                }
                {
                    int[] b = new int[65537];
                    for (int i = 0; i < n; i++) b[1 + (f[i] >>> 16)]++;
                    for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
                    for (int i = 0; i < n; i++) to[b[f[i] >>> 16]++] = f[i];
                    int[] d = f;
                    f = to;
                    to = d;
                }
                return f;
            }
        }


    }


// for(Map.Entry<Integer,Integer> Test: map.entrySet()){
//            int Key=Test.getKey();
//            int val=Test.getValue();
//        }


//        HashMap<Integer,Integer> map=new HashMap<>();
//        for(int i=0;i<;i++){
//             ch=input[i];
//        if(map.containsKey(ch))
//            map.put(ch,map.get(ch)+1);
//        else
//            map.put(ch,1);
//        }
//
//