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 int N = 400, mod = int(1e9) + 7;
int n, k;
long double ans, cur;
int x[N];
pair<int, int> line[N][N];
int sz[N];
vector<pair<int, int> > rb;
int an;
long long A, C, A1, C1;
bool ok = 0;
long double getx(pair<int, int> x, pair<int, int> y, int i) {
  A = x.first - x.second;
  C = x.second * (i - 1) - x.first * i;
  A1 = y.first - y.second;
  C1 = y.second * (i - 1) - y.first * i;
  return (C - C1 + 0.0) / (A1 - A);
}
void add_line(int i, pair<int, int> p) {
  int k = sz[i];
  while (k > 1) {
    long double x1 = getx(line[i][k], line[i][k - 1], i);
    long double x2 = getx(line[i][k], p, i);
    if (x2 > x1) break;
    k--;
  }
  line[i][++k] = p;
  sz[i] = k;
}
void add(int i) {
  rb.clear();
  if (sz[i] == 0) {
    rb.push_back(make_pair(x[i - 1], x[i]));
  } else {
    bool first = 0;
    for (int j = 1; j <= sz[i]; j++) {
      if (!first && x[i - 1] > line[i][j].first ||
          (x[i - 1] == line[i][j].first && x[i] > line[i][j].second)) {
        rb.push_back(make_pair(x[i - 1], x[i]));
        first = 1;
      }
      rb.push_back(line[i][j]);
    }
    if (!first) rb.push_back(make_pair(x[i - 1], x[i]));
  }
  int k = 1;
  line[i][1] = rb[0];
  int mx = rb[0].second;
  sz[i] = 1;
  for (int j = 1; j < rb.size(); j++) {
    if (mx < rb[j].second) {
      add_line(i, rb[j]);
      mx = rb[j].second;
    }
  }
}
long double get(int i) {
  int k = sz[i];
  long double res = 0;
  long double x, y, px, py;
  px = i - 1;
  py = line[i][1].first;
  for (int j = 2; j <= k; j++) {
    x = getx(line[i][j], line[i][j - 1], i);
    y = (C1 * A - C * A1 + 0.0) / (A1 - A);
    res += (x - px) * (y + py) / 2.0;
    py = y;
    px = x;
  }
  x = i;
  y = line[i][k].second;
  res += (x - px) * (y + py) / 2.0;
  return res;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i <= k; i++) {
    scanf("%d", &x[i]);
    if (i > 0) {
      ans += (x[i] + x[i - 1]) / 2.0;
      add(i);
    }
  }
  printf("%.12lf\n", (double)ans);
  for (int it = 2; it <= n; it++) {
    cur = ans;
    ans = 0;
    ok = 0;
    for (int i = 0; i <= k; i++) {
      scanf("%d", &x[i]);
      if (i > 0) add(i);
    }
    for (int i = 1; i <= k; i++) {
      ans += get(i);
    }
    printf("%.12lf\n", double(ans - cur));
  }
  return 0;
}