# include<bits/stdc++.h>
using namespace std;
# define ll long long int

double amount(ll v,ll p)
{
return (v*p);
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);

ll n;  cin>>n;
double x ; cin>>x; 
pair <int,int> pr[n];
for(ll i=0;i<n;i++)
{
ll v,p;  cin>>v>>p;
pr[i]={v,p};
}
double sum=0;
ll i;
for( i=0;i<n;i++)
{
sum+=amount(pr[i].first,pr[i].second);
if(sum>(x*100))
{
	cout<<i+1;
	break;
}
}
if(sum<=x*100)
cout<<-1;
}
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = (a), i##end = (b); i < i##end; ++i)
#define per(i, a, b) for (int i = (a) - 1, i##end = (b); i >= i##end; --i)
#define REP(i, a) rep(i, 0, a)
#define PER(i, a) per(i, a, 0)

namespace IO {
	const int MAXIOSIZE = 1 << 24 | 1;
	unsigned char buf[MAXIOSIZE], *p1, *p2;
	#define gc (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 24, stdin), p1 == p2) ? EOF : *p1++)
	template <typename T> void read(T& x) {
		x = 0; char ch = gc; bool flg = false;
		for (; ch < '0' || '9' < ch; ch = gc) if (ch == '-') flg |= true;
		for (; '0' <= ch && ch <= '9'; ch = gc) x = x * 10 + ch - '0';
		flg ? x = -x : 0;
	}
	template <typename T> void out(const T& x) { if (x > 9) out(x / 10); putchar(x % 10 + '0'); }
	template <typename T> inline void write(const T& x, const char& ed = ' ') { if (x < 0) putchar('-'), out(-x); else out(x); putchar(ed); }
}

typedef long long ll;

const int MAXVAL = 50 + 10;
const int Prime[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };

int n;
ll fans = LONG_LONG_MAX;
bool tag[MAXVAL];
vector<int> frac[MAXVAL];

int main() {
	#ifdef LOCAL
		freopen("in.txt", "r", stdin);
	#endif
	IO::read(n);
	
	REP(i, n) {
		ll x; IO::read(x);
		for (ll p = 2; p <= x; ++p) if ((x % p) == 0) {
			frac[i].push_back(p);
			while ((x % p) == 0) x /= p;
		}
	}
	
	REP(S, 1 << 15) {
		ll ans = 1; int curtag[MAXVAL];
		memset(curtag, 0, sizeof curtag);
		REP(i, 15) if ((S >> i) & 1) ans *= Prime[i], curtag[Prime[i]] = true;
		if (ans > fans) continue;
		bool OK = true;
		REP(i, n) {
			bool ok = false;
			for (int f : frac[i]) if (curtag[f]) {
				ok = true;
				break;
			}
			if (!ok) {
				OK = false;
				break;
			}
		}
		if (OK) fans = ans;
	}
	IO::write(fans);
	return 0;
}
