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 double eps = 1e-9;
template <class T>
bool eq(T a, T b) {
  return abs(a - b) < eps;
}
template <class T>
int sgn(T r) {
  return eq(r, 0.0) ? 0 : (r > 0 ? 1 : -1);
}
double crP(complex<double> v1, complex<double> v2) {
  return (conj(v1) * v2).imag();
}
double crP(complex<double> p1, complex<double> p2, complex<double> p3) {
  return crP(p2 - p1, p3 - p1);
}
struct Line {
  double a, b, c;
  Line() {}
  Line(double a, double b, double c) : a(a), b(b), c(c) {}
  Line(complex<double> p1, complex<double> p2) {
    if (eq(abs(p1 - p2), 0.0)) {
      fprintf(stderr, "called Line for same points\n");
      assert(0);
    }
    double x1 = p1.real(), y1 = p1.imag();
    double x2 = p2.real(), y2 = p2.imag();
    a = y2 - y1;
    b = -(x2 - x1);
    c = x1 * y2 - x2 * y1;
  }
};
double det(double a, double b, double c, double d) { return a * d - b * c; }
complex<double> linesIntersection(Line l1, Line l2) {
  double a = l1.a, b = l1.b, c = l1.c;
  double d = l2.a, e = l2.b, f = l2.c;
  double den = det(a, b, d, e);
  double numx = det(c, b, f, e);
  double numy = det(a, c, d, f);
  if (eq(den, 0.0)) {
    return complex<double>(NAN, NAN);
  }
  return complex<double>(numx / den, numy / den);
}
complex<double> linesIntersection(complex<double> p1, complex<double> p2,
                                  complex<double> p3, complex<double> p4) {
  Line l1 = Line(p1, p2);
  Line l2 = Line(p3, p4);
  return linesIntersection(l1, l2);
}
vector<complex<double> > convexCut(vector<complex<double> > p,
                                   complex<double> a, complex<double> b) {
  vector<complex<double> > q;
  if (p.size() == 0) return q;
  p.push_back(p[0]);
  for (int i = 0; i < p.size() - 1; i++) {
    if (sgn(crP(a, b, p[i])) >= 0) q.push_back(p[i]);
    if (sgn(crP(a, b, p[i])) * sgn(crP(a, b, p[i + 1])) < 0)
      q.push_back(linesIntersection(a, b, p[i], p[i + 1]));
  }
  return q;
}
vector<complex<double> > convexCut(vector<complex<double> > p1,
                                   vector<complex<double> > p2) {
  p2.push_back(p2[0]);
  vector<complex<double> > res = p1;
  for (int i = 0; i < p2.size() - 1; i++) {
    if (eq(p2[i], p2[i + 1])) continue;
    res = convexCut(res, p2[i], p2[i + 1]);
  }
  return res;
}
double getArea(vector<complex<double> > p) {
  if (p.size() <= 2) return 0;
  double res = 0;
  p.push_back(p[0]);
  for (int i = 0; i < p.size() - 1; i++) {
    res += crP(p[i], p[i + 1]);
  }
  if (res < 0) res *= -1;
  return res / 2;
}
void print(vector<complex<double> > p) {
  for (int i = 0; i < p.size(); i++) {
    printf("(%f,%f)\n", p[i].real(), p[i].imag());
  }
}
const double MY = 2000;
double a[330][330];
double all = MY;
double ys[330][330];
int K;
int N;
void solve(int x) {
  vector<complex<double> > p;
  p.push_back(complex<double>(x, 0));
  p.push_back(complex<double>(x + 1, 0));
  p.push_back(complex<double>(x + 1, MY));
  p.push_back(complex<double>(x, MY));
  for (int i = 0; i < N; i++) {
    complex<double> p1 = complex<double>(x, ys[i][x]);
    complex<double> p2 = complex<double>(x + 1, ys[i][x + 1]);
    p = convexCut(p, p1, p2);
    a[i][x] = getArea(p);
  }
}
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j <= K; j++) {
      scanf("%lf", &ys[i][j]);
    }
  }
  for (int i = 0; i < K; i++) solve(i);
  for (int i = 0; i < N; i++) {
    double ans = 0;
    for (int j = 0; j < K; j++) {
      double tmp1 = i == 0 ? all : a[i - 1][j];
      double tmp2 = a[i][j];
      ans += (tmp1 - tmp2);
    }
    printf("%.9f\n", ans);
  }
  return 0;
}