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 java.io.*;
import java.util.*;
import java.math.*;
@SuppressWarnings("unchecked")
public class DhakaJi {
    class Node{
        int x ;
        int y ;
        Node(int x ,int y){
            this.x = x ;
            this.y =y;
        }
    }
    InputStream is;
    PrintWriter out;
    
    long mod = (long)(1e9 + 7), inf = (long)(3e18);
    
    void solve() {
        //SZ = sieve(); //SZ = 1000001;
        int n = ni() ;
        int k = ni() ;
        Node []arr = new Node[n];
        for(int i=0;i<n;i++){
            arr[i] = new Node(ni(),ni());
        }
        Arrays.sort(arr,(x,y)->x.y-y.y);
        int min = (int )(1e9);
        long sum = 0 ;
        long max = 0;
        PriorityQueue<Integer> pq = new PriorityQueue<>();
        for(int i=n-1;i>=n-k;i--){
            sum += arr[i].x;
            pq.add(arr[i].x);
            max = Math.max(max ,sum*arr[i].y);
        }
        for(int i=n-k-1;i>=0;i--){
            if(arr[i].x>pq.peek()){
                sum -=pq.poll();
                pq.add(arr[i].x);
                sum+=arr[i].x;
            }
            max = Math.max(max , sum*arr[i].y);
        }
        out.println(max);
        // for(int i=n-k+1 ;i<n;i++){
        //     sum += arr[i].x ;
        //     min = Math.min(min,arr[i].y );
        // }
        // long max = (sum+arr[n-k].x)*(Math.min(min,arr[n-k].y)) ;   
        // for(int i=0;i<n-k;i++){
        //     long temp = sum+arr[i].x;
        //     long m = Math.min(min,arr[i].y);
        //     long s = temp*m ;
        //     max = Math.max(max ,s);
        // }
        // long temp = 0 ;
        // int m = arr[n-1].y;
        // for(int i=n-1 ;i>=n-k;i--){
        //     temp+=arr[i].x;
        //     m = Math.min(m,arr[i].y);
        //     long s = temp*m ;
        //     max = Math.max(max,s);
        // }
        // out.println(max);
    }
    
    //--------- Extra Template -----------
    boolean isPrime(long n) {
        if(n <= 1)  return false;
        if(n <= 3)   return true;
        if(n%2 == 0 || n%3 == 0)    return false;
        for(long i = 5; i * i <= n; i += 6) {
            if(n % i == 0 || n % (i + 2) == 0)  return false;
        }
        return true;
    }

    int P[], S[], SZ, NP = 15485900;
    boolean isP[];    

    public int log2(int n){
        if(n <= 0) throw new IllegalArgumentException();
        return 31 - Integer.numberOfLeadingZeros(n);
    }
    int sieve() {
        int i, j, n = NP; 
        isP = new boolean[n]; 
        S = new int[n];
        for(i = 3; i < n; i += 2) {
            isP[i] = true;
            S[i-1] = 2;
            S[i] = i;
        }
        isP[2] = true;
        S[1] = 1;   //(UD)
        for(i = 3; i * i <= n; i += 2) {
            if( !isP[i] )   continue;
            for(j = i * i; j < n; j += i) {
                isP[j] = false;
                if(S[j] == j)   S[j] = i;
            }
        }
        P = new int[n];
        P[0] = 2;
        j = 1;
        for(i = 3; i < n; i += 2) {
            if ( isP[i] )   P[j++] = i;
        }
        P = Arrays.copyOf(P, j);
        return j;
    }
    long gcd(long a,long b){
        while (a!=0 && b!=0) 
        {            
            if(a>b)
               a%=b;
            else
                b%=a;
        }
        return a+b;
    }
    long mp(long b, long e, long mod) {
        b %= mod;
        long r = 1;
        while(e > 0) {
            if((e & 1) == 1) {
                r *= b; r %= mod;
            }
            b *= b; b %= mod;
            e >>= 1;
        }
        return r;
    }

    //---------- I/O Template ----------
    
    public static void main(String[] args) throws Exception { new DhakaJi().run(); }
    void run() throws Exception { 
        is = System.in; 
        out = new PrintWriter(System.out);
        // long s = System.currentTimeMillis();
        solve();
        out.flush();
        // tr((System.currentTimeMillis()-s)/1000+"s");
    }
    
    byte input[] = new byte[1024];
    int len = 0, ptr = 0;
    
    int readByte() { 
        if(ptr >= len) { ptr = 0; 
            try { len = is.read(input); } 
            catch(IOException e) { throw new InputMismatchException(); } 
            if(len <= 0) { return -1; } 
        } return input[ptr++];
    }
    boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }
    int skip() { 
        int b = readByte(); 
        while(b != -1 && isSpaceChar(b)) { b = readByte(); } 
        return b;
    }
    
    char nc() { return (char)skip(); }
    String ns() { 
        int b = skip(); 
        StringBuilder sb = new StringBuilder(); 
        while(!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); } 
        return sb.toString();
    }
    String nLine() { 
        int b = skip(); 
        StringBuilder sb = new StringBuilder(); 
        while( !(isSpaceChar(b) && b != ' ') ) { sb.appendCodePoint(b); b = readByte(); } 
        return sb.toString();
    }
    int ni() { 
        int n = 0, b = readByte(); 
        boolean minus = false; 
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); } 
        if(b == '-') { minus = true; b = readByte(); } 
        if(b == -1) { return -1; }  //no input 
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); } 
        return minus ? -n : n;
    }
    long nl() { 
        long n = 0L;    int b = readByte(); 
        boolean minus = false; 
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); } 
        if(b == '-') { minus = true; b = readByte(); } 
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); } 
        return minus ? -n : n;
    }
    double nd() { return Double.parseDouble(ns()); }
    float nf() { return Float.parseFloat(ns()); }
    int[] na(int n) { 
        int a[] = new int[n]; 
        for(int i = 0; i < n; i++) { a[i] = ni(); } 
        return a;
    }
    char[] ns(int n) { 
        char c[] = new char[n]; 
        int i, b = skip(); 
        for(i = 0; i < n; i++) { 
            if(isSpaceChar(b)) { break; } 
            c[i] = (char)b; b = readByte(); 
        } return i == n ? c : Arrays.copyOf(c,i);
    }
    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}