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 INF = 2000;
const double eps = 1e-10;
const double PI = acos(-1);
const double TWO_PI = 2 * PI;
inline int dcmp(double x) { return abs(x) < eps ? 0 : x < 0 ? -1 : 1; }
inline double zero(double x) { return dcmp(x) == 0 ? 0 : x; }
struct Point {
  double x, y;
  Point(double xx = 0, double yy = 0) : x(xx), y(yy) {}
  void read() { cin >> x >> y; }
  void print() { cout << fixed << setprecision(12) << x << " " << y; }
};
Point operator+(Point A, Point B) { return Point(A.x + B.x, A.y + B.y); }
Point operator-(Point A, Point B) { return Point(A.x - B.x, A.y - B.y); }
Point operator*(Point A, double p) { return Point(A.x * p, A.y * p); }
Point operator/(Point A, double p) { return Point(A.x / p, A.y / p); }
bool operator<(const Point &a, const Point &b) {
  return dcmp(a.x - b.x) < 0 || (dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y) < 0);
}
bool operator==(const Point a, const Point b) {
  return dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y) == 0;
}
double Dot(Point A, Point B) { return A.x * B.x + A.y * B.y; }
double Length(Point A) { return sqrt(Dot(A, A)); }
double Angle(Point A, Point B) {
  return acos(Dot(A, B) / Length(A) / Length(B));
}
double Cross(Point A, Point B) { return A.x * B.y - A.y * B.x; }
double Area2(Point A, Point B, Point C) { return Cross(B - A, C - A); }
double angle(Point v) { return atan2(v.y, v.x); }
double torad(double deg) { return deg / 180.0 * PI; }
Point Rotate(Point A, double rad) {
  return Point(A.x * cos(rad) - A.y * sin(rad),
               A.x * sin(rad) + A.y * cos(rad));
}
Point Normal(Point A) {
  double L = Length(A);
  return Point(-A.y / L, A.x / L);
}
Point getLineIntersection(Point P, Point v, Point Q, Point w) {
  Point u = P - Q;
  double t = Cross(w, u) / Cross(v, w);
  return P + v * t;
}
bool onSegment(Point P, Point a1, Point a2) {
  return dcmp(Cross(a1 - P, a2 - P)) == 0 && dcmp(Dot(a1 - P, a2 - P)) < 0;
}
vector<Point> cutPolygon(const vector<Point> &P, Point A, Point B) {
  int n = P.size();
  vector<Point> newP;
  for (int i = 0; i < n; ++i) {
    Point C = P[i], D = P[i + 1 == n ? 0 : i + 1];
    if (dcmp(Cross(B - A, C - A)) >= 0) newP.push_back(C);
    if (dcmp(Cross(B - A, D - C)) != 0) {
      Point E = getLineIntersection(A, B - A, C, D - C);
      if (onSegment(E, C, D)) newP.push_back(E);
    }
  }
  return newP;
}
double polygonArea(vector<Point> &p) {
  int n = p.size();
  double area = 0;
  for (int i = 1; i < n - 1; i++) area += Cross(p[i] - p[0], p[i + 1] - p[0]);
  return area / 2;
}
int Y[350][350];
double ans[350];
int main(int argc, char const *argv[]) {
  int n, K;
  cin >> n >> K;
  for (int(i) = 0; (i) < (int)(n); ++(i))
    for (int(j) = (int)(0); (j) <= (int)(K); ++(j)) cin >> Y[i][j];
  for (int(x) = 0; (x) < (int)(K); ++(x)) {
    vector<Point> p = {Point(x, 0), Point(x + 1, 0), Point(x + 1, INF),
                       Point(x, INF)};
    double pre = polygonArea(p);
    for (int(i) = 0; (i) < (int)(n); ++(i)) {
      Point A = Point(x, Y[i][x]), B = Point(x + 1, Y[i][x + 1]);
      p = cutPolygon(p, A, B);
      double t = polygonArea(p);
      ans[i] += pre - t, pre = t;
    }
  }
  for (int(i) = 0; (i) < (int)(n); ++(i))
    cout << fixed << setprecision(17) << ans[i] << "\n";
  return 0;
}