void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  import std.typecons;
  
  int n, p; rd(n, p);
  alias T=Tuple!(int, "w", int, "b");
  auto data=new T[](n);
  foreach(i; 0..n) rd(data[i].w, data[i].b);

  auto g(long w, long b){return (100-p)*w+p*b;}
  sort!((l, r)=>(g(l.w, l.b)>g(r.w, r.b)))(data);
  long yes=0, no=reduce!((r, e)=>(r+e.b))(0L, data);
  foreach(i, e; data){
    yes+=e.w; no-=e.b;
    if(yes*100>=(yes+no)*p){// yes/(yes+no)>=p/100 , yes*100>=(yes+no)p
      writeln(i+1); return;
    }
  }
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}
void wr(T...)(T x){
  import std.stdio;
  foreach(e; x) write(e, " ");
  writeln();
}
