#include <bits/stdc++.h>
using namespace std;
const int N = 123456;
int n, p, a[N], b[N];
bool can(double time) {
  double have = 0;
  for (int i = 0; i < n; i++) {
    have += max(0.0, (a[i] * time - b[i]) / p);
  }
  return have <= time;
}
int main() {
  scanf("%d %d", &n, &p);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  double l = 0.0, r = 1e15, ans = 0.0;
  for (int iter = 0; iter < 1000; iter++) {
    double mid = (l + r) / 2.0;
    if (can(mid)) {
      ans = max(ans, mid);
      l = mid;
    } else {
      r = mid;
    }
  }
  if (l > 1e14) {
    printf("%d", -1);
  } else {
    printf("%.10f", ans);
  }
  return 0;
}
