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;
#pragma GCC optimize("Ofast")
const long long int maxn = 3e2 + 16, md = 1e9 + 7, inf = 2e17;
long long int gcd(long long int a, long long int b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int tav(long long int n, long long int k) {
  long long int res = 1;
  while (k > 0) {
    if (k & 1) {
      res *= n;
      res %= md;
    }
    n *= n;
    n %= md;
    k >>= 1;
  }
  return res;
}
struct line {
  long double a, b;
  void build_line(pair<long double, long double> c,
                  pair<long double, long double> d) {
    b = c.second;
    a = (d.second - c.second) / (long double)1;
    return;
  }
};
pair<long double, long double> merge(line a, line b) {
  pair<long double, long double> res;
  if (a.a == b.a) {
    return {-2, -2};
  }
  res.first = (long double)1 * (a.b - b.b) / (b.a - a.a);
  res.second = res.first * a.a + a.b;
  return res;
}
long long int a[maxn][maxn];
line l[maxn][maxn];
long double ans[maxn];
vector<pair<long double, long double> > v, v1;
vector<long long int> u, u1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, k;
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    ans[i] = 0;
    for (long long int j = 0; j <= k; j++) {
      cin >> a[i][j];
    }
    for (long long int j = 0; j < k; j++) {
      l[i][j].build_line({0, (long double)a[i][j]},
                         {1, (long double)a[i][j + 1]});
    }
  }
  for (long long int j = 0; j < k; j++) {
    v.clear();
    u.clear();
    v.push_back({0, (long double)a[0][j]});
    v.push_back({1, (long double)a[0][j + 1]});
    u.push_back(0);
    long double o = (a[0][j] + a[0][j + 1]) / (long double)2;
    ans[0] += o;
    for (long long int i = 1; i < n; i++) {
      long long int us = (int)u.size();
      bool ch = false, done = false;
      if (a[i][j] > v[0].second) {
        v1.push_back({0, a[i][j]});
        ch = true;
      } else {
        v1.push_back(v[0]);
      }
      for (long long int e = 0; e < us; e++) {
        if (done) {
          u1.push_back(u[e]);
          v1.push_back(v[e + 1]);
        }
        long long int ind = u[e];
        pair<long double, long double> h = merge(l[ind][j], l[i][j]);
        if (!ch) {
          if ((h.first > v[e].first ||
               (h.first == v[e].first && l[i][j].a > l[ind][j].a)) &&
              h.first < v[e + 1].first) {
            ch = true;
            v1.push_back(h);
            u1.push_back(ind);
            continue;
          }
        }
        if (ch) {
          if (h.first >= v[e].first && h.first < v[e + 1].first) {
            done = true;
            v1.push_back(h);
            u1.push_back(i);
            v1.push_back(v[e + 1]);
            u1.push_back(ind);
          }
          continue;
        }
        v1.push_back(v[e + 1]);
        u1.push_back(ind);
      }
      if (a[i][j + 1] >= v[us].second && ch && !done) {
        v1.push_back({1, a[i][j + 1]});
        u1.push_back(i);
      }
      u = u1;
      v = v1;
      v1.clear();
      u1.clear();
      us = (int)u.size();
      long double q = 0;
      for (long long int e = 0; e < us; e++) {
        long double h = (v[e + 1].second + v[e].second) *
                        (v[e + 1].first - v[e].first) / (long double)2;
        q += h;
      }
      ans[i] += q - o;
      o = q;
    }
  }
  for (long long int i = 0; i < n; i++) {
    cout << fixed << setprecision(8) << ans[i] << '\n';
  }
  return 0;
}