#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <cmath>

#define ll long long

using namespace std;

struct wall {

    int attack, defence, min_defence;
};

wall make_wall (int a, int d) {

    wall w;

    w.attack = a;
    w.defence = d;

    w.min_defence = ceil( a * 1.0 / d );

    return w;
}

bool cmp (wall a, wall b) {

    return a.defence < b.defence;
}

int main () {

    ios_base::sync_with_stdio(0);

    ifstream cin("castle.in");
    ofstream cout("castle.out");

    ll n, s, _s = 0;
    cin >> n >> s;

    vector <wall> w(n);

    for (int i = 0; i < n; i++) {

        int a, d;
        cin >> a >> d;

        w[i] = make_wall(a, d);
        _s += w[i].min_defence;
    }

    sort( w.begin(), w.end(), &cmp );

    int a = 0, c = 0;

    while ( _s > s && c < w.size() ) {

        if ( w[c].min_defence ) {

            int m = ( _s - s > w[c].min_defence ? w[c].min_defence : _s - s );

            w[c].min_defence -= m;

            a -= w[c].min_defence * w[c].defence - w[c].attack;

            _s -= m;

        } else {

            ++c;
        }
    }

    cout << a;
}
