/*
TASK: stairs
LANG: C++
*/

#include <iostream>
#include <cmath>
#include <stdio.h>

int main() {
    int n, k;
    std::cin >> n >> k;
    double dims[n-1];
    char used[n-1];
    n-=1;
    for (int i = 0; i<n; i++) used[i]=0;
    //n+=1;
    double h1,d1,h2,d2;
    std::cin >> h1 >> d1;
    for (int i = 0; i<n; i++) {
        std::cin >> h2 >> d2;
        dims[i]=d1*h2;
        d1 = d2;
        h1 = h2;
    }
    //std::cout << "dims\n";
    //for (int i = 0; i<n; i++) std::cout << dims[i] << '\n';
    //std::cout << "END\n";
    double result = 0;
    int hn2 = n, hn = n-1;
    n++;
    while (n != k) {
          int i = 0;
          while (used[i]) i++;
          double min = dims[i];
          int pos = i;
          for (i++; i<hn2; i++) 
              if (!used[i] && min > dims[i]) min = dims[pos=i];
          //std::cout << "//min: " << min << "\n";
          result += min;
          if (pos < hn) {
                  int hpos = pos+1;
                  while (hpos < hn2 && used[hpos]) hpos++;
                  dims[hpos]+=dims[pos];
          }
          used[pos]=1;
          n--;
    }
    printf("%.3f", float(result));
    std::cin >> result;
    return 0;
}
