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;
template <class T>
inline void smin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void smax(T &a, T b) {
  if (a < b) a = b;
}
const double eps = 1e-9;
const int maxn = 300 + 10;
int n, k;
int ys[maxn][maxn];
int perm[maxn];
inline pair<double, double> operator+(pair<double, double> p,
                                      pair<double, double> q) {
  return pair<double, double>(p.first + q.first, p.second + q.second);
}
inline pair<double, double> operator-(pair<double, double> p,
                                      pair<double, double> q) {
  return pair<double, double>(p.first - q.first, p.second - q.second);
}
inline pair<double, double> operator*(pair<double, double> p, double m) {
  return pair<double, double>(p.first * m, p.second * m);
}
inline pair<double, double> operator*(double m, pair<double, double> p) {
  return pair<double, double>(p.first * m, p.second * m);
}
inline pair<double, double> operator+=(pair<double, double> &p,
                                       pair<double, double> q) {
  return p = p + q;
}
inline pair<double, double> operator-=(pair<double, double> &p,
                                       pair<double, double> q) {
  return p = p - q;
}
inline pair<double, double> operator*=(pair<double, double> &p, double m) {
  return p = p * m;
}
inline double cross(pair<double, double> p, pair<double, double> q) {
  return p.first * q.second - p.second * q.first;
}
inline double cross(pair<double, double> p, pair<double, double> q1,
                    pair<double, double> q2) {
  return (q1.first - p.first) * (q2.second - p.second) -
         (q1.second - p.second) * (q2.first - p.first);
}
pair<double, double> intersection(pair<double, double> a,
                                  pair<double, double> b,
                                  pair<double, double> c,
                                  pair<double, double> d) {
  return c + cross(c - a, b - a) / cross(b - a, d - c) * (d - c);
}
double calc(int xx, int t) {
  int max_slope = -999999;
  static pair<double, double> st[maxn];
  int len = 0;
  for (int pi = 0, _n = (int)(n); pi < _n; pi++)
    if (perm[pi] < t) {
      int i = perm[pi];
      int y0 = ys[i][xx], y1 = ys[i][xx + 1];
      int slope = y1 - y0;
      if (slope <= max_slope) continue;
      max_slope = slope;
      pair<double, double> p0 = pair<double, double>(0, y0),
                           p1 = pair<double, double>(1, y1);
      if (len == 0) {
        st[len++] = p0, st[len++] = p1;
        continue;
      }
      if (p1.second <= st[len - 1].second + eps) continue;
      while (1) {
        if (len < 2) cerr << " ERROR" << endl;
        pair<double, double> in =
            intersection(st[len - 2], st[len - 1], p0, p1);
        if (in.first <= st[len - 2].first)
          len--;
        else {
          len--;
          st[len++] = in;
          st[len++] = p1;
          break;
        }
      }
    }
  double area = 0;
  for (int i = 0, _n = (int)(len - 1); i < _n; i++)
    area += (st[i + 1].first - st[i].first) * (st[i].second + st[i + 1].second);
  return area / 2;
}
double ans[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 0, _n = (int)(n); i < _n; i++)
    for (int j = 0, _n = (int)(k + 1); j < _n; j++) cin >> ys[i][j];
  for (int xx = 0, _n = (int)(k); xx < _n; xx++) {
    for (int j = 0, _n = (int)(n); j < _n; j++) perm[j] = j;
    sort(perm, perm + n, [xx](int i, int j) {
      return (ys[i][xx] != ys[j][xx] ? ys[i][xx] > ys[j][xx]
                                     : ys[i][xx + 1] > ys[j][xx + 1]);
    });
    double prev = 0;
    for (int i = (int)(1), _n = (int)(n + 1); i < _n; i++) {
      double tmp = calc(xx, i);
      ans[i - 1] += tmp - prev;
      prev = tmp;
    }
  }
  cout << fixed << setprecision(7);
  for (int i = 0, _n = (int)(n); i < _n; i++) cout << ans[i] << endl;
  {
    int _;
    cin >> _;
    return 0;
  }
}