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 JAVA):

Solution:
import java.util.*;
import java.io.*;
 
public class E {
	FastScanner in;
	PrintWriter out;
 
	class Point {
		double x, y;
 
		public Point(double x, double y) {
			super();
			this.x = x;
			this.y = y;
		}
	}
 
	class Segment {
		Point p, q;
		double a, b, c;
 
		public Segment(Point p, Point q) {
			super();
			this.p = p;
			this.q = q;
			a = p.y - q.y;
			b = q.x - p.x;
			c = -(a * p.x + b * p.y);
		}
	}
 
	final double eps = 1e-9;
 
	double vec(Point p0, Point p1, Point p2) {
		double x1 = p1.x - p0.x;
		double x2 = p2.x - p0.x;
		double y1 = p1.y - p0.y;
		double y2 = p2.y - p0.y;
		return x1 * y2 - x2 * y1;
	}
 
	double vec(Segment s, Point p) {
		return vec(s.p, s.q, p);
	}
 
	Point intersect(Segment s0, Segment s1) {
		// s0.a * x + s0.b * y = -s0.c
		// s1.a * x + s1.b * y = -s1.c
		double det = s0.a * s1.b - s0.b * s1.a;
		double detx = -s0.c * s1.b + s0.b * s1.c;
		double dety = -s1.c * s0.a + s0.c * s1.a;
		if (Math.abs(det) < eps) {
			return null;
		}
		Point p = new Point(detx / det, dety / det);
		if (vec(s0, s1.p) * vec(s0, s1.q) < eps && vec(s1, s0.p) * vec(s1, s0.q) < eps) {
			return p;
		} else {
			return null;
		}
	}
 
	ArrayList<Point>[] pts;
 
	boolean under(Segment s, Point p) {
		double sy = s.p.y + (p.x - s.p.x) / (s.q.x - s.p.x) * (s.q.y - s.p.y);
		return sy + eps > p.y;
	}
 
	ArrayList<Point> add(ArrayList<Point> ps, int yl, int yr) {
		Segment s1 = new Segment(new Point(0, yl), new Point(1, yr));
		ArrayList<Point> newps = new ArrayList<>();
		if (yl > ps.get(0).y) {
			newps.add(new Point(0, yl));
		} else {
			newps.add(ps.get(0));
		}
		for (int i = 1; i < ps.size(); i++) {
			Point p = ps.get(i - 1), q = ps.get(i);
			Segment s2 = new Segment(p, q);
			Point inter = intersect(s1, s2);
			if (inter != null) {
				newps.add(inter);
			}
			if (!under(s1, q)) {
				newps.add(q);
			}
		}
		if (under(s1, ps.get(ps.size() - 1))) {
			newps.add(new Point(1, yr));
		}
		return newps;
	}
 
	double square(ArrayList<Point> pts) {
		double res = 0;
		for (int i = 0; i < pts.size() - 1; i++) {
			Point p = pts.get(i), q = pts.get(i + 1);
			res += (q.x - p.x) * (p.y + q.y) / 2;
		}
		return res;
	}
 
	public void solve() throws IOException {
		int n = in.nextInt(), k = in.nextInt();
		pts = new ArrayList[k];
		for (int i = 0; i < k; i++) {
			pts[i] = new ArrayList<>();
			pts[i].add(new Point(0, 0));
			pts[i].add(new Point(1, 0));
		}
		double sPrev = 0, sCur = 0;
		for (int i = 0; i < n; i++) {
			int[] y = new int[k + 1];
			sCur = 0;
			for (int j = 0; j <= k; j++) {
				y[j] = in.nextInt();
				if (j > 0) {
					pts[j - 1] = add(pts[j - 1], y[j - 1], y[j]);
					sCur += square(pts[j - 1]);
				}
			}
			out.println(sCur - sPrev);
			sPrev = sCur;
		}
	}
 
	public void run() {
		try {
			in = new FastScanner();
			out = new PrintWriter(System.out);
 
			solve();
 
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
 
	class FastScanner {
		BufferedReader br;
		StringTokenizer st;
 
		FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
 
		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}
 
	public static void main(String[] arg) {
		new E().run();
	}
}