Problem: Due to atheistic Soviet past, Christmas wasn't officially celebrated in Russia for most of the twentieth century. As a result, the Russian traditions for Christmas and New Year mixed into one event celebrated on the New Year but including the tree, a Santa-like 'Grandfather Frost', presents and huge family reunions and dinner parties all over the country. Bying a Tree at the New Year and installing it in the house is a tradition. Usually the whole family decorates the tree on the New Year Eve. We hope that Codeforces is a big and loving family, so in this problem we are going to decorate a tree as well.

So, our decoration consists of n pieces, each piece is a piece of colored paper, its border is a closed polyline of a special shape. The pieces go one by one as is shown on the picture. The i-th piece is a polyline that goes through points: (0, 0), (0, y0), (1, y1), (2, y2), ..., (k, yk), (k, 0). The width of each piece equals k.

<image> The figure to the left shows the decoration, the figure to the right shows the individual pieces it consists of.

The piece number 1 (shown red on the figure) is the outer piece (we see it completely), piece number 2 (shown yellow) follows it (we don't see it completely as it is partially closed by the first piece) and so on. The programmers are quite curious guys, so the moment we hung a decoration on the New Year tree we started to wonder: what area of each piece can people see?

Input

The first line contains two integers, n and k (1 ≤ n, k ≤ 300). Each of the following n lines contains k + 1 integers — the description of the polyline. If the i-th line contains ontegers yi, 0, yi, 1, ..., yi, k, that means that the polyline of the i-th piece goes through points (0, 0), (0, yi, 0), (1, yi, 1), (2, yi, 2), ..., (k, yi, k), (k, 0) (1 ≤ yi, j ≤ 1000).

Output

Print n real numbers — for each polyline, the area of its visible part.

The answer will be considered correct if its relative or absolute error do not exceed 10 - 4. 

Examples

Input

2 2
2 1 2
1 2 1


Output

3.000000000000
0.500000000000


Input

1 1
1 1


Output

1.000000000000


Input

4 1
2 7
7 2
5 5
6 4


Output

4.500000000000
1.250000000000
0.050000000000
0.016666666667

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int intmax = 0x3f3f3f3f;
const long long lldmax = 0x3f3f3f3f3f3f3f3fll;
double eps = 1e-8;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline T lowbit(T n) {
  return (n ^ (n - 1)) & n;
}
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
template <class T>
inline T checkmod(T n, T m) {
  return (n % m + m) % m;
}
inline int rand(int a, int b) {
  if (a >= b) return a;
  return rand() % (b - a) + a;
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T euclid(T a, T b, T &x, T &y) {
  if (a < 0) {
    T d = euclid(-a, b, x, y);
    x = -x;
    return d;
  }
  if (b < 0) {
    T d = euclid(a, -b, x, y);
    y = -y;
    return d;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    T d = euclid(b, a % b, x, y);
    T t = x;
    x = y;
    y = t - (a / b) * y;
    return d;
  }
}
template <class T>
inline vector<pair<T, int> > factorize(T n) {
  vector<pair<T, int> > R;
  for (T i = 2; n > 1;) {
    if (n % i == 0) {
      int C = 0;
      for (; n % i == 0; C++, n /= i)
        ;
      R.push_back(make_pair(i, C));
    }
    i++;
    if (i > n / i) i = n;
  }
  if (n > 1) R.push_back(make_pair(n, 1));
  return R;
}
template <class T>
inline bool isPrimeNumber(T n) {
  if (n <= 1) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
inline T eularFunction(T n) {
  vector<pair<T, int> > R = factorize(n);
  T r = n;
  for (int i = 0; i < R.size(); i++) r = r / R[i].first * (R[i].first - 1);
  return r;
}
template <class T>
inline int dblcmp(T a, const T b) {
  a -= b;
  return a > eps ? 1 : (a < -eps ? -1 : 0);
}
template <class T>
inline int sgn(T a) {
  return a > eps ? 1 : (a < -eps ? -1 : 0);
}
const int N = 610;
double tx[N], ty[N];
struct node {
  double x[N], y[N];
  int n;
  double sum;
  void init() {
    n = 1;
    x[0] = 0, x[1] = 1;
    y[0] = 0, y[1] = 0;
  }
  double cal(double l, double r, double x) { return (r - l) * x + l; }
  double cal(double l1, double l2, double r1, double r2) {
    return abs(l1 - l2) / (abs(l1 - l2) + abs(r1 - r2));
  }
  double add(double l, double r) {
    double last = sum;
    int m = 0, i;
    sum = 0;
    for (i = 0; i <= n; ++i) {
      if (dblcmp(y[i], cal(l, r, x[i])) < 0) break;
      tx[m] = x[i];
      ty[m] = y[i];
      m++;
    }
    if (i <= n) {
      if (i == 0) {
        tx[m] = x[i];
        ty[m++] = cal(l, r, x[i]);
      } else {
        tx[m] = (x[i] - x[i - 1]) *
                    cal(y[i - 1], cal(l, r, x[i - 1]), y[i], cal(l, r, x[i])) +
                x[i - 1];
        ty[m] = cal(l, r, tx[m]);
        m++;
      }
      i++;
    }
    for (; i <= n && dblcmp(y[i], cal(l, r, x[i])) < 0; ++i)
      ;
    if (i <= n) {
      tx[m] = (x[i] - x[i - 1]) *
                  cal(y[i - 1], cal(l, r, x[i - 1]), y[i], cal(l, r, x[i])) +
              x[i - 1];
      ty[m] = cal(l, r, tx[m]);
      m++;
    }
    for (; i <= n; ++i) {
      tx[m] = x[i];
      ty[m] = y[i];
      m++;
    }
    m--;
    if (tx[m] != x[n]) {
      m++;
      tx[m] = x[n];
      ty[m] = cal(l, r, tx[m]);
    }
    for (int i = 0; i <= m; ++i) {
      x[i] = tx[i];
      y[i] = ty[i];
    }
    n = m;
    for (int i = 0; i < n; ++i) {
      sum += (y[i] + y[i + 1]) * (x[i + 1] - x[i]) / 2;
    }
    return sum - last;
  }
} a[N];
int main() {
  int n, k;
  double y[N];
  cin >> n >> k;
  for (int j = 0; j < k; ++j) a[j].init();
  for (int i = 0; i < n; ++i) {
    double ans = 0;
    for (int j = 0; j <= k; ++j) cin >> y[j];
    for (int j = 0; j < k; ++j) ans += a[j].add(y[j], y[j + 1]);
    printf("%.10lf\n", ans);
  }
  return 0;
}