You have n devices that you want to use simultaneously.

The i-th device uses a_{i} units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·a_{i} units of power. The i-th device currently has b_{i} units of power stored. All devices can store an arbitrary amount of power.

You have a single charger that can plug to any single device. The charger will add p units of power per second to a device. This charging is continuous. That is, if you plug in a device for λ seconds, it will gain λ·p units of power. You can switch which device is charging at any arbitrary unit of time (including real numbers), and the time it takes to switch is negligible.

You are wondering, what is the maximum amount of time you can use the devices until one of them hits 0 units of power.

If you can use the devices indefinitely, print -1. Otherwise, print the maximum amount of time before any one device hits 0 power.


-----Input-----

The first line contains two integers, n and p (1 ≤ n ≤ 100 000, 1 ≤ p ≤ 10^9) — the number of devices and the power of the charger.

This is followed by n lines which contain two integers each. Line i contains the integers a_{i} and b_{i} (1 ≤ a_{i}, b_{i} ≤ 100 000) — the power of the device and the amount of power stored in the device in the beginning.


-----Output-----

If you can use the devices indefinitely, print -1. Otherwise, print the maximum amount of time before any one device hits 0 power.

Your answer will be considered correct if its absolute or relative error does not exceed 10^{ - 4}.

Namely, let's assume that your answer is a and the answer of the jury is b. The checker program will consider your answer correct if $\frac{|a - b|}{\operatorname{max}(1, b)} \leq 10^{-4}$.


-----Examples-----
Input
2 1
2 2
2 1000

Output
2.0000000000
Input
1 100
1 1

Output
-1

Input
3 5
4 3
5 2
6 1

Output
0.5000000000


-----Note-----

In sample test 1, you can charge the first device for the entire time until it hits zero power. The second device has enough power to last this time without being charged.

In sample test 2, you can use the device indefinitely.

In sample test 3, we can charge the third device for 2 / 5 of a second, then switch to charge the second device for a 1 / 10 of a second.

Difficulty: interview

Starter code:

Solutions:
from math import inf
n, p = [int(x) for x in input().split()]
l = []
for i in range(n):
    a, b = [int(x) for x in input().split()]
    l.append((a, b, b/a))
l.sort(key=lambda x: x[2])
asum = 0
bsum = 0
sumt = 0
for i in range(n):
    a0, b0, _ = l[i]
    c1 = inf if i == n-1 else l[i+1][2]
    asum += a0
    bsum += b0
    dp = asum - p
    if dp > 0:
        t = bsum / dp
        if t < c1:
            print(t)
            return
print(-1)

from math import inf
n, p = [int(x) for x in input().split()]
l = []
for i in range(n):
    a, b = [int(x) for x in input().split()]
    l.append((a, b, b/a))
l.sort(key=lambda x: x[2])
asum = 0
bsum = 0
sumt = 0
for i in range(n):
    a0, b0, _ = l[i]
    c1 = inf if i == n-1 else l[i+1][2]
    asum += a0
    bsum += b0
    dp = asum - p
    if dp > 0:
        t = bsum / dp
        if t < c1:
            print(t)
            return
print(-1)

f = lambda: map(int, input().split())
n, p = f()
s = [0] * n
x, y = -p, 0
for i in range(n):
    a, b = f()
    x += a
    y += b
    s[i] = (a, b)
s.sort(key=lambda q: q[0] / q[1])
for a, b in s:
    if b * x > a * y:
        x -= a
        y -= b
    else: break
print(y / x if x > 0 else -1)

import math
from bisect import bisect_right
from itertools import accumulate

R = lambda: map(int, input().split())
n, p = R()
devs = []
for i in range(n):
    devs.append(tuple(R()))
devs = sorted(devs, key=lambda x: x[1]/x[0])
sp, sr, t = 0, 0, math.inf
for d in devs:
    sp += d[0]
    sr += d[1]
    if sp > p:
        t = min(t, sr / (sp - p))
print(t if t < math.inf else -1)

from math import inf

n, p = [int(x) for x in input().split()]

l = []

for i in range(n):

    a, b = [int(x) for x in input().split()]

    l.append((a, b, b/a))

l.sort(key=lambda x: x[2])

asum = 0

bsum = 0

sumt = 0

for i in range(n):

    a0, b0, _ = l[i]

    c1 = inf if i == n-1 else l[i+1][2]

    asum += a0

    bsum += b0

    dp = asum - p

    if dp > 0:

        t = bsum / dp

        if t < c1:

            print(t)

            return

print(-1)



# Made By Mostafa_Khaled