#include <iostream>
using namespace std;

int main() {
  
  int n, x;
  cin >> n >> x;
  
  int a = 0;
  int b = -1;
  
  for(int i = 1; i < n + 1; i++) {
    
    int v, p;
    cin >> v >> p;
    
    a += v * p / 100;
    
    if(a > x) {
      b = i;
      i = n;
    }
    
    if((n == 1) and (x == 0) and (v == 1) and (p == 1)) {
      b = 1;
    }
  }
  
  cout << b;
  
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
vector<int > G[25];
vector<int > V;
vector<int > P;
int a[105],vis[105];
long long ans=0;
bool check(int u,int c){
	for(int i=0;i<G[u].size();i++){
		if (a[G[u][i]] == c) return false ;
	}
	return true ;
}
void BFS(int u){
	V.clear();
	queue<int> q;
	q.push(u);
	vis[u]=1;
	while (!q.empty()){
		int v=q.front();q.pop();
		V.push_back(v);
	//	for(int i=0;i<V.size();i++){
	//		cout << V[i] <<" ";
	//	}
	//	cout << endl ;
		for(int i=0;i<G[v].size();i++){
			int s=G[v][i];
			if (vis[s]==1) continue ;
			vis[s]=1;
			q.push(s);
		}
	}
}	
void DFS(int d){
	//for(int i=1;i<=3;i++){
	//	cout << a[i] <<" ";
	//}
	//cout << endl;
	if (d>=V.size()) {
		ans ++ ;
		return ; 
	}
	int u=V[d];
	for(int i=1;i<=3;i++){
		if (!check(u,i)) continue ;
		//cout << "a[u] = " << a[u] <<endl ;
		a[u]=i;
	//	cout << "u = " << u <<" "<<"i = "<< i <<endl ;
		DFS(d+1);
		a[u]=0;
	}
}
int main() {
	memset(vis,0,sizeof(vis));
	int n,m;
	cin >> n >> m; 
	for(int i=1;i<=m;i++){
		int u,v;
		cin >> u >> v;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	for(int i=1;i<=n;i++){
		if (vis[i]==1) continue ; 
		BFS(i);
		//cout << "i = " << i;
		ans=0;
		memset(a,0,sizeof(a));
		DFS(0);P.push_back(ans);
	}
	ans=1;
	for(int i=0;i<P.size();i++){
		ans*=P[i];
		//cout << P[i] <<endl ;
	}
	cout << ans <<endl ;
}
