Problem: Problem statement

Real variables $ x_1, x_2, ..., x_N $ satisfy the following conditions.

1. $ 0 \ leq x_i \ leq 1 $ ($ 1 \ leq i \ leq N $)
2. $ w_1x_1 + w_2x_2 + ... + w_Nx_N \ leq W $



At this time, find the maximum value that $ v_1x_1 + v_2x_2 + ... + v_Nx_N $ can take. It is known that such a maximum actually exists.

Constraint

* $ 1 \ leq N \ leq 10 ^ 5 $
* $ 1 \ leq W \ leq 10 ^ 5 $
* $ -10 ^ 4 \ leq w_i \ leq 10 ^ 4 $
* $ -10 ^ 4 \ leq v_i \ leq 10 ^ 4 $



input

Input follows the following format. All given numbers are integers.


$ N $ $ W $
$ w_1 $ $ v_1 $
$ w_2 $ $ v_2 $
$ ... $
$ w_N $ $ v_N $

output

Output the maximum possible value of $ v_1x_1 + v_2x_2 + ... + v_Nx_N $ on one line. The output must not have an error greater than $ 10 ^ {-3} $.

Examples

Input

1 1
3 1


Output

0.333333


Input

2 3
3 3
1 2


Output

4.000000


Input

2 1
-1 -3
3 10


Output

3.666667

Solution (in CPP):

Solution:
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

struct Vect {
  double w;
  double v;
  double t;
  Vect() {;}
  Vect(double w, double v, double t) : w(w), v(v), t(t) {;}
  bool operator<(const Vect &rhs) const {
    return t > rhs.t;
  }
};

int N, W;
int main() {
  while (scanf("%d %d", &N, &W) > 0) {
    double ans = 0.0;
    vector<Vect> plus;
    vector<Vect> minus;
    REP(i, N) {
      double w, v;
      scanf("%lf %lf", &w, &v);
      if (w >= 0 && v <= 0) {
        continue;
      } else if (w <= 0 && v >= 0) {
        ans += v;
        W -= w;
      } else if (w > 0 && v > 0) {
        plus.push_back(Vect(w, v, v / w));
      } else if (w < 0 && v < 0) {
        minus.push_back(Vect(w, v, w / v));
      } else {
        assert(false);
      }
    }
    sort(plus.begin(), plus.end());
    sort(minus.begin(), minus.end());
    multimap<double, double> event;
    {
      double t = 0.0;
      FORIT(it, plus) {
        event.insert(make_pair(t, it->v / it->w));
        t += fabs(it->w);
      }
      event.insert(make_pair(t, 1e-30));
      t = W;
      FORIT(it, minus) {
        event.insert(make_pair(t, -it->v / it->w));
        t += fabs(it->w);
      }
      event.insert(make_pair(t, -1e-30));
    }
    double pt = 0.0;
    double pGrad = 0.0;
    double mGrad = 0.0;
    double sum = 0.0;
    double best = 0.0;
    FORIT(it, event) {
      double nt = it->first;
      sum += (pGrad + mGrad) * (nt - pt);
      best = max(best, sum);
      if (it->second > 0) { pGrad = it->second; }
      if (it->second < 0) { mGrad = it->second; }
      if (mGrad == -1e-30) { break; }
      pt = nt;
    }
    ans += best;
    printf("%.8lf\n", ans);
  }
}