#include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>

#include <deque>
#include <string>

using namespace std;

class NyaGadgetPositionalNotation
{	// N進数を表現するクラス
public:
	NyaGadgetPositionalNotation(int cardinal)
	{
		cardinal_ = cardinal;
		symbol_index_collection_.push_back(0);
	}
	void Inc()
	{	// 返り値なしのインクリメント
		bool carry = true;
		int index = (int)symbol_index_collection_.size() - 1;
		while (0 <= index && carry)
		{
			if (symbol_index_collection_[index] != cardinal_ - 1)
			{
				symbol_index_collection_[index]++;
				carry = false;
			}
			else
			{	// 桁上り
				symbol_index_collection_[index] = 0;
				if (index == 0)
					symbol_index_collection_.push_front(1);
				carry = true;
			}
			index--;
		}
	}
	NyaGadgetPositionalNotation operator ++()
	{	// 前置インクリメント
		Inc();
		return *this;
	}
	NyaGadgetPositionalNotation operator ++(int)
	{  // 後置インクリメント
		NyaGadgetPositionalNotation pn = *this;
		Inc();
		return pn;
	}
	/**
	@brief N進数取得関数
	@note
	 d桁のN進数として文字列で取得
	---------------------------------------------------------------------------
	[sample]
	int main()
	{	// 16進数テスト
		NyaGadgetPositionalNotation pn(16);

		for (int i = 0; i < 30; i++)
			pn++;

		cout << pn() << endl;		// 30を16進数で表示
		cout << pn(5) << endl;		// 5桁表示

		return 0;
	}
	---------------------------------------------------------------------------
	[output]
	1E
	0001E
	**/
	string operator()(int d = 0)
	{
		std::string positional_nation;

		for (const auto& e : symbol_index_collection_)
			positional_nation += symbols_[e];

		if (d == 0 || d == positional_nation.size())
			return positional_nation;

		if (positional_nation.size() < d)
		{	// 表示桁に空きがあるときは0で埋める
			std::string zero(d - positional_nation.size(), '0');
			positional_nation = zero + positional_nation;
		}

		return positional_nation;
	}
	/**
	@brief d桁目を取得する演算子
	@note
	 d桁目の数字を文字列で取得する。
	-------------------------------------------------------------------------- -
	[sample]
	int main()
	{	// 16進数テスト
		NyaGadgetPositionalNotation pn(16);

		for (int i = 0; i < 30; i++)
			pn++;

		cout << pn.() << endl;		// 30を16進数で表示
		cout << pn[0] << endl;		// １桁目を表示
		cout << pn[1] << endl;		// ２桁目を表示

		return 0;
	}
	-------------------------------------------------------------------------- -
	[output]
	1E
	E
	1
	**/
	char operator[](int d)
	{	// d桁目の数字を取得する
		int index = (int)symbol_index_collection_.size() - 1 - d;
		return symbols_[symbol_index_collection_[index]][0];
	}
private:
	int cardinal_;	// 基数
	string symbols_[36] =
	{	// 36進数まで対応
		"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
		"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
		"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
		"U", "V", "W", "X", "Y", "Z",
	};
	// シンボルそのものでなく、シンボルに対応するindexを格納していく
	deque<int> symbol_index_collection_;
};


using namespace std;

#define all(collection) (collection).begin(), (collection).end()
#define loop(i, times) for(int i = 0; i < times; i++)
#define seloop(i, start_index, end_index) for(int i = start_index; i < end_index; i++)
#define eqseloop(i, start_index, end_index) for(int i = start_index; i <= end_index; i++)

struct TupleProblem
{
	static const int arg_num_ = 0;
	static const int arg_bornus = 1;
};

struct TupleSolve
{
	static const int arg_count_ = 0;
	static const int arg_score_ = 1;
	static const int arg_pn_ = 2;
};



class Abc104C
{
public:
	void Run(void)
	{
		int d; cin >> d;
		long g; cin >> g;

		problem_collection_.resize(d);
		loop(i, d)
		{
			cin >> get<TupleProblem::arg_num_>(problem_collection_[i]);
			cin >> get<TupleProblem::arg_bornus>(problem_collection_[i]);
		}

		solve_collection_.resize((int)pow(2, d));
		NyaGadgetPositionalNotation pn(2);
		loop(i, pow(2, d))
		{
			get<TupleSolve::arg_pn_>(solve_collection_[i]) = pn(d);
			SolveAll(problem_collection_, solve_collection_[i]);
			SolveX(problem_collection_, solve_collection_[i], g);
			pn++;
		}

		sort(solve_collection_.begin(), solve_collection_.end());
		for (const auto & e : solve_collection_)
		{
			if (g <= get<TupleSolve::arg_score_>(e))
			{
				cout << get<TupleSolve::arg_count_>(e);
				return;
			}
		}
	}
	void SolveX(const vector<tuple<long, long>>& problem_collection, tuple<long, long, string>& solve, const long goal)
	{
		for (int pn_index = (int)get<TupleSolve::arg_pn_>(solve).size() - 1; 0 <= pn_index; pn_index--)
		{
			if (get<TupleSolve::arg_pn_>(solve)[pn_index] == '0')
			{
				loop(i, get<TupleProblem::arg_num_>(problem_collection[pn_index]) - 1)
				{
					if (goal <= get<TupleSolve::arg_score_>(solve))
						return;
					get<TupleSolve::arg_score_>(solve) += (pn_index + 1) * 100;
					get<TupleSolve::arg_count_>(solve)++;
				}
			}
		}
	}
	void SolveAll(const vector<tuple<long, long>>& problem_collection, tuple<long, long, string>& solve)
	{
		int index_problem = 0;
		for (auto& elm_pn: get<TupleSolve::arg_pn_>(solve))
		{
			if (elm_pn == '1')
			{
				get<TupleSolve::arg_score_>(solve) += (index_problem +1) * 100 * get<TupleProblem::arg_num_>(problem_collection[index_problem]) + get<TupleProblem::arg_bornus>(problem_collection[index_problem]);
				get<TupleSolve::arg_count_>(solve) += get<TupleProblem::arg_num_>(problem_collection[index_problem]);
			}
			index_problem++;
		}
	}

private:
	// <num, bornus>
	vector<tuple<long, long>> problem_collection_;
	// <count, score, pn>
	vector<tuple<long, long, string>> solve_collection_;
};

int main()
{
	Abc104C abc104c;
	abc104c.Run();
	return 0;
}

Measured memory_bytes: 384