#!/usr/bin/ruby

require 'rational'

$INF = 10000

class Function
  def initialize(x, y)
    raise unless x.length == y.length
    @x = [-$INF] + x + [+$INF]
    @y = [  0  ] + y + [  0  ]
    @n = @x.length
  end

  def value(x)
    i = 0
    j = @n

    xi = x.to_i

    while j - i > 1
      m = (i + j) / 2

      if xi < @x[m] then
        j = m
      else
        i = m
      end
    end

    a = Rational(@y[i+1] - @y[i], @x[i+1] - @x[i])
    return a * (x - @x[i]) + @y[i]
  end
end

class String
  def to_r
    case self
    when /^([+-]?[0-9]+)\/([0-9]+)$/
      Rational($1.to_i,$2.to_i)
    when /^([+-]?[0-9]+)$/
      Rational($1.to_i,1)
    when /^[+-]?\.$/
      raise ArgumentError
    when /^([+-]?[0-9]*)\.([0-9]*)$/
      Rational(($1 + $2).to_i, 10 ** $2.length)
    else
      raise ArgumentError
    end
  end
end

while true
  s = gets.split

  n = s[0].to_i
  r = s[1].to_r

  break if [n,r] == [0,0]
  x, y = (1..n).map { gets.split.map { |s| s.to_i } }.transpose
  f = Function.new(x, y)
  x = ( x + x.map { |xi| xi - r } ).sort

  s = 0

  x1 = x[1]
  y1 = f.value(x1) * f.value(x1 + r)

  (2..(x.length - 1)).each do |i|
    x0 = x1
    x1 = x[i]
    xm = Rational(1,2) * (x0 + x1)

    y0 = y1
    y1 = f.value(x1) * f.value(x1 + r)
    ym = f.value(xm) * f.value(xm + r)

    # the Simpson's rule
    s += (y0 + 4 * ym + y1) * (x1 - x0)
  end

  puts (s / 6).to_f
  $stdout.flush
end
