#include <stdio.h>
#include <limits.h>

int N, M;
int D[10001];
int P[10001];

int solve(int i, int m)
{
    int j;
    int min = INT_MAX;

    if(i > N)
        return 0;

    if(m == 0){
        int sum = 0;
        for(j = i; j <=N; j++){
            sum += P[j] * D[j];
        }

        return sum;
    }

    for(j = 0; j <= D[i] && j <= m; j++){
        int temp = P[i] * (D[i] - j) + solve(i + 1, m - j);
        if(temp < min)
            min = temp;
    }

    return min;
}

int main(void)
{
    while(1){
        int i;
        scanf("%d %d", &N, &M);
        if(N == 0 && M == 0)
            break;

        for(i = 1; i <= N; i++){
            scanf("%d %d", D + i, P + i);
        }

        printf("%d\n", solve(0, M));
    }

    return 0;
}