import java.io.*; import java.util.*; public class donthungertogether_suhas { static class food{ double quantity; int expiration; public food(double q, int e){ this.quantity = q; this.expiration = e; } } public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); food[] arr = new food[n]; double r = 0; for (int i = 0; i < n; i++){ arr[i] = new food(sc.nextInt(), sc.nextInt()); r = Math.max(r,arr[i].quantity); } double l = 0; for (int i = 0; i < 60; i++){ // adjust? double mid = (l+r)/2.0; PriorityQueue pq = new PriorityQueue<>((o1,o2) -> o1.expiration-o2.expiration); boolean works = true; for (int j = 0; j < n; j++){ pq.add(arr[j]); double needToEat = mid; while (!pq.isEmpty() && needToEat != 0){ food next = pq.remove(); if (j+1 > next.expiration){ continue; } double eatVal = Math.min(needToEat,next.quantity); needToEat -= eatVal; food addBack = new food(next.quantity-eatVal,next.expiration); if (addBack.quantity > 0) pq.add(addBack); } if (needToEat != 0) { works = false; break; } } if (works){ l = mid; }else{ r = mid; } } if (l == 0){ System.out.println(-1); }else { System.out.println(l / k); } } }