
#include <iostream>
#include <vector>
#include <algorithm>

#pragma comment (linker, "/STACK:1000000000")

using namespace std;

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

	int n = 0, s = 0;
	cin >> n >> s;

	vector <int> moving (n);
	vector <int> coeff  (n);

	for (int i = 0; i < n; i++)
		cin >> moving [i] >> coeff [i];

	vector < vector <int> > ans (n, vector <int> (s + 1));

	for(int x = 0; x <= s; x++)
	{
		int going = x * coeff [0];

		if (going >= moving [0])
			break;
		else
		{
			ans [0][x] = moving [0] - going;
		}
	}

	for (int i = 1; i < n; i++)
	{
		for(int curr_s = 0; curr_s <= s; curr_s++)
		{
			int curr_min = moving [i] + ans [i - 1][curr_s];

			for(int x = 0; x <= curr_s; x++)
			{
				int going     = x * coeff [i];
				int curr_left = (going >= moving [i]) ? 0 : (moving [i] - going);

				curr_min = min (curr_min, curr_left + ans [i - 1][curr_s - x]);
			}

			ans [i][curr_s] = curr_min;
		}
	}

	cout << ans [n - 1][s] << "\n";

	return 0;
}

