#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

const int maxn = (int) 1e4 + 100;
const int inf = (int) 1e9 + 100;

int n, s;
int a[maxn];
int k[maxn];

int d[200][maxn];

int go(int pos, int ost) {
	if (ost < 0) {
		return inf;
	}

	if (pos == n) {
		return d[pos][ost] = 0;
	} else if (d[pos][ost] == -1) {
		d[pos][ost] = inf;

		for (int i = 0; i <= (int)a[pos] / k[pos] + 1; i++) {
			if (i <= ost) {
				d[pos][ost] = min(d[pos][ost], go(pos + 1, ost - i) + max(0, a[pos] - i * k[pos]));
			}
		}
	}

	return d[pos][ost];
}

int main() {
	freopen("castle.in", "r", stdin);
	freopen("castle.out", "w", stdout);

	scanf("%d %d", &n, &s);

	for (int i = 0; i < n; i++) {
		scanf("%d %d", &a[i], &k[i]);
	}

	for (int i = 0; i < 200; i++) {
		for (int j = 0; j < maxn; j++) {
			d[i][j] = -1;
		}
	}

	cout << go(0, s) << endl;

	return 0;
}